{
  "openapi": "3.1.0",
  "info": {
    "title": "webscrapingapi.dev API",
    "version": "1.0.0",
    "summary": "Free web scraping API: any page as HTML, text, Markdown or JSON, plus JSON endpoints for sites the service already knows.",
    "description": "Free: 50,000 credits per account per day, 60 requests per minute per key. A plain fetch costs 1 credit, a JavaScript render 5, metadata and site endpoints 1; answers served from the shared store cost 0. Human documentation: https://webscrapingapi.dev/docs. Machine-readable overview: https://webscrapingapi.dev/llms.txt.",
    "termsOfService": "https://webscrapingapi.dev/terms",
    "contact": {
      "name": "webscrapingapi.dev",
      "url": "https://webscrapingapi.dev/about"
    }
  },
  "servers": [
    {
      "url": "https://api.webscrapingapi.dev"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "site endpoints",
      "description": "Ready-made JSON for known sites. 1 credit live, 0 from the shared store."
    },
    {
      "name": "jobs",
      "description": "Run a list of targets once in the background; read the results or receive them at an endpoint."
    },
    {
      "name": "endpoints",
      "description": "URLs that receive job results, signed with WSA-Signature."
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "operationId": "health",
        "summary": "Health check (no key needed)",
        "security": [],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string",
                      "description": "The deployed commit (7 characters)."
                    },
                    "builtAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When the deployed build was made."
                    },
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/scrape": {
      "get": {
        "operationId": "scrape",
        "summary": "Fetch any page as HTML, text, Markdown or JSON",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "http or https URL. Private and reserved addresses are rejected with `URL_BLOCKED`."
          },
          {
            "name": "render",
            "in": "query",
            "schema": {
              "oneOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "auto"
                  ]
                }
              ],
              "default": false
            },
            "description": "`true`: run the page in headless Chrome and return the DOM after JavaScript (5 credits). Images, fonts and media are not loaded. `auto`: fetch statically first (1 credit); only if the page turns out to be an app shell with almost no text is it rendered, for 5 credits in total. The response says what happened in `autoRender` (`not-needed`, `app-shell`, `thin-content`, `blocked`, `quota-exceeded`, `unavailable`, `render-failed`). Bot walls and error pages are never rendered."
          },
          {
            "name": "waitFor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "With `render`: wait until this CSS selector exists."
          },
          {
            "name": "wait",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            },
            "description": "With `render`: extra wait after load, up to 10000."
          },
          {
            "name": "timeout",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1000,
              "maximum": 30000,
              "default": 15000
            },
            "description": "1000–30000. Default 15000. In a job, rendering gets up to 60 s whatever this says."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "text",
                "markdown",
                "json"
              ],
              "default": "html"
            },
            "description": "Default `html` (`markdown` in a job). `text` strips tags and keeps paragraph breaks. `markdown` keeps headings, lists, tables, code and absolute links — made for feeding a model. `json` requires `extract`."
          },
          {
            "name": "selector",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Return only this element (html, text or markdown formats). Overrides `main`."
          },
          {
            "name": "main",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "description": "text and markdown only. Default `true`: keep the main content and drop navigation, headers, footers, sidebars, cookie banners, share and \"related\" blocks. Set `false` for the whole body. Same idea as Firecrawl's `onlyMainContent`."
          },
          {
            "name": "links",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "inline",
                "refs",
                "none"
              ],
              "default": "inline"
            },
            "description": "markdown only. Default `inline`: `[text](url)`. `refs`: the text stays, a footnote mark `[^n]` follows it and every URL appears once at the end as `[^n]: url` (GFM footnote syntax, so the numbers never collide with a page's own `[1]` citations). Prose reads without URLs; the size only drops when URLs repeat. `none`: text only, the smallest output."
          },
          {
            "name": "images",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "alt",
                "inline",
                "none"
              ],
              "default": "alt"
            },
            "description": "markdown only. Default `alt`: only the description, as `(image: alt)`. `inline`: `![alt](url)`. `none`: removed."
          },
          {
            "name": "exclude",
            "in": "query",
            "schema": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 20
                }
              ]
            },
            "description": "text and markdown. CSS selectors removed before extraction, up to 20, e.g. `.promo, #newsletter`. Applied on top of `main`."
          },
          {
            "name": "max_chars",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 200
            },
            "description": "text and markdown. Cut at a paragraph boundary (an open code fence is closed) and set `truncated: true`. The front matter and the references list are not counted."
          },
          {
            "name": "front_matter",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "markdown only. Prepend a YAML block with the `meta` values that exist plus `url`, the way LangChain and LlamaIndex loaders read it."
          },
          {
            "name": "profile",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "article",
                "discussion",
                "listing",
                "product"
              ]
            },
            "description": "text and markdown. Pin the page type instead of letting the server detect it (`pageType.by` becomes `param`). Each type has its own skeleton (see Markdown output). Ignored with `selector` or `main=false`."
          },
          {
            "name": "extract",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "JSON object"
            },
            "description": "Field → rule map: a CSS selector string, or `{ selector, attr, all, html }`. Up to 50 fields. In GET, pass it as a JSON string."
          },
          {
            "name": "raw",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Respond with the body itself (text/html, text/markdown or text/plain) instead of the JSON envelope — handy with curl. Status and final URL come back in `X-Scrape-*` headers. With `format=json` the envelope stays."
          },
          {
            "name": "max_age",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Accept a *shared* result: if anyone — a job or another caller — fetched the same URL with the same format, rendering and extraction rules within this many seconds (30 days at most), you get that copy for 0 credits with `source: \"shared\"` and `age`. Otherwise the page is fetched live and stored for the next caller. Omit it to always fetch fresh (nothing is stored). Not with `headers`. In a job, `max_age` is set on the whole job."
          }
        ],
        "responses": {
          "200": {
            "description": "The page, in the requested format. The target's own status code is in statusCode; a 404 from the target is still a 200 here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrapeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scrapePost",
        "summary": "Same as GET /v1/scrape with a JSON body (easier for extract rules and headers)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrapeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The page, in the requested format. The target's own status code is in statusCode; a 404 from the target is still a 200 here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrapeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metadata": {
      "get": {
        "operationId": "metadata",
        "summary": "Title, description, canonical, favicon, language, Open Graph, Twitter card and JSON-LD from the head",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured": {
      "get": {
        "operationId": "listSites",
        "summary": "Public registry of site-specific endpoints",
        "security": [],
        "responses": {
          "200": {
            "description": "Registry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sites": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs": {
      "post": {
        "operationId": "createJob",
        "tags": [
          "jobs"
        ],
        "summary": "Run a list of targets once, in the background; get a job_ id",
        "description": "Each target is fetched once; rendering gets up to 60 s. Up to 50 targets per job and 10 unfinished jobs per account. With endpoint, the results are POSTed to it once when every target has finished (see webhooks.jobCompleted). With max_age, a result anyone fetched within that many seconds is reused for 0 credits.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listJobs",
        "tags": [
          "jobs"
        ],
        "summary": "Your 50 most recent jobs",
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/JobSummary"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getJob",
        "tags": [
          "jobs"
        ],
        "summary": "Status, counts and every target's state — poll until status is completed",
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteJob",
        "tags": [
          "jobs"
        ],
        "summary": "Delete the job",
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}/results": {
      "get": {
        "operationId": "getJobResults",
        "tags": [
          "jobs"
        ],
        "summary": "Finished results, in pages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One target: the URL or site call you submitted, or its targetId."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "The next value from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResults"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/endpoints": {
      "post": {
        "operationId": "createEndpoint",
        "tags": [
          "endpoints"
        ],
        "summary": "Register a URL that receives job results; the signing secret is shown once",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https, public address"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndpointCreated"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listEndpoints",
        "tags": [
          "endpoints"
        ],
        "summary": "Your endpoints",
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Endpoint"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/endpoints/{id}": {
      "delete": {
        "operationId": "deleteEndpoint",
        "tags": [
          "endpoints"
        ],
        "summary": "Delete the endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/amazon/product": {
      "get": {
        "operationId": "amazon_product",
        "summary": "Amazon product: Product by ASIN",
        "description": "The product detail page as JSON. A parameter this endpoint does not define is refused with 400. Results are stored for 86400 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { product { name, url, brand { name, url }, price, regularPrice, currency, availability, aggregateRating { ratingValue, reviewCount }, mainImage, images[], description, features[], additionalProperties[] { name, value }, breadcrumbs[] { name, url }, sku }, extra { asin, tld, bestSellersRank[] { rank, category }, soldBy, shipsFrom, boughtInPastMonth, availabilityText } }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "asin",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The 10-character Amazon product id.",
            "example": "B0B44XTV71"
          },
          {
            "name": "tld",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Marketplace: com, co.uk, de, fr, it, es, ca, co.jp, in, com.au, com.mx, com.br, nl, ae, sa, se, pl. Default com.",
            "example": "com"
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO 4217 code for prices, e.g. USD, EUR, JPY. Default USD.",
            "example": "USD"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 86400
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "amazon",
                  "action": "product",
                  "data": {
                    "product": {
                      "name": "CUCKOO Twin Pressure Rice Cooker, 12-Cup, White",
                      "brand": {
                        "name": "CUCKOO",
                        "url": null
                      },
                      "price": "339.99",
                      "currency": "USD",
                      "availability": "InStock",
                      "aggregateRating": {
                        "ratingValue": "4.4",
                        "reviewCount": 608
                      },
                      "images": [
                        "https://m.media-amazon.com/images/I/…jpg"
                      ],
                      "features": [
                        "…",
                        "…"
                      ],
                      "sku": "B0B44XTV71"
                    },
                    "extra": {
                      "asin": "B0B44XTV71",
                      "tld": "com"
                    }
                  },
                  "source": "cache",
                  "age": 412,
                  "credits": 0
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/youtube/video": {
      "get": {
        "operationId": "youtube_video",
        "summary": "YouTube video: Video by id",
        "description": "The watch page metadata as JSON. A parameter this endpoint does not define is refused with 400. Results are stored for 3600 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { video { id, url, title, description, channel { id, name, url }, durationSeconds, viewCount, likeCount, publishedAt, category, thumbnails[] { url, width, height }, keywords[], isLive, familySafe } }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The 11-character video id (the v= parameter).",
            "example": "dQw4w9WgXcQ"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 3600
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "youtube",
                  "action": "video",
                  "data": {
                    "video": {
                      "id": "dQw4w9WgXcQ",
                      "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
                      "channel": {
                        "id": "UCuAXFkgsw1L7xaCfnd5JJOw",
                        "name": "Rick Astley",
                        "url": "http://www.youtube.com/@RickAstleyYT"
                      },
                      "durationSeconds": 213,
                      "viewCount": 1818228078,
                      "likeCount": 19384777,
                      "publishedAt": "2009-10-24T23:57:33-07:00",
                      "category": "Music",
                      "thumbnails": [
                        {
                          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
                          "width": 1280,
                          "height": 720
                        }
                      ],
                      "keywords": [
                        "rick astley",
                        "Never Gonna Give You Up"
                      ]
                    }
                  },
                  "source": "live",
                  "age": 0,
                  "credits": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/appstore/app": {
      "get": {
        "operationId": "appstore_app",
        "summary": "App Store app: App by id",
        "description": "The listing page as JSON. A parameter this endpoint does not define is refused with 400. Results are stored for 86400 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { app { name, url, platform (always \"ios\"), id (numeric app id), developer { name, url }, description, category, price, currency, free, rating { value, count }, icon, screenshots[], contentRating, osRequirement, installs (null on iOS), updatedAt, version } }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The numeric app id (the id… part of the URL).",
            "example": "284882215"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Storefront country code. Default us.",
            "example": "us"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 86400
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "appstore",
                  "action": "app",
                  "data": {
                    "app": {
                      "name": "Facebook",
                      "platform": "ios",
                      "id": "284882215",
                      "developer": {
                        "name": "Meta Platforms, Inc.",
                        "url": "https://apps.apple.com/us/developer/…"
                      },
                      "category": "Social Networking",
                      "price": "0",
                      "currency": "USD",
                      "free": true,
                      "rating": {
                        "value": 4.5,
                        "count": 28420068
                      },
                      "icon": "https://is1-ssl.mzstatic.com/image/thumb/…png",
                      "osRequirement": "Requires iOS 15.1 or later."
                    }
                  },
                  "source": "live",
                  "age": 0,
                  "credits": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/googleplay/app": {
      "get": {
        "operationId": "googleplay_app",
        "summary": "Google Play app: App by package",
        "description": "The listing page as JSON. A parameter this endpoint does not define is refused with 400. Results are stored for 86400 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { app { name, url, platform (always \"android\"), id (package name), developer { name, url }, description, category, price, currency, free, rating { value, count }, icon, screenshots[], contentRating, osRequirement (null on Android), installs, updatedAt, version } }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The package name (the id= parameter).",
            "example": "com.spotify.music"
          },
          {
            "name": "hl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Language, e.g. en, ko. Default en.",
            "example": "en"
          },
          {
            "name": "gl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Country, e.g. US, KR. Default US.",
            "example": "US"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 86400
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "googleplay",
                  "action": "app",
                  "data": {
                    "app": {
                      "name": "Spotify: Music and Podcasts",
                      "platform": "android",
                      "id": "com.spotify.music",
                      "developer": {
                        "name": "Spotify AB",
                        "url": "https://www.spotify.com"
                      },
                      "category": "MUSIC_AND_AUDIO",
                      "price": "0",
                      "currency": "USD",
                      "free": true,
                      "rating": {
                        "value": 4.35,
                        "count": 36339801
                      },
                      "installs": "1B+",
                      "contentRating": "Teen",
                      "updatedAt": "Sep 18, 2026"
                    }
                  },
                  "source": "live",
                  "age": 0,
                  "credits": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/hackernews/front": {
      "get": {
        "operationId": "hackernews_front",
        "summary": "Hacker News: Front page",
        "description": "Stories on the front page, in rank order. A parameter this endpoint does not define is refused with 400. Results are stored for 600 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { page, count, stories[] { id, rank, title, url, site, points, author, commentCount, age } }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Page number (1-based).",
            "example": "1"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 600
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "hackernews",
                  "action": "front",
                  "data": {
                    "count": 30,
                    "stories": [
                      {
                        "rank": 1,
                        "title": "Samsung is expected to more than double …",
                        "points": 125,
                        "commentCount": 84
                      }
                    ]
                  },
                  "source": "live",
                  "age": 0,
                  "credits": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/hackernews/item": {
      "get": {
        "operationId": "hackernews_item",
        "summary": "Hacker News: Item thread",
        "description": "A story with its comment thread (flattened, with depth). A parameter this endpoint does not define is refused with 400. Results are stored for 600 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { id, title, url, points, author, commentCount, age, commentsParsed, comments[] { id, author, age, depth, text } }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            },
            "description": "Hacker News item id.",
            "example": "1"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 600
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "hackernews",
                  "action": "item",
                  "data": {
                    "id": 1,
                    "title": "Y Combinator",
                    "commentsParsed": 3,
                    "comments": [
                      {
                        "id": 15,
                        "author": "sama",
                        "depth": 0,
                        "text": "…"
                      }
                    ]
                  },
                  "source": "live",
                  "age": 0,
                  "credits": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/wikipedia/summary": {
      "get": {
        "operationId": "wikipedia_summary",
        "summary": "Wikipedia: Article summary",
        "description": "Lead section of an article plus infobox key/values. A parameter this endpoint does not define is refused with 400. Results are stored for 604800 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { title, url, lang, summary, paragraphs[], thumbnail, infobox (label → value) }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Article title (spaces or underscores).",
            "example": "Web scraping"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Language edition (default en).",
            "example": "en"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 604800
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "wikipedia",
                  "action": "summary",
                  "data": {
                    "title": "Web scraping",
                    "lang": "en",
                    "summary": "Web scraping, web harvesting, or web data extraction is data scraping …",
                    "paragraphs": [
                      "…",
                      "…",
                      "…",
                      "…",
                      "…"
                    ],
                    "infobox": {}
                  },
                  "source": "cache",
                  "age": 3120,
                  "credits": 0
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/structured/github/repo": {
      "get": {
        "operationId": "github_repo",
        "summary": "GitHub: Repository",
        "description": "Public repository overview. A parameter this endpoint does not define is refused with 400. Results are stored for 3600 seconds by default and shared; a stored answer costs 0 credits and carries source: \"cache\". Returns data shaped like: { owner, repo, url, description, homepage, stars, forks, watchers, language (usually null — no longer in the server-rendered page), topics[], license, defaultBranch, archived, fork, releaseCount }",
        "tags": [
          "site endpoints"
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Owner login.",
            "example": "withastro"
          },
          {
            "name": "repo",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Repository name.",
            "example": "astro"
          },
          {
            "name": "max_age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 3600
            },
            "description": "Accept a stored copy up to this many seconds old (credits: 0; 30 days at most). Defaults to the endpoint's cache window; 0 forces a fresh fetch."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredResponse"
                },
                "example": {
                  "site": "github",
                  "action": "repo",
                  "data": {
                    "owner": "withastro",
                    "repo": "astro",
                    "description": "The web framework for content-driven websites.",
                    "stars": 62720,
                    "forks": 3798,
                    "watchers": 221,
                    "topics": [
                      "astro",
                      "blog",
                      "islands"
                    ],
                    "license": "Other",
                    "defaultBranch": "main",
                    "releaseCount": 3251,
                    "homepage": "https://astro.build"
                  },
                  "source": "live",
                  "age": 0,
                  "credits": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request or blocked URL (BAD_REQUEST, URL_BLOCKED). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN: account disabled, or the request did not come through https://api.webscrapingapi.dev.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown site/action, or the item does not exist on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: request body over 1 MB (POST).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED (per key, per minute) or QUOTA_EXCEEDED (per account, per day).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "FETCH_FAILED (target unreachable, a PDF from the target that cannot be read, or a site endpoint's target answered with an error status; charged), SITE_PARSE_FAILED (layout changed, refunded), SITE_BLOCKED (a site endpoint got a bot wall instead of the page, charged; /v1/scrape returns such a page as it came, with blocked) or RENDER_UNAVAILABLE (the rendering browser is off, failed to start or stayed busy; refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "TIMEOUT (charged) or RENDER_TOO_SLOW: rendering needs longer than a synchronous request allows (60 s); refunded — run it as a job instead, jobs render with up to 60 s.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "jobCompleted": {
      "post": {
        "summary": "Sent once to the job endpoint when every target has finished",
        "description": "Headers: WSA-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>, WSA-Event: job.completed, WSA-Job: job_…. Results are left out (results: null) above 5 MB. Answer 2xx within 10 s; 3 attempts in all.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobCompletedEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Keys start with wsa_ and are created in the dashboard."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same key as a Bearer token."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "BAD_REQUEST",
                  "PAYLOAD_TOO_LARGE",
                  "URL_BLOCKED",
                  "UNAUTHORIZED",
                  "FORBIDDEN",
                  "NOT_FOUND",
                  "RATE_LIMITED",
                  "QUOTA_EXCEEDED",
                  "FETCH_FAILED",
                  "SITE_PARSE_FAILED",
                  "SITE_BLOCKED",
                  "RENDER_UNAVAILABLE",
                  "RENDER_TOO_SLOW",
                  "TIMEOUT",
                  "INTERNAL_ERROR"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "ExtractRule": {
        "oneOf": [
          {
            "type": "string",
            "description": "CSS selector; returns the text of the first match"
          },
          {
            "type": "object",
            "properties": {
              "selector": {
                "type": "string"
              },
              "attr": {
                "type": "string",
                "description": "return this attribute; href and src become absolute URLs"
              },
              "all": {
                "type": "boolean",
                "description": "return every match as an array"
              },
              "html": {
                "type": "boolean",
                "description": "return inner HTML instead of text"
              }
            },
            "required": [
              "selector"
            ]
          }
        ]
      },
      "ScrapeRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "additionalProperties": false,
        "description": "An option name the API does not know is refused with 400, not ignored.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "http or https URL. Private and reserved addresses are rejected with `URL_BLOCKED`."
          },
          "render": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string",
                "enum": [
                  "auto"
                ]
              }
            ],
            "default": false,
            "description": "`true`: run the page in headless Chrome and return the DOM after JavaScript (5 credits). Images, fonts and media are not loaded. `auto`: fetch statically first (1 credit); only if the page turns out to be an app shell with almost no text is it rendered, for 5 credits in total. The response says what happened in `autoRender` (`not-needed`, `app-shell`, `thin-content`, `blocked`, `quota-exceeded`, `unavailable`, `render-failed`). Bot walls and error pages are never rendered."
          },
          "waitFor": {
            "type": "string",
            "description": "With `render`: wait until this CSS selector exists."
          },
          "wait": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "default": 0,
            "description": "With `render`: extra wait after load, up to 10000."
          },
          "timeout": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 30000,
            "default": 15000,
            "description": "1000–30000. Default 15000. In a job, rendering gets up to 60 s whatever this says."
          },
          "format": {
            "type": "string",
            "enum": [
              "html",
              "text",
              "markdown",
              "json"
            ],
            "default": "html",
            "description": "Default `html` (`markdown` in a job). `text` strips tags and keeps paragraph breaks. `markdown` keeps headings, lists, tables, code and absolute links — made for feeding a model. `json` requires `extract`."
          },
          "selector": {
            "type": "string",
            "description": "Return only this element (html, text or markdown formats). Overrides `main`."
          },
          "main": {
            "type": "boolean",
            "default": true,
            "description": "text and markdown only. Default `true`: keep the main content and drop navigation, headers, footers, sidebars, cookie banners, share and \"related\" blocks. Set `false` for the whole body. Same idea as Firecrawl's `onlyMainContent`."
          },
          "links": {
            "type": "string",
            "enum": [
              "inline",
              "refs",
              "none"
            ],
            "default": "inline",
            "description": "markdown only. Default `inline`: `[text](url)`. `refs`: the text stays, a footnote mark `[^n]` follows it and every URL appears once at the end as `[^n]: url` (GFM footnote syntax, so the numbers never collide with a page's own `[1]` citations). Prose reads without URLs; the size only drops when URLs repeat. `none`: text only, the smallest output."
          },
          "images": {
            "type": "string",
            "enum": [
              "alt",
              "inline",
              "none"
            ],
            "default": "alt",
            "description": "markdown only. Default `alt`: only the description, as `(image: alt)`. `inline`: `![alt](url)`. `none`: removed."
          },
          "exclude": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 20
              }
            ],
            "description": "text and markdown. CSS selectors removed before extraction, up to 20, e.g. `.promo, #newsletter`. Applied on top of `main`."
          },
          "max_chars": {
            "type": "integer",
            "minimum": 200,
            "description": "text and markdown. Cut at a paragraph boundary (an open code fence is closed) and set `truncated: true`. The front matter and the references list are not counted."
          },
          "front_matter": {
            "type": "boolean",
            "default": false,
            "description": "markdown only. Prepend a YAML block with the `meta` values that exist plus `url`, the way LangChain and LlamaIndex loaders read it."
          },
          "profile": {
            "type": "string",
            "enum": [
              "article",
              "discussion",
              "listing",
              "product"
            ],
            "description": "text and markdown. Pin the page type instead of letting the server detect it (`pageType.by` becomes `param`). Each type has its own skeleton (see Markdown output). Ignored with `selector` or `main=false`."
          },
          "extract": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ExtractRule"
            },
            "description": "Field → rule map: a CSS selector string, or `{ selector, attr, all, html }`. Up to 50 fields. In GET, pass it as a JSON string."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Custom request headers, in a POST body only. Allowed: user-agent, accept, accept-language, cookie, referer. Not with `max_age` (`400`): a page fetched with your own headers is never shared. In a job such a target is private (see Jobs)."
          },
          "raw": {
            "type": "boolean",
            "default": false,
            "description": "Respond with the body itself (text/html, text/markdown or text/plain) instead of the JSON envelope — handy with curl. Status and final URL come back in `X-Scrape-*` headers. With `format=json` the envelope stays."
          },
          "max_age": {
            "type": "integer",
            "minimum": 0,
            "description": "Accept a *shared* result: if anyone — a job or another caller — fetched the same URL with the same format, rendering and extraction rules within this many seconds (30 days at most), you get that copy for 0 credits with `source: \"shared\"` and `age`. Otherwise the page is fetched live and stored for the next caller. Omit it to always fetch fresh (nothing is stored). Not with `headers`. In a job, `max_age` is set on the whole job."
          }
        }
      },
      "ScrapeResponse": {
        "type": "object",
        "required": [
          "url",
          "finalUrl",
          "statusCode",
          "contentType",
          "title",
          "rendered",
          "truncated",
          "meta",
          "stats",
          "converter",
          "pageType",
          "elapsedMs",
          "credits"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "finalUrl": {
            "type": "string",
            "description": "After redirects."
          },
          "statusCode": {
            "type": "integer",
            "description": "The target's own status code."
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "rendered": {
            "type": "boolean",
            "description": "true when headless Chrome produced the page."
          },
          "html": {
            "type": "string",
            "description": "format=html"
          },
          "text": {
            "type": "string",
            "description": "format=text"
          },
          "markdown": {
            "type": "string",
            "description": "format=markdown"
          },
          "data": {
            "type": "object",
            "description": "format=json, or extract with another format: the extracted values."
          },
          "truncated": {
            "type": "boolean"
          },
          "meta": {
            "$ref": "#/components/schemas/ScrapeMeta"
          },
          "stats": {
            "$ref": "#/components/schemas/ScrapeStats"
          },
          "converter": {
            "type": "integer",
            "description": "Version of the conversion rules that produced the response."
          },
          "pageType": {
            "$ref": "#/components/schemas/PageType"
          },
          "autoRender": {
            "type": "string",
            "enum": [
              "not-needed",
              "app-shell",
              "thin-content",
              "blocked",
              "quota-exceeded",
              "unavailable",
              "render-failed"
            ],
            "description": "render=auto only: what it did."
          },
          "blocked": {
            "type": "string",
            "enum": [
              "captcha",
              "challenge",
              "denied",
              "rate-limit"
            ],
            "description": "Present only when the target answered with a wall instead of the page: `captcha` (a CAPTCHA or robot check), `challenge` (a browser check such as \"Just a moment...\"), `denied` (a 403 or an access-denied page), `rate-limit` (a 429 Too Many Requests). The body is what the target sent, unchanged, and is charged like any page the target answered. It is never kept as a shared copy for `max_age`, so the next call fetches again."
          },
          "elapsedMs": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "live",
              "shared"
            ],
            "description": "With max_age only: shared when a stored copy answered (0 credits)."
          },
          "age": {
            "type": "integer",
            "description": "With max_age only: seconds since that copy was fetched."
          },
          "fetchedAt": {
            "type": "string",
            "format": "date-time",
            "description": "With max_age only."
          }
        }
      },
      "PageType": {
        "type": "object",
        "required": [
          "type",
          "by"
        ],
        "description": "The kind of page the server decided it fetched; each type has its own Markdown skeleton. Conservative — in doubt it says article.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "article",
              "discussion",
              "listing",
              "product"
            ],
            "description": "article: a title and a body. discussion: a post and its comments. listing: a list of items. product: one product."
          },
          "by": {
            "type": "string",
            "enum": [
              "param",
              "jsonld",
              "microdata",
              "og",
              "heuristic",
              "default"
            ],
            "description": "param: set by the profile parameter. jsonld/microdata/og: declared by the page (JSON-LD @type, schema.org itemtype, og:type). heuristic: URL shape and page shape agreed. default: nothing conclusive, treated as an article."
          }
        }
      },
      "ScrapeMeta": {
        "type": "object",
        "description": "Read from the page head: JSON-LD, then Open Graph, then meta/time tags. null when absent.",
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "author": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601 when parseable, else the raw text"
          },
          "modifiedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "lang": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonical": {
            "type": [
              "string",
              "null"
            ]
          },
          "siteName": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "ScrapeStats": {
        "type": "object",
        "description": "Size of the returned body.",
        "properties": {
          "chars": {
            "type": "integer"
          },
          "words": {
            "type": "integer"
          },
          "tokens": {
            "type": "integer",
            "description": "Estimate, within about 15% of GPT/Claude tokenizers."
          },
          "pages": {
            "type": "integer",
            "description": "PDF only: page count."
          }
        }
      },
      "MetadataResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "finalUrl": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonical": {
            "type": [
              "string",
              "null"
            ]
          },
          "favicon": {
            "type": [
              "string",
              "null"
            ]
          },
          "lang": {
            "type": [
              "string",
              "null"
            ]
          },
          "og": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "twitter": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "jsonLd": {
            "type": "array",
            "items": {}
          },
          "elapsedMs": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          }
        }
      },
      "TargetInput": {
        "oneOf": [
          {
            "type": "string",
            "description": "A URL (fetched as markdown) or site/action?params"
          },
          {
            "type": "object",
            "required": [
              "url"
            ],
            "additionalProperties": false,
            "description": "The same options as POST /v1/scrape except raw (a job answers in JSON) and max_age (set on the whole job). A target with headers is private: never merged or shared, its result kept with the job alone. Unknown names are refused (400).",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "http or https URL. Private and reserved addresses are rejected with `URL_BLOCKED`."
              },
              "render": {
                "oneOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "auto"
                    ]
                  }
                ],
                "default": false,
                "description": "`true`: run the page in headless Chrome and return the DOM after JavaScript (5 credits). Images, fonts and media are not loaded. `auto`: fetch statically first (1 credit); only if the page turns out to be an app shell with almost no text is it rendered, for 5 credits in total. The response says what happened in `autoRender` (`not-needed`, `app-shell`, `thin-content`, `blocked`, `quota-exceeded`, `unavailable`, `render-failed`). Bot walls and error pages are never rendered."
              },
              "waitFor": {
                "type": "string",
                "description": "With `render`: wait until this CSS selector exists."
              },
              "wait": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000,
                "default": 0,
                "description": "With `render`: extra wait after load, up to 10000."
              },
              "timeout": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 30000,
                "default": 15000,
                "description": "1000–30000. Default 15000. In a job, rendering gets up to 60 s whatever this says."
              },
              "format": {
                "type": "string",
                "enum": [
                  "html",
                  "text",
                  "markdown",
                  "json"
                ],
                "default": "html",
                "description": "Default `html` (`markdown` in a job). `text` strips tags and keeps paragraph breaks. `markdown` keeps headings, lists, tables, code and absolute links — made for feeding a model. `json` requires `extract`."
              },
              "selector": {
                "type": "string",
                "description": "Return only this element (html, text or markdown formats). Overrides `main`."
              },
              "main": {
                "type": "boolean",
                "default": true,
                "description": "text and markdown only. Default `true`: keep the main content and drop navigation, headers, footers, sidebars, cookie banners, share and \"related\" blocks. Set `false` for the whole body. Same idea as Firecrawl's `onlyMainContent`."
              },
              "links": {
                "type": "string",
                "enum": [
                  "inline",
                  "refs",
                  "none"
                ],
                "default": "inline",
                "description": "markdown only. Default `inline`: `[text](url)`. `refs`: the text stays, a footnote mark `[^n]` follows it and every URL appears once at the end as `[^n]: url` (GFM footnote syntax, so the numbers never collide with a page's own `[1]` citations). Prose reads without URLs; the size only drops when URLs repeat. `none`: text only, the smallest output."
              },
              "images": {
                "type": "string",
                "enum": [
                  "alt",
                  "inline",
                  "none"
                ],
                "default": "alt",
                "description": "markdown only. Default `alt`: only the description, as `(image: alt)`. `inline`: `![alt](url)`. `none`: removed."
              },
              "exclude": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20
                  }
                ],
                "description": "text and markdown. CSS selectors removed before extraction, up to 20, e.g. `.promo, #newsletter`. Applied on top of `main`."
              },
              "max_chars": {
                "type": "integer",
                "minimum": 200,
                "description": "text and markdown. Cut at a paragraph boundary (an open code fence is closed) and set `truncated: true`. The front matter and the references list are not counted."
              },
              "front_matter": {
                "type": "boolean",
                "default": false,
                "description": "markdown only. Prepend a YAML block with the `meta` values that exist plus `url`, the way LangChain and LlamaIndex loaders read it."
              },
              "profile": {
                "type": "string",
                "enum": [
                  "article",
                  "discussion",
                  "listing",
                  "product"
                ],
                "description": "text and markdown. Pin the page type instead of letting the server detect it (`pageType.by` becomes `param`). Each type has its own skeleton (see Markdown output). Ignored with `selector` or `main=false`."
              },
              "extract": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/ExtractRule"
                },
                "description": "Field → rule map: a CSS selector string, or `{ selector, attr, all, html }`. Up to 50 fields. In GET, pass it as a JSON string."
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Custom request headers, in a POST body only. Allowed: user-agent, accept, accept-language, cookie, referer. Not with `max_age` (`400`): a page fetched with your own headers is never shared. In a job such a target is private (see Jobs)."
              }
            }
          },
          {
            "type": "object",
            "required": [
              "site",
              "action"
            ],
            "properties": {
              "site": {
                "type": "string"
              },
              "action": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        ]
      },
      "JobCreate": {
        "type": "object",
        "required": [
          "targets"
        ],
        "additionalProperties": false,
        "description": "An unknown field is refused with 400, not ignored.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "targets": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/TargetInput"
            }
          },
          "endpoint": {
            "type": "string",
            "description": "ep_… from POST /v1/endpoints. Optional."
          },
          "max_age": {
            "type": "integer",
            "minimum": 0,
            "description": "Reuse a result anyone fetched within this many seconds, for 0 credits. At most 2592000 (30 days); a larger value counts as that. Default 0: fetch fresh."
          }
        }
      },
      "JobItem": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "targetId": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "The string form of the target — usable as ?target= on /results."
          },
          "spec": {
            "type": "object"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "ok",
              "error"
            ]
          },
          "statusCode": {
            "type": [
              "integer",
              "null"
            ]
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "fetched",
              "shared",
              null
            ]
          },
          "private": {
            "type": "boolean",
            "description": "Fetched with your own headers: the result is kept with this job alone and never shared."
          },
          "credits": {
            "type": "integer"
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "JobSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "job_…"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed"
            ]
          },
          "counts": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              },
              "running": {
                "type": "integer"
              },
              "ok": {
                "type": "integer"
              },
              "error": {
                "type": "integer"
              }
            }
          },
          "credits": {
            "type": "integer"
          },
          "maxAge": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "delivery": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "delivered",
                      "failed"
                    ]
                  },
                  "attempts": {
                    "type": "integer"
                  },
                  "lastStatusCode": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "lastError": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "deliveredAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                }
              }
            ]
          }
        }
      },
      "Job": {
        "allOf": [
          {
            "$ref": "#/components/schemas/JobSummary"
          },
          {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/JobItem"
                }
              }
            }
          }
        ]
      },
      "JobResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/JobItem"
          },
          "result": {
            "description": "item.spec.kind decides the shape: url → ScrapeResponse minus elapsedMs and credits; site → the endpoint data. null until the target finished, or when it failed."
          }
        }
      },
      "JobResults": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed"
            ]
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobResult"
            }
          },
          "next": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pass as ?cursor= for the next page; null on the last page."
          }
        }
      },
      "Endpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ep_…"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "secretPrefix": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastDelivery": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "job": {
                    "type": "string"
                  },
                  "ok": {
                    "type": "boolean"
                  },
                  "statusCode": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "EndpointCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Endpoint"
          },
          {
            "type": "object",
            "properties": {
              "secret": {
                "type": "string",
                "description": "whsec_… — shown only in this response. Signs every delivery."
              }
            }
          }
        ]
      },
      "JobCompletedEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "job.completed"
          },
          "job": {
            "$ref": "#/components/schemas/JobSummary"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobItem"
            }
          },
          "resultsIncluded": {
            "type": "boolean"
          },
          "results": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/JobResult"
                }
              }
            ]
          },
          "resultsUrl": {
            "type": "string"
          }
        }
      },
      "StructuredResponse": {
        "type": "object",
        "properties": {
          "site": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "params": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "description": "Shape depends on the endpoint; see its description."
          },
          "source": {
            "type": "string",
            "enum": [
              "live",
              "cache"
            ]
          },
          "age": {
            "type": "integer",
            "description": "seconds since the data was fetched"
          },
          "fetchedAt": {
            "type": "string",
            "format": "date-time"
          },
          "credits": {
            "type": "integer"
          },
          "elapsedMs": {
            "type": "integer"
          }
        }
      }
    }
  }
}