{
  "openapi": "3.1.0",
  "info": {
    "title": "Spidra API",
    "version": "1.0.0",
    "description": "Public API endpoints for web scraping via Spidra. Authenticate with `Authorization: Bearer YOUR_API_KEY` or `x-api-key: YOUR_API_KEY`; both work on every endpoint."
  },
  "servers": [
    {
      "url": "https://api.spidra.io/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "message": {
            "type": "string",
            "description": "What went wrong, as a sentence you can show to a person."
          },
          "code": {
            "type": "string",
            "description": "A stable code for the error, when there is one, such as `JOB_NOT_FOUND` or `SERVICE_BUSY`. Branch on this rather than on `message`."
          },
          "errors": {
            "description": "On validation errors (`422`), every problem with the request. Scrape, batch, crawl, map and search return a list of sentences. Templates, presets and monitors return `{ field, message }` objects.",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          },
          "retry_after": {
            "type": "integer",
            "description": "On `503 SERVICE_BUSY`, how many seconds to wait before sending the request again."
          }
        }
      },
      "ScrapeAction": {
        "type": "object",
        "description": "One browser step. Steps run in order. If a step fails, the job fails (and is free) unless the step has optional: true. The type name is case-insensitive and a few aliases are accepted (fill for type, waitForSelector for waitFor, keypress for press, infiniteScroll for scrollUntilEnd, executeJavascript for evaluate). Older field names still work: value as the element of click, check, uncheck and hover, text for the text to type, duration, timeout or value for the milliseconds of wait, and value for the position of scroll. At most 50 actions per URL, and the wait durations, waitFor timeouts and scrollUntilEnd pauses can add up to 60 seconds. forEach may appear once, as the last action.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "click",
              "type",
              "check",
              "uncheck",
              "hover",
              "select",
              "press",
              "wait",
              "waitFor",
              "scroll",
              "scrollUntilEnd",
              "evaluate",
              "screenshot",
              "forEach"
            ],
            "description": "What the step does. Case-insensitive."
          },
          "optional": {
            "type": "boolean",
            "default": false,
            "description": "If true and the step fails, it is skipped and reported as skipped (with a warning) instead of failing the job."
          },
          "selector": {
            "type": "string",
            "maxLength": 500,
            "description": "The element: a CSS selector, an XPath (starting with //), or a plain-English description such as 'the Sign in button', which the AI finds on the page. Used by click, check, uncheck, hover, select, waitFor, type and press. For type it is optional (the first visible text field), and for press it is optional (the key goes to the page)."
          },
          "value": {
            "type": [
              "string",
              "number",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "type: the text to type (up to 5,000 characters, never sent to the AI). select: the option to choose, by its label or value, or a list of them. Older requests also use value as the target of click, check, uncheck and hover, as the milliseconds of wait, as the position of scroll and as the key of press."
          },
          "text": {
            "type": "string",
            "description": "type: another name for value."
          },
          "key": {
            "type": "string",
            "description": "press: the key to press, such as 'Enter', 'Tab', 'Escape', 'ArrowDown' or 'Control+A'."
          },
          "timeout": {
            "type": "number",
            "minimum": 100,
            "maximum": 30000,
            "default": 10000,
            "description": "Milliseconds an element step waits for its element. For waitFor, how long to wait for the state."
          },
          "duration": {
            "type": "number",
            "minimum": 1,
            "maximum": 30000,
            "description": "wait: milliseconds to pause."
          },
          "state": {
            "type": "string",
            "enum": [
              "visible",
              "attached",
              "hidden",
              "detached"
            ],
            "default": "visible",
            "description": "waitFor: the state to wait for."
          },
          "to": {
            "type": [
              "string",
              "number"
            ],
            "description": "scroll: a percentage of the page height (0 to 100, as 80 or '80%'), 'top', 'bottom', or an element (selector or description) to scroll into view."
          },
          "pixels": {
            "type": "number",
            "minimum": -100000,
            "maximum": 100000,
            "description": "scroll: scroll by this many pixels from the current position. Negative scrolls up. Use it instead of to."
          },
          "maxScrolls": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 10,
            "description": "scrollUntilEnd: the most rounds to scroll (or click clickSelector)."
          },
          "pause": {
            "type": "number",
            "minimum": 200,
            "maximum": 5000,
            "default": 1500,
            "description": "scrollUntilEnd: milliseconds to wait after each round for new content."
          },
          "clickSelector": {
            "type": "string",
            "maxLength": 500,
            "description": "scrollUntilEnd: a 'Load more' button (selector or description) to click each round while it is visible, instead of scrolling."
          },
          "script": {
            "type": "string",
            "maxLength": 10000,
            "description": "evaluate: JavaScript to run in the page. An expression is returned as is; statements need return. The value comes back in actionResults[].result, up to 10,000 characters."
          },
          "fullPage": {
            "type": "boolean",
            "default": false,
            "description": "screenshot: capture the whole scrollable page instead of the visible part. The link comes back in actionResults[].screenshotUrl."
          },
          "observe": {
            "type": "string",
            "maxLength": 500,
            "description": "forEach: the items to go through, in plain English, such as 'each book title link in the product grid'. Required for forEach."
          },
          "mode": {
            "type": "string",
            "enum": [
              "click",
              "inline",
              "navigate"
            ],
            "default": "click",
            "description": "forEach: inline reads each item where it is; navigate opens the page each item links to; click clicks each item and reads what opens (if the click follows a link, Spidra goes back afterwards)."
          },
          "captureSelector": {
            "type": "string",
            "maxLength": 500,
            "description": "forEach: the part of the page to read for each item (selector or description). In inline mode a CSS selector also lists the items directly. If it isn't found for an item, that item fails."
          },
          "maxItems": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 50,
            "description": "forEach: the most items to process, across all results pages."
          },
          "waitAfterClick": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "default": 2500,
            "description": "forEach: milliseconds to wait after clicking or opening an item before reading it."
          },
          "itemPrompt": {
            "type": "string",
            "maxLength": 2000,
            "description": "forEach: an AI prompt run on each item's content. Billed by tokens with the job's AI."
          },
          "actions": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/ScrapeAction"
            },
            "description": "forEach: up to 10 steps to run on each item after it is clicked or opened (click and navigate modes). No forEach inside. A failed step fails that item."
          },
          "pagination": {
            "type": "object",
            "description": "forEach: go on to the next results page after the items on this one.",
            "required": [
              "nextSelector"
            ],
            "properties": {
              "nextSelector": {
                "type": "string",
                "description": "The next-page link or button (selector or description)."
              },
              "maxPages": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10,
                "default": 5,
                "description": "The most results pages to go through, counting the first one."
              }
            }
          }
        }
      },
      "ScrapeUrl": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The page to scrape, starting with `http://` or `https://`. Links to PDF, Word, Excel and PowerPoint files work too. Tracking parameters such as `utm_source`, `gclid` and `fbclid` are removed before the page is read.",
            "example": "https://books.toscrape.com"
          },
          "actions": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ScrapeAction"
            },
            "description": "Browser steps to run in order before the page is read, such as clicking a button or scrolling to the end. Can't be combined with `instruction`. See [Browser actions](/options/browser-actions)."
          },
          "instruction": {
            "type": "string",
            "maxLength": 2000,
            "description": "One task in plain English, such as `\"Click the Next page link\"`, carried out before the page is read. Can't be combined with `actions`. If it can't be carried out, the job fails and you aren't charged."
          },
          "useProxy": {
            "type": "boolean",
            "description": "Turns Stealth Mode on or off for this URL only, overriding the request's `useProxy`."
          },
          "deliveryZip": {
            "type": "string",
            "description": "For Amazon and Walmart product pages, the delivery postcode to check prices and availability for, such as `\"90210\"`. If it can't be applied, that `data[]` entry has a `warnings` entry saying so.",
            "example": "90210"
          }
        }
      },
      "JobStatus": {
        "type": "string",
        "enum": [
          "waiting",
          "delayed",
          "active",
          "completed",
          "failed"
        ],
        "description": "- `waiting`: queued, not started yet.\n- `delayed`: waiting to be retried after a temporary problem.\n- `active`: running. `progress.message` says what it's doing.\n- `completed`: finished. The result is in `result`.\n- `failed`: couldn't be done. `error` says why, and you aren't charged.\n"
      },
      "ScrapeResult": {
        "type": "object",
        "description": "The finished result of a scrape.",
        "properties": {
          "content": {
            "type": [
              "string",
              "object",
              "array"
            ],
            "description": "The answer to the request.\n\n- No `prompt` or `schema`: the page as Markdown. With several URLs, the pages are joined and each starts with a `Content from: <url>` line.\n- With a `prompt`: what you asked for, in a shape the AI chooses (text, an object or a list).\n- With a `schema`: an object that matches your schema, with `null` for anything the page doesn't show.\n- `output: \"json\"` with no prompt on a [popular site](/sites/overview): the page's data. With several URLs, a list with one entry per URL.\n"
          },
          "data": {
            "type": "array",
            "description": "One entry per URL, in the order you sent them.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "The URL exactly as you sent it."
                },
                "canonicalUrl": {
                  "type": "string",
                  "description": "Only when the link that was read differs from the one you sent, for example after a short link was followed."
                },
                "title": {
                  "type": "string",
                  "description": "The page title."
                },
                "markdownContent": {
                  "type": "string",
                  "description": "The page as Markdown."
                },
                "structuredData": {
                  "type": "object",
                  "description": "Only on [popular sites](/sites/overview). The page's data, such as a product's price and seller or a video's views."
                },
                "success": {
                  "type": "boolean",
                  "description": "Whether this URL was read."
                },
                "captchaSolvedCount": {
                  "type": "integer",
                  "description": "How many CAPTCHAs were solved on this page. Each costs 5 credits."
                },
                "lowContent": {
                  "type": "boolean",
                  "description": "`true` when the page had very little text, which usually means a bot check, a cookie wall or a redirect to an empty page."
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Only when something on this page needs your attention, such as an optional action that was skipped or a `deliveryZip` that couldn't be applied."
                },
                "actionResults": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ActionResult"
                  },
                  "description": "Only when the URL had `actions`. How each step went, in order."
                },
                "forEachItems": {
                  "type": "integer",
                  "description": "Only with a `forEach` action. How many items it delivered."
                },
                "screenshotUrl": {
                  "type": "string",
                  "format": "uri",
                  "description": "Only with `screenshot` or `fullPageScreenshot`. A link to this page's screenshot."
                },
                "readFrom": {
                  "type": "object",
                  "description": "Where the page was read from. Sites change their language, prices and cookie walls by country.",
                  "properties": {
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "A two-letter country code such as `US` or `DE` (or `EU`, `ASIA`), or `null` when Stealth Mode had no country picked."
                    },
                    "via": {
                      "type": "string",
                      "enum": [
                        "stealth",
                        "proxy",
                        "server"
                      ],
                      "description": "- `stealth`: Stealth Mode, in the country picked.\n- `proxy`: the free proxy in the country the request came from.\n- `server`: Spidra's own servers, in the US. Also used when a proxy failed and the page was read again without it (the page's `warnings` says so)."
                    }
                  },
                  "example": {
                    "country": "DE",
                    "via": "stealth"
                  }
                },
                "metadata": {
                  "$ref": "#/components/schemas/PageMetadata"
                }
              }
            }
          },
          "screenshots": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "Links to the screenshots, when you asked for them. Empty otherwise."
          },
          "ai_extraction_failed": {
            "type": "boolean",
            "description": "`true` when the AI step failed and `content` holds the page Markdown instead of your data. Send the request again, or simplify the prompt or schema."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only when there is something to know about the whole job, such as credits running out partway through a `forEach`. With several URLs, each warning starts with its URL."
          },
          "stats": {
            "type": "object",
            "description": "How the job ran.",
            "properties": {
              "durationMs": {
                "type": "integer",
                "description": "How long the job took, in milliseconds."
              },
              "captchaSolvedCount": {
                "type": "integer",
                "description": "CAPTCHAs solved across all URLs."
              },
              "inputTokens": {
                "type": "integer",
                "description": "Tokens the AI read. `0` when no AI was used."
              },
              "outputTokens": {
                "type": "integer",
                "description": "Tokens the AI wrote."
              },
              "totalTokens": {
                "type": "integer",
                "description": "`inputTokens` plus `outputTokens`. About 3,300 input tokens or 400 output tokens make 1 credit."
              }
            }
          }
        }
      },
      "ScrapeLogSummary": {
        "type": "object",
        "description": "One past scrape, as returned to an API key. Logs use snake_case field names. Flags such as `use_proxy` are `0` or `1`.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The log's ID. Not the same as the scrape's `jobId`. Use it with `GET /scrape-logs/{uuid}`."
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error",
              "in_progress"
            ],
            "description": "`success` (finished), `error` (failed, `error_message` says why) or `in_progress` (still running)."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the scrape started."
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it finished. `null` while it runs."
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the scrape failed. Empty or `null` when it didn't."
          },
          "urls": {
            "type": "array",
            "description": "The URLs scraped, each with the browser actions it ran.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "The URL."
                },
                "actions": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "description": "The browser actions sent for this URL. Empty when there were none."
                }
              }
            }
          },
          "extraction_prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `prompt` sent, if any."
          },
          "input_tokens": {
            "type": "integer",
            "description": "Tokens the AI read. `0` when no AI was used."
          },
          "output_tokens": {
            "type": "integer",
            "description": "Tokens the AI wrote."
          },
          "tokens_used": {
            "type": "integer",
            "description": "`input_tokens` plus `output_tokens`."
          },
          "captcha_solved_count": {
            "type": "integer",
            "description": "CAPTCHAs solved across all URLs."
          },
          "scraped_sites_count": {
            "type": "integer",
            "description": "How many URLs were read."
          },
          "ai_output_format": {
            "type": "string",
            "enum": [
              "markdown",
              "json"
            ],
            "description": "The scrape's `output`."
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How long the scrape took, in milliseconds."
          },
          "credits_used": {
            "type": "integer",
            "description": "Credits the scrape cost."
          },
          "use_proxy": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when Stealth Mode was on."
          },
          "proxy_country": {
            "type": [
              "string",
              "null"
            ],
            "description": "The country the scrape browsed from, when Stealth Mode was on."
          },
          "scrape_mode": {
            "type": "string",
            "enum": [
              "default",
              "fast"
            ],
            "description": "The scrape's `scrapeMode`."
          },
          "extract_content_only": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when `extractContentOnly` was on."
          },
          "schema_json": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `schema` sent, as a JSON string, if any."
          },
          "screenshot": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when a screenshot was asked for."
          },
          "full_page_screenshot": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when a full-page screenshot was asked for."
          },
          "page_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "The title of the page that was read."
          }
        }
      },
      "ScrapeLogDetail": {
        "description": "One past scrape with its result.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScrapeLogSummary"
          },
          {
            "type": "object",
            "properties": {
              "result_data": {
                "type": [
                  "string",
                  "object",
                  "array",
                  "null"
                ],
                "description": "The scrape's result, like `result.content` from [Get a scrape](/api-reference/scraping/scrape-status). Markdown as a string, or the extracted data with a `prompt` or `schema`."
              }
            }
          }
        ]
      },
      "UsageStatsEntry": {
        "type": "object",
        "description": "Usage for one day, or one week with `range=weekly`.",
        "properties": {
          "label": {
            "type": "string",
            "description": "A short label for a chart axis, such as `Oct 19`, or `Oct 13-19` for a week."
          },
          "date": {
            "type": "string",
            "description": "The day as `YYYY-MM-DD`, or for a week its first and last day, such as `Oct 13 – Oct 19`."
          },
          "tokens": {
            "type": "integer",
            "description": "AI tokens used across scrapes, crawls and parses."
          },
          "requests": {
            "type": "integer",
            "description": "Scrapes and parsed documents."
          },
          "crawls": {
            "type": "integer",
            "description": "Crawls that finished."
          },
          "captchas": {
            "type": "integer",
            "description": "CAPTCHAs solved."
          },
          "latency": {
            "type": "number",
            "description": "The average job time in milliseconds."
          },
          "credits": {
            "type": "integer",
            "description": "Credits used across every tool."
          }
        }
      },
      "SearchResultItem": {
        "type": "object",
        "required": [
          "title",
          "url",
          "position"
        ],
        "description": "One search result. Which optional fields appear depends on the source.",
        "properties": {
          "title": {
            "type": "string",
            "description": "The result's title. Developer results start with `PR:` or `Issue:`."
          },
          "url": {
            "type": "string",
            "description": "The result's link. For images, the page the image is on."
          },
          "description": {
            "type": "string",
            "description": "The snippet shown with the result. For research, the abstract. For developer results, the repository, its state and the start of the body."
          },
          "position": {
            "type": "integer",
            "description": "The result's rank within its source, starting at 1."
          },
          "imageUrl": {
            "type": "string",
            "description": "Images only. The full-size image."
          },
          "thumbnailUrl": {
            "type": "string",
            "description": "Images and videos. A small preview image."
          },
          "imageWidth": {
            "type": "integer",
            "description": "Images only, when known. The width in pixels."
          },
          "imageHeight": {
            "type": "integer",
            "description": "Images only, when known. The height in pixels."
          },
          "date": {
            "type": "string",
            "description": "News, videos, research and developer results. As the source gives it, so it can be relative (`3 years ago`) or a date and time. For research, the publication date."
          },
          "source": {
            "type": "string",
            "description": "News, research and developer results. The publisher for news, the journal or database for research, and `GitHub` for developer results."
          },
          "duration": {
            "type": "string",
            "description": "Videos only. The length, such as `24:59`."
          },
          "authors": {
            "type": "string",
            "description": "Research and developer results. The authors as one comma-separated string for research, and the username of whoever opened the issue or pull request for developer results."
          },
          "doi": {
            "type": "string",
            "description": "Research only, when the paper has one. Its DOI."
          },
          "markdown": {
            "type": "string",
            "description": "Web results only, with `scrapeOptions`. The page as Markdown. Missing when the page couldn't be read in time, when it's past `scrapeOptions.maxResults`, or when you were out of credits. That's not an error."
          },
          "structuredData": {
            "type": "object",
            "description": "Web results only, with `scrapeOptions`, when the result is on one of the [popular sites](/sites/overview). The page's data, such as a product's price or a video's views."
          }
        }
      },
      "SearchExtras": {
        "type": "object",
        "description": "Extra panels that sometimes come with web results. Only present when the search found them, so never rely on them being there.",
        "properties": {
          "relatedSearches": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Related queries people also search for."
          },
          "topStories": {
            "type": "array",
            "description": "News stories shown for the query.",
            "items": {
              "type": "object",
              "required": [
                "title",
                "url"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "description": "The story's headline."
                },
                "url": {
                  "type": "string",
                  "description": "The story's link."
                },
                "source": {
                  "type": "string",
                  "description": "The publisher."
                },
                "date": {
                  "type": "string",
                  "description": "When it was published",
                  "as shown.": null
                }
              }
            }
          },
          "answerBox": {
            "type": "object",
            "description": "A direct answer, such as a currency or unit conversion.",
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "currency",
                  "unit_conversion"
                ],
                "description": "What kind of answer it is."
              },
              "value": {
                "type": "string",
                "description": "The answer."
              }
            }
          },
          "knowledgeBox": {
            "type": "object",
            "description": "A short summary of a company, place or idea.",
            "required": [
              "title"
            ],
            "properties": {
              "title": {
                "type": "string",
                "description": "What the summary is about."
              },
              "category": {
                "type": "string",
                "description": "What kind of thing it is."
              },
              "description": {
                "type": "string",
                "description": "The summary."
              }
            }
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "description": "The finished result of a search.",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "`false` when no source returned any results. You aren't charged then."
          },
          "data": {
            "type": "object",
            "description": "One list per source you asked for, plus `nextPageTokens` and, sometimes, `extras`.",
            "properties": {
              "web": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResultItem"
                },
                "description": "Web results, when you asked for `web`."
              },
              "news": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResultItem"
                },
                "description": "News articles, when you asked for `news`."
              },
              "images": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResultItem"
                },
                "description": "Images, when you asked for `images`."
              },
              "videos": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResultItem"
                },
                "description": "Videos, when you asked for `videos`."
              },
              "research": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResultItem"
                },
                "description": "Academic papers and preprints, when you asked for `research`."
              },
              "developer": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResultItem"
                },
                "description": "GitHub issues and pull requests, when you asked for `developer`."
              },
              "extras": {
                "$ref": "#/components/schemas/SearchExtras"
              },
              "nextPageTokens": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "One token per source that has more results. Send it back as `pageTokens` to get that source's next page. Missing for a source with no more results."
              }
            }
          },
          "creditsUsed": {
            "type": "integer",
            "description": "What this search cost. 1 per 10 results per source, rounded up, plus 1 per page read with `scrapeOptions`.",
            "example": 2
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One sentence per option a source couldn't apply, which then ran without it. Missing when there are none.",
            "example": [
              "sort doesn't apply to web results, so they came back without it."
            ]
          },
          "stats": {
            "type": "object",
            "description": "How the search ran.",
            "properties": {
              "durationMs": {
                "type": "integer",
                "description": "How long the search took, in milliseconds."
              }
            }
          },
          "logUuid": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of this search in your [search logs](/api-reference/search/search-logs). When you fetch a next page with `pageTokens`, this stays the first page's ID."
          }
        }
      },
      "SearchLogSummary": {
        "type": "object",
        "description": "One past search. Logs use snake_case field names.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The log's ID. Not the same as the search's `jobId`. Use it with `GET /search-logs/{uuid}`."
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error",
              "in_progress",
              "cancelled"
            ],
            "description": "`success` (finished), `error` (failed, `error_message` says why), `in_progress` (still running) or `cancelled`."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the search started."
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it finished. `null` while it runs."
          },
          "query": {
            "type": "string",
            "description": "What was searched for."
          },
          "sources": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sources searched, as one comma-separated string such as `news,research,developer`."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `country` sent, if any."
          },
          "include_domains": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `includeDomains` sent, as one comma-separated string, if any."
          },
          "exclude_domains": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `excludeDomains` sent, as one comma-separated string, if any."
          },
          "scrape_content_enabled": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when the search was sent with `scrapeOptions`, `0` otherwise."
          },
          "scrape_max_results": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The `scrapeOptions.maxResults` sent, if any."
          },
          "result_limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The `limit` sent."
          },
          "page": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The `page` sent."
          },
          "time_range": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `timeRange` sent, if any."
          },
          "filetype": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `filetype` sent, if any."
          },
          "result_data": {
            "type": [
              "object",
              "null"
            ],
            "description": "The results, shaped like `result.data` from [Get a search](/api-reference/search/search-status). When you loaded further pages with `pageTokens`, their results are added here."
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the search failed. `null` otherwise."
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How long the search took, in milliseconds."
          },
          "credits_used": {
            "type": "integer",
            "description": "Credits the search cost, including any further pages."
          },
          "scraping_channel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "api",
              "playground",
              null
            ],
            "description": "`api` when sent with an API key, `playground` when run from the dashboard."
          }
        }
      },
      "SearchLogDetail": {
        "description": "One past search with every stored field.",
        "allOf": [
          {
            "$ref": "#/components/schemas/SearchLogSummary"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The log's row number."
              },
              "parent_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "For a further page loaded with `pageTokens`, the `uuid` of the first page's log. `null` for a first page."
              },
              "user_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "Your account's ID."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the log was created."
              }
            }
          }
        ]
      },
      "ActionResult": {
        "type": "object",
        "description": "How one browser action went.",
        "required": [
          "index",
          "type",
          "status",
          "durationMs"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "description": "The action's position, starting at 1."
          },
          "type": {
            "type": "string",
            "description": "The action type, as Spidra ran it (for example waitFor for waitForSelector)."
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "skipped",
              "failed"
            ],
            "description": "ok, skipped (an optional step that couldn't be done) or failed (the job failed at this step)."
          },
          "durationMs": {
            "type": "number",
            "description": "How long the step took."
          },
          "error": {
            "type": "string",
            "description": "Why the step was skipped or failed."
          },
          "result": {
            "description": "evaluate: the value the script returned. scrollUntilEnd: {scrolls, stoppedBecause}, where stoppedBecause is 'end' or 'maxScrolls'."
          },
          "screenshotUrl": {
            "type": "string",
            "format": "uri",
            "description": "screenshot: the link to the image."
          }
        }
      },
      "InvalidInputError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "INVALID_INPUT"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "description": "One entry per field that needs fixing."
          }
        }
      },
      "TemplateSite": {
        "type": "object",
        "description": "The site a template reads.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The site's ID. Use it as `site` to filter `GET /templates`.",
            "example": "google-maps"
          },
          "name": {
            "type": "string",
            "description": "The site's name.",
            "example": "Google Maps"
          },
          "domain": {
            "type": "string",
            "description": "The site's main domain.",
            "example": "google.com"
          }
        }
      },
      "TemplateSummary": {
        "type": "object",
        "description": "A template as it's listed.",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The template's ID. Use it in `/templates/{slug}` paths.",
            "example": "google-maps-leads"
          },
          "version": {
            "type": "integer",
            "description": "The template's version. It goes up when its inputs or rows change. Each run records the version it ran."
          },
          "title": {
            "type": "string",
            "description": "The template's name."
          },
          "summary": {
            "type": "string",
            "description": "One sentence on what the template returns."
          },
          "site": {
            "description": "The site the template reads, or `null` for templates that work on any site.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/TemplateSite"
              },
              {
                "type": "null"
              }
            ]
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "lead-generation",
                "reviews",
                "ecommerce",
                "jobs",
                "social-media",
                "real-estate",
                "ai-and-documents",
                "research",
                "travel"
              ]
            },
            "description": "The categories the template is listed under."
          },
          "tool": {
            "type": "string",
            "enum": [
              "batch",
              "search",
              "map",
              "crawl",
              "parse"
            ],
            "description": "The Spidra tool a run uses. A run costs what the same job costs with that tool."
          },
          "featured": {
            "type": "boolean",
            "description": "`true` for templates pinned to the top of the dashboard gallery."
          },
          "gallery": {
            "type": "boolean",
            "description": "`false` for templates that are listed on their site's page and in search but not in the main gallery."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "beta"
            ],
            "description": "`beta` for newer templates that may still change."
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The column labels the results table shows by default. Rows carry more fields than these."
          },
          "usesAi": {
            "type": "boolean",
            "description": "`true` for templates that extract data with AI, which adds AI credits for the tokens used."
          },
          "availability": {
            "description": "`null` when the template runs normally. Otherwise a notice from Spidra: with `state: \"notice\"` it still runs, with `state: \"off\"` runs are refused with `503`. Templates that are off aren't listed.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "notice",
                      "off"
                    ],
                    "description": "`notice`: runs work, with a message to show. `off`: paused, runs are refused."
                  },
                  "message": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The message to show, when there is one."
                  }
                }
              }
            ]
          }
        }
      },
      "TemplateInput": {
        "type": "object",
        "description": "One input of a template's form. Send its value in `inputs` under `key`.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The name to send the value under in `inputs`."
          },
          "label": {
            "type": "string",
            "description": "The input's label in the form. Error messages use it."
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "select",
              "list",
              "boolean",
              "date",
              "dateRange",
              "month",
              "week",
              "year",
              "country",
              "language",
              "airport"
            ],
            "description": "What to send.\n\n- `text`, `textarea`: a string.\n- `number`: a number between `min` and `max`.\n- `boolean`: `true` or `false`.\n- `select`, `country`, `language`: one of the `options` values.\n- `list`: an array of strings, up to `maxItems`.\n- `date`: a date such as `\"2026-11-03\"`.\n- `dateRange`: `{ \"from\": \"2026-11-01\", \"to\": \"2026-11-30\" }`.\n- `month`, `week`, `year`: such as `\"2026-11\"`, `\"2026-W42\"` and `\"2026\"`.\n- `airport`: an airport or city code such as `\"LOS\"`, or a city name. [Look up airports](/api-reference/templates/airports) finds codes.\n\n`country`, `airport` and `year` inputs with `multiple: true` take several values, as an array.\n"
          },
          "required": {
            "type": "boolean",
            "description": "`true` when the input must be sent."
          },
          "default": {
            "description": "The value used when you leave the input out."
          },
          "example": {
            "description": "An example value, shown in the form. It's never used when you leave the input out."
          },
          "help": {
            "type": "string",
            "description": "A note on what the input does and how it affects the cost."
          },
          "placeholder": {
            "type": "string",
            "description": "Placeholder text for the form."
          },
          "options": {
            "type": "array",
            "description": "For `select`, `country` and `language` inputs, the values you can send.",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string",
                  "description": "The value to send."
                },
                "label": {
                  "type": "string",
                  "description": "The value's name."
                }
              }
            }
          },
          "min": {
            "type": "number",
            "description": "For `number` inputs, the smallest value."
          },
          "max": {
            "type": "number",
            "description": "For `number` inputs, the largest value."
          },
          "maxItems": {
            "type": "integer",
            "description": "For `list` inputs, the most items one run takes."
          },
          "multiple": {
            "type": "boolean",
            "description": "`true` when the input takes several values."
          },
          "advanced": {
            "type": "boolean",
            "description": "`true` for inputs the form tucks under Advanced. They all have defaults."
          },
          "minDate": {
            "type": "string",
            "description": "For date inputs, the earliest date allowed, such as `today` or `today-30`."
          },
          "maxDate": {
            "type": "string",
            "description": "For date inputs, the latest date allowed, such as `today+365`."
          },
          "showIf": {
            "type": "object",
            "description": "Only when this input depends on another one. It applies only when the other input (`input`) has the value in `equals`, one of the values in `in`, or any value when neither is given. Otherwise it's ignored.",
            "properties": {
              "input": {
                "type": "string",
                "description": "The other input's `key`."
              },
              "equals": {
                "description": "The value it must have."
              },
              "in": {
                "type": "array",
                "items": {},
                "description": "The values it may have."
              }
            }
          }
        }
      },
      "TemplateRun": {
        "type": "object",
        "description": "A template run, with its rows once it has finished.",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid",
            "description": "The run's ID. Use it with `GET /template-runs/{runId}`."
          },
          "template": {
            "type": "string",
            "description": "The template's slug."
          },
          "templateVersion": {
            "type": "integer",
            "description": "The template version the run used."
          },
          "presetId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The preset the run was started from, or `null`."
          },
          "tool": {
            "type": "string",
            "enum": [
              "batch",
              "search",
              "map",
              "crawl",
              "parse"
            ],
            "description": "The Spidra tool behind the run."
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "completed",
              "partial",
              "failed",
              "cancelled"
            ],
            "description": "- `running`: still reading pages.\n- `completed`: finished. `rows` holds the results.\n- `partial`: some pages couldn't be read, or a second step failed. The pages that failed are in `failures` and aren't charged. `rows` holds the rest.\n- `failed`: nothing could be read. `error` says why, and you aren't charged.\n- `cancelled`: the job behind the run was cancelled.\n"
          },
          "inputs": {
            "type": "object",
            "description": "The inputs the run used, with defaults filled in."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the run started."
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run finished, or `null` while it runs."
          },
          "creditsUsed": {
            "type": [
              "number",
              "null"
            ],
            "description": "Credits the run cost. `null` until it has finished."
          },
          "urlCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many pages or searches the run started with."
          },
          "rowCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many rows the run returned."
          },
          "progress": {
            "type": "object",
            "description": "Pages done so far. With a second step, its pages are added once they're queued.",
            "properties": {
              "completed": {
                "type": "integer",
                "description": "Pages read."
              },
              "failed": {
                "type": "integer",
                "description": "Pages that couldn't be read."
              },
              "total": {
                "type": "integer",
                "description": "Pages known so far."
              }
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The results, one object per row, once the run has finished. Each row has every field the site returned, not only the template's default `columns`. Left out with `?rows=false`."
          },
          "failures": {
            "type": "array",
            "description": "Pages that couldn't be read. They aren't charged.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "The page."
                },
                "error": {
                  "type": "string",
                  "description": "Why it couldn't be read."
                },
                "code": {
                  "type": "string",
                  "enum": [
                    "not_found",
                    "no_results",
                    "login_required",
                    "blocked",
                    "timeout",
                    "empty_content",
                    "invalid_input",
                    "unsupported",
                    "out_of_credits",
                    "failed"
                  ],
                  "description": "Why the page failed, as a stable code to branch on:\n\n- `not_found`: the link points at nothing (no such page, company or place).\n- `no_results`: the search or list exists but has nothing matching.\n- `login_required`: only signed-in users can see it. Spidra reads public pages only.\n- `blocked`: the site refused or challenged every attempt.\n- `timeout`: the page took too long.\n- `empty_content`: the page loaded but held no usable data.\n- `invalid_input`: the input can't be used as given.\n- `unsupported`: this kind of page isn't read.\n- `out_of_credits`\n- `failed`: anything else.\n"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "description": "Only when the run failed, or ended `partial` because its second step failed. Why."
          },
          "followStep": {
            "type": "object",
            "description": "Only on templates with a second step switched on, such as **Find emails and social links**. The run stays `running` until this step has finished, and its fields are merged into each row.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "waiting",
                  "running",
                  "completed",
                  "failed"
                ],
                "description": "Where the second step is."
              },
              "sites": {
                "type": "integer",
                "description": "Websites the step checks."
              },
              "pagesLoaded": {
                "type": "integer",
                "description": "Pages it read."
              },
              "pagesFailed": {
                "type": "integer",
                "description": "Pages it couldn't read. These aren't charged."
              },
              "pagesWaiting": {
                "type": "integer",
                "description": "Pages still to read."
              },
              "creditsUsed": {
                "type": "integer",
                "description": "Credits the step cost."
              },
              "error": {
                "type": "string",
                "description": "Only when the step failed. Why."
              }
            }
          },
          "summary": {
            "type": "object",
            "description": "Only on rank trackers. How many keywords or points ranked, and the average position."
          },
          "job": {
            "type": "object",
            "description": "The tool job behind the run. For crawl and parse templates, the full result is at that tool's own endpoint, such as [Get a crawl](/api-reference/crawling/crawl-status).",
            "properties": {
              "tool": {
                "type": "string",
                "enum": [
                  "batch",
                  "search",
                  "map",
                  "crawl",
                  "parse"
                ],
                "description": "The tool."
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The tool job's ID, or `null` when there's none to read."
              }
            }
          },
          "resultsPath": {
            "type": "string",
            "description": "Only for crawl and parse templates. The dashboard page with the full result."
          }
        }
      },
      "Preset": {
        "type": "object",
        "description": "A saved job. A template preset holds a template and its inputs. A tool preset holds a request body for one of the tools.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The preset's ID. Use it in `/presets/{presetId}` paths and as a monitor source."
          },
          "name": {
            "type": "string",
            "description": "The preset's name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "A note about the preset, or `null`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "template",
              "tool"
            ],
            "description": "`template` for a saved template with its inputs, `tool` for a saved request to one tool."
          },
          "tool": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "scrape",
              "batch",
              "crawl",
              "map",
              "search",
              "parse",
              null
            ],
            "description": "The tool the preset runs. For a template preset, the tool behind the template."
          },
          "template": {
            "description": "For a template preset, the template it runs. `null` for a tool preset.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "description": "The template's slug."
                  },
                  "version": {
                    "type": "integer",
                    "description": "The template version the inputs were last checked against."
                  },
                  "title": {
                    "type": "string",
                    "description": "The template's name."
                  },
                  "site": {
                    "description": "The site the template reads, or `null`.",
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/TemplateSite"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "available": {
                    "type": "boolean",
                    "description": "`false` when the template has been retired. A preset whose template is retired can't run."
                  }
                }
              }
            ]
          },
          "inputs": {
            "type": [
              "object",
              "null"
            ],
            "description": "For a template preset, its inputs with defaults filled in. `null` for a tool preset."
          },
          "config": {
            "type": [
              "object",
              "null"
            ],
            "description": "For a tool preset, the request body it sends to the tool, without `cookies` or `wait`. `null` for a template preset unless it has saved `columns`."
          },
          "columns": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The path to the value in a row."
                },
                "label": {
                  "type": "string",
                  "description": "The column's name."
                },
                "format": {
                  "type": "string",
                  "description": "How the dashboard shows the value."
                }
              }
            },
            "description": "Only on template presets. The columns the dashboard table shows, or `null` for the template's own. Runs always return every field."
          },
          "inputsSummary": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a template preset, its main inputs in one line, such as `\"dentist · Lekki, Lagos · 1\"`, for lists. `null` for a tool preset."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the preset was saved."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the preset last changed."
          },
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The same as `id`. Kept, with the other snake_case fields (`urls`, `extraction_prompt`, `ai_output_format`, `use_proxy`, `proxy_country`, `scrape_mode`, `extract_content_only`, `schema_json`, `screenshot`, `full_page_screenshot`, `template_slug`, `template_version`, `created_at`, `updated_at`), for scrape presets saved before October 2026. Use the camelCase fields."
          }
        }
      },
      "MonitorSource": {
        "type": "object",
        "description": "One thing a monitor watches. Each source is run and compared on its own.",
        "required": [
          "kind"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The source's ID inside the monitor. Spidra makes one when you leave it out. Keep it when you edit sources, so the comparison carries on.",
            "example": "ae22524a61ad"
          },
          "kind": {
            "type": "string",
            "enum": [
              "template",
              "preset",
              "urls"
            ],
            "description": "- `template`: a template's rows, with `template` and `inputs`. Each row has a stable key, so new, changed and removed items are exact.\n- `preset`: one of your presets, with `presetId`. Scrape, batch, map, search and template presets work. Crawl and parse presets can't be watched yet.\n- `urls`: public pages, with `urls`.\n"
          },
          "label": {
            "type": "string",
            "maxLength": 120,
            "description": "A name for the source, shown in alerts. Defaults to the template's title, the preset's name or the site's domain."
          },
          "template": {
            "type": "string",
            "description": "With `kind: \"template\"`, the template's slug. Templates whose results open on another page, such as crawl and parse templates, can't be watched.",
            "example": "google-maps-leads"
          },
          "inputs": {
            "type": "object",
            "description": "With `kind: \"template\"`, the template's inputs by `key`. They're checked the same way a run checks them, and defaults are filled in."
          },
          "presetId": {
            "type": "string",
            "format": "uuid",
            "description": "With `kind: \"preset\"`, the preset's `id`."
          },
          "urls": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "With `kind: \"urls\"`, up to 50 public pages. Duplicates are dropped."
          },
          "site": {
            "description": "In responses, for template sources, the site the template reads.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/TemplateSite"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "MonitorSchedule": {
        "type": "object",
        "description": "How often the monitor checks. Send `every` (with `at` and `day` where they apply), or a `cron` expression. Defaults to every day at 09:00 UTC. Your plan sets the shortest interval; see [Get monitor limits](/api-reference/monitors/limits).",
        "properties": {
          "every": {
            "type": "string",
            "enum": [
              "5m",
              "15m",
              "30m",
              "1h",
              "6h",
              "12h",
              "1d",
              "1w"
            ],
            "description": "How often to check."
          },
          "at": {
            "type": "string",
            "description": "For `1d` and `1w`, the time of day in `timezone`, as `HH:MM`.",
            "example": "08:00"
          },
          "day": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6,
            "description": "For `1w`, the weekday, from 0 (Sunday) to 6 (Saturday)."
          },
          "cron": {
            "type": "string",
            "description": "Instead of `every`, a 5-field cron expression (minute, hour, day, month, weekday) in `timezone`.",
            "example": "0 8 * * 1"
          },
          "timezone": {
            "type": "string",
            "default": "UTC",
            "description": "The time zone for `at` and `cron`, such as `Africa/Lagos` or `Europe/Berlin`.",
            "example": "Africa/Lagos"
          }
        }
      },
      "MonitorNotify": {
        "type": "object",
        "description": "Where alerts go. Email to your account's address is on unless you turn it off. Add any of the other channels.",
        "properties": {
          "email": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": true,
                "description": "Emails alerts to your account's address. Set to `false` to turn email off."
              },
              "recipients": {
                "type": "array",
                "maxItems": 10,
                "items": {
                  "type": "string",
                  "format": "email"
                },
                "description": "Up to 10 extra addresses. Each gets a confirmation email and receives alerts only after confirming."
              }
            }
          },
          "webhook": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "An `https://` endpoint on the public internet. Spidra POSTs a JSON body with `event: \"monitor.check.completed\"` and the changes, signed in the `X-Spidra-Signature` header."
              },
              "secret": {
                "type": "string",
                "description": "The signing secret, 16 to 128 letters, digits, `_` or `-`. Leave it out and Spidra makes one, starting `whsec_`, and returns it here. The signature is `sha256=` followed by the HMAC-SHA256 of the raw body, in hex."
              }
            }
          },
          "slack": {
            "type": "object",
            "properties": {
              "webhookUrl": {
                "type": "string",
                "format": "uri",
                "description": "A Slack incoming webhook URL, starting `https://hooks.slack.com/`."
              }
            }
          },
          "discord": {
            "type": "object",
            "properties": {
              "webhookUrl": {
                "type": "string",
                "format": "uri",
                "description": "A Discord webhook URL, starting `https://discord.com/api/webhooks/`."
              }
            }
          }
        }
      },
      "MonitorRule": {
        "type": "object",
        "description": "A filter on the items that changed. Only items that pass it count, such as a price under 20 or a rating of 4 or more.",
        "required": [
          "field",
          "op",
          "value"
        ],
        "properties": {
          "field": {
            "type": "string",
            "maxLength": 100,
            "description": "The field to test, by name or dot path, such as `price` or `buyBox.price`."
          },
          "op": {
            "type": "string",
            "enum": [
              "lt",
              "lte",
              "gt",
              "gte",
              "eq",
              "neq",
              "contains",
              "drops_by_pct",
              "rises_by_pct"
            ],
            "description": "How to compare the field with `value`.\n\n- `lt`, `lte`, `gt`, `gte`: less than, at most, more than, at least.\n- `eq`, `neq`: equal or not equal. Numbers compare as numbers, text without case.\n- `contains`: the field's text contains `value`, ignoring case.\n- `drops_by_pct`, `rises_by_pct`: the field fell or rose by at least `value` percent since the last check.\n"
          },
          "value": {
            "type": [
              "number",
              "string"
            ],
            "description": "The value to compare with. Text up to 200 characters."
          }
        }
      },
      "MonitorInput": {
        "type": "object",
        "description": "The fields you send to create, estimate or update a monitor.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "A name for the monitor. Defaults to the first source's label."
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/MonitorSource"
            },
            "description": "What to watch, 1 to 10 sources."
          },
          "schedule": {
            "$ref": "#/components/schemas/MonitorSchedule"
          },
          "alertOn": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "new",
                  "changed",
                  "removed",
                  "page",
                  "every"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "new",
                    "changed",
                    "removed",
                    "page",
                    "every"
                  ]
                },
                "minItems": 1
              }
            ],
            "description": "What counts as a change worth an alert.\n\n- `new`: new items. The default when any source is a template or preset.\n- `changed`: items whose fields changed.\n- `removed`: items that are gone.\n- `page`: page text changes. The default when every source is a list of URLs.\n- `every`: alert on every check, with its rows, whether or not anything changed.\n\nSend one value, or a list such as `[\"new\", \"removed\"]` to alert on any of them with one check. `every` can't be combined with others.",
            "example": [
              "new",
              "removed"
            ]
          },
          "watchFields": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "description": "Only compare these fields when looking for changed items, such as `[\"price\", \"rating\"]`. Empty compares every field that's stable from check to check."
          },
          "rule": {
            "description": "An optional filter on the items that changed. Send `null` to remove it.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/MonitorRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "goal": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000,
            "description": "An optional goal in plain English, such as `\"Only tell me if the price drops below $20\"`. When something changed, AI reads the changes and the monitor alerts only if they match the goal. Not used with `alertOn: \"every\"`. Send `null` to remove it."
          },
          "notify": {
            "$ref": "#/components/schemas/MonitorNotify"
          }
        }
      },
      "Monitor": {
        "type": "object",
        "description": "A monitor, with its settings and its last result.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The monitor's ID."
          },
          "name": {
            "type": "string",
            "description": "The monitor's name."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ],
            "description": "`active` while checks run on schedule, `paused` when they don't."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitorSource"
            },
            "description": "What the monitor watches, with IDs and labels filled in."
          },
          "schedule": {
            "$ref": "#/components/schemas/MonitorSchedule"
          },
          "cron": {
            "type": "string",
            "description": "The schedule as a cron expression in `schedule.timezone`."
          },
          "alertOn": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "new",
                  "changed",
                  "removed",
                  "page",
                  "every"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "new",
                    "changed",
                    "removed",
                    "page",
                    "every"
                  ]
                }
              }
            ],
            "description": "What counts as a change worth an alert: one value, or a list when the monitor was set up with several."
          },
          "watchFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The fields compared for changed items. Empty means every stable field."
          },
          "rule": {
            "description": "The filter on changed items, or `null`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/MonitorRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "goal": {
            "type": [
              "string",
              "null"
            ],
            "description": "The plain-English goal, or `null`."
          },
          "notify": {
            "$ref": "#/components/schemas/MonitorNotify"
          },
          "nextRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next scheduled check runs, in UTC. `null` while paused."
          },
          "lastCheckAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the last check finished, or `null`."
          },
          "lastChangeAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a check last found a change, or `null`."
          },
          "lastStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "completed",
              "partial",
              "failed",
              null
            ],
            "description": "How the last check went, or `null` before the first one."
          },
          "lastSummary": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last check in a few words, such as `\"1 page changed\"`, `\"2 new · 1 changed\"` or `\"No changes\"`."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the monitor was created."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the monitor last changed."
          }
        }
      },
      "MonitorCheck": {
        "type": "object",
        "description": "One check of a monitor.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The check's ID."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "schedule",
              "manual"
            ],
            "description": "`schedule` for a scheduled check, `manual` for the first check after creating the monitor and for [Check now](/api-reference/monitors/check-now)."
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "completed",
              "partial",
              "failed",
              "skipped"
            ],
            "description": "- `running`: in progress.\n- `completed`: every source was read.\n- `partial`: some sources failed. The others were compared as usual.\n- `failed`: no source could be read. `error` says why.\n- `skipped`: out of credits, over your plan's monitor limit, or the previous check was still running. Nothing was charged.\n"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the check started."
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it finished, or `null` while running."
          },
          "creditsUsed": {
            "type": [
              "number",
              "null"
            ],
            "description": "Credits the check cost, or `null` when unknown."
          },
          "hasChanges": {
            "type": "boolean",
            "description": "`true` when the check found a change the monitor alerts on."
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "The check in a few words, such as `\"1 page changed\"` or `\"Started watching (1 items)\"`."
          },
          "notified": {
            "type": "boolean",
            "description": "`true` when an alert went out to at least one channel."
          },
          "judgment": {
            "description": "Only when the monitor has a `goal` and something changed. Whether the changes match the goal. When `meaningful` is `false`, no alert went out.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "meaningful": {
                    "type": "boolean",
                    "description": "Whether the changes match the goal."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why",
                    "in a sentence.": null
                  }
                }
              }
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why sources failed, one line per source, or `null`."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitorSourceChanges"
            },
            "description": "Only on `GET /monitors/{monitorId}/checks/{checkId}`. What each source produced."
          }
        }
      },
      "MonitorSourceChanges": {
        "type": "object",
        "description": "What one source produced in a check.",
        "properties": {
          "sourceId": {
            "type": "string",
            "description": "The source's `id`."
          },
          "label": {
            "type": "string",
            "description": "The source's label."
          },
          "baseline": {
            "type": "boolean",
            "description": "`true` on a source's first check, which only records the starting point and never alerts."
          },
          "added": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "New items (rows whose key wasn't there last time), each with all its fields. Up to 200."
          },
          "removed": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Items that are gone. Up to 200."
          },
          "changed": {
            "type": "array",
            "description": "Items whose fields changed. Up to 200.",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The item's key."
                },
                "item": {
                  "type": "object",
                  "description": "The item as it is now."
                },
                "fields": {
                  "type": "array",
                  "description": "Each field that changed.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "description": "The field's name."
                      },
                      "previous": {
                        "description": "Its value at the last check."
                      },
                      "current": {
                        "description": "Its value now."
                      }
                    }
                  }
                }
              }
            }
          },
          "pages": {
            "type": "array",
            "description": "Page text changes. The lines added to and removed from each page's text, up to 40 of each.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "The page."
                },
                "added": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Lines that are new."
                },
                "removed": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Lines that are gone."
                }
              }
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Only with `alertOn: \"every\"`. The rows of this check, up to 200."
          },
          "rowCount": {
            "type": "integer",
            "description": "How many items or pages the source returned."
          },
          "error": {
            "type": "string",
            "description": "Only when the source couldn't be read this time. Why."
          }
        }
      },
      "BatchStatus": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "completed",
          "cancelled"
        ],
        "description": "- `pending`: queued, no URL has started yet.\n- `running`: at least one URL is being scraped.\n- `completed`: every URL has finished. Some may have failed, so check `failedCount` and each item's `status`.\n- `cancelled`: you cancelled the batch. Items that had finished keep their results.\n"
      },
      "BatchItem": {
        "type": "object",
        "description": "One URL in a batch and its result.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The item's ID."
          },
          "url": {
            "type": "string",
            "description": "The URL, after tracking parameters such as `utm_source` were removed."
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The ID of the scrape job that ran this URL. `null` until it starts. A retried item gets a new one."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "`pending` (waiting), `running`, `completed`, `failed` (`error` says why), or `cancelled` (the batch was cancelled before this URL started)."
          },
          "result": {
            "type": [
              "string",
              "object",
              "array",
              "null"
            ],
            "description": "The item's result, or `null` until it finishes or when it failed.\n\n- No `prompt` or `schema`: the page as Markdown, starting with a `Content from: <url>` line.\n- With a `prompt` or `schema`: the data the AI extracted. If the AI step fails, this holds the page Markdown as a string instead.\n- `output: \"json\"` with no prompt on a [popular site](/sites/overview): the page's data, the same as `structuredData`.\n"
          },
          "structuredData": {
            "type": "object",
            "description": "Only on [popular sites](/sites/overview). The page's data, such as a product's price and seller or a video's views."
          },
          "canonicalUrl": {
            "type": "string",
            "description": "Only when the link that was read differs from the one you sent, for example after a short link was followed."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only when something on this page needs your attention, such as a step that was skipped."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the item failed, in plain words. `null` otherwise."
          },
          "creditsUsed": {
            "type": "integer",
            "description": "Credits this URL cost. `0` for a failed item."
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the URL started."
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the URL finished."
          },
          "screenshotUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "A link to the page's screenshot when you asked for one. `null` otherwise."
          },
          "readFrom": {
            "type": "object",
            "description": "Where the page was read from. Sites change their language, prices and cookie walls by country.",
            "properties": {
              "country": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "A two-letter country code such as `US` or `DE` (or `EU`, `ASIA`), or `null` when Stealth Mode had no country picked."
              },
              "via": {
                "type": "string",
                "enum": [
                  "stealth",
                  "proxy",
                  "server"
                ],
                "description": "- `stealth`: Stealth Mode, in the country picked.\n- `proxy`: the free proxy in the country the request came from.\n- `server`: Spidra's own servers, in the US. Also used when a proxy failed and the page was read again without it (the page's `warnings` says so)."
              }
            },
            "example": {
              "country": "DE",
              "via": "stealth"
            }
          },
          "lowContent": {
            "type": "boolean",
            "description": "On a completed URL: `true` when the page came back nearly empty, usually a cookie wall, a bot check or a dead redirect. Retrying, or Stealth Mode, may help."
          },
          "errorCode": {
            "type": "string",
            "enum": [
              "not_found",
              "no_results",
              "login_required",
              "blocked",
              "timeout",
              "empty_content",
              "invalid_input",
              "unsupported",
              "out_of_credits",
              "failed"
            ],
            "description": "On a failed URL. Why the page failed, as a stable code to branch on:\n\n- `not_found`: the link points at nothing (no such page, company or place).\n- `no_results`: the search or list exists but has nothing matching.\n- `login_required`: only signed-in users can see it. Spidra reads public pages only.\n- `blocked`: the site refused or challenged every attempt.\n- `timeout`: the page took too long.\n- `empty_content`: the page loaded but held no usable data.\n- `invalid_input`: the input can't be used as given.\n- `unsupported`: this kind of page isn't read.\n- `out_of_credits`\n- `failed`: anything else.\n"
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "BatchJob": {
        "type": "object",
        "description": "A batch with every item.",
        "properties": {
          "batchId": {
            "type": "string",
            "format": "uuid",
            "description": "The batch's ID."
          },
          "status": {
            "$ref": "#/components/schemas/BatchStatus"
          },
          "totalUrls": {
            "type": "integer",
            "description": "How many URLs the batch has."
          },
          "completedCount": {
            "type": "integer",
            "description": "How many URLs finished successfully."
          },
          "failedCount": {
            "type": "integer",
            "description": "How many URLs failed."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BatchItem"
            },
            "description": "One entry per URL, in the order you sent them."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the batch was created."
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the batch finished or was cancelled. `null` while it runs."
          }
        }
      },
      "CrawlStatus": {
        "type": "string",
        "enum": [
          "waiting",
          "delayed",
          "active",
          "completed",
          "failed",
          "cancelled"
        ],
        "description": "- `waiting`: queued, not started yet.\n- `delayed`: waiting to be retried after a temporary problem.\n- `active`: running. `progress.message` says what it's doing.\n- `completed`: finished. The pages are in `result`.\n- `failed`: no page could be returned. `error` says why, and you aren't charged.\n- `cancelled`: you cancelled it before any page was returned.\n"
      },
      "CrawlErrorResponse": {
        "description": "Most crawl endpoints add an `error` field that repeats `message`, kept for older clients. Read `message`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorResponse"
          },
          {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "The same text as `message`."
              }
            }
          }
        ]
      },
      "CrawlPage": {
        "type": "object",
        "description": "One page a crawl returned.",
        "properties": {
          "url": {
            "type": "string",
            "description": "The page's URL."
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "failed"
            ],
            "description": "Whether the page was read."
          },
          "title": {
            "type": "string",
            "description": "The page title."
          },
          "data": {
            "type": [
              "object",
              "array",
              "string"
            ],
            "description": "With `schema` or `transformInstruction`, the data the AI extracted from this page. With neither, the page as Markdown."
          },
          "html": {
            "type": "string",
            "format": "uri",
            "description": "A link to the page's stored HTML. Expires after 1 hour, so fetch it again from this endpoint or `GET /crawl/{jobId}/pages` for a fresh one."
          },
          "markdown": {
            "type": "string",
            "format": "uri",
            "description": "A link to the page's stored Markdown. Expires after 1 hour."
          },
          "error": {
            "type": "string",
            "description": "Only on a failed page. Why it couldn't be read."
          },
          "depth": {
            "type": "integer",
            "description": "How many clicks from the start page it was found. Missing for pages found in the sitemap."
          },
          "parentUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The page it was found on. Missing for pages found in the sitemap."
          }
        }
      },
      "CrawlJobRecord": {
        "type": "object",
        "description": "A crawl's stored settings and totals. Uses snake_case field names, and flags such as `allow_subdomains` are `0` or `1`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The crawl's `jobId`."
          },
          "base_url": {
            "type": "string",
            "description": "The `baseUrl` sent."
          },
          "crawl_instruction": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `crawlInstruction` sent. `null` for an extraction."
          },
          "transform_instruction": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `transformInstruction` sent, if any."
          },
          "output_schema": {
            "type": [
              "object",
              "null"
            ],
            "description": "The `schema` sent, if any."
          },
          "max_pages": {
            "type": "integer",
            "description": "The most pages the crawl could return. Lower than what you asked for when your credits covered fewer."
          },
          "max_depth": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The `maxDepth` sent, if any."
          },
          "include_paths": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The `includePaths` sent, if any."
          },
          "exclude_paths": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The `excludePaths` sent, if any."
          },
          "allow_subdomains": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when `allowSubdomains` was on."
          },
          "crawl_entire_domain": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when `crawlEntireDomain` was on."
          },
          "ignore_query_params": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "`1` when `ignoreQueryParams` was on."
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `webhookUrl` sent, if any."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "Where the crawl is."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the crawl was started."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed."
          },
          "input_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tokens the AI read across all pages."
          },
          "output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tokens the AI wrote."
          },
          "credits_used": {
            "type": [
              "string",
              "null"
            ],
            "description": "Credits the crawl cost, as a decimal string such as `\"5.00\"`. Includes later [page retries](/api-reference/crawling/crawl-retry-page)."
          }
        }
      },
      "MapLogSummary": {
        "type": "object",
        "description": "One past map. Logs use snake_case field names.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The log's ID. Use it with `GET /map-logs/{uuid}`."
          },
          "user_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Your account's ID."
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "empty",
              "error"
            ],
            "description": "`success`, `empty` (no URLs found, not charged) or `error` (failed, not charged, `message` says why)."
          },
          "url": {
            "type": "string",
            "description": "The site that was mapped."
          },
          "search": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `search` sent, if any."
          },
          "sitemap_mode": {
            "type": "string",
            "enum": [
              "include",
              "skip",
              "only"
            ],
            "description": "The `sitemap` setting used."
          },
          "url_limit": {
            "type": "integer",
            "description": "The `limit` used."
          },
          "include_subdomains": {
            "type": "boolean",
            "description": "Whether `includeSubdomains` was on."
          },
          "respect_robots": {
            "type": "boolean",
            "description": "Whether `respectRobots` was on."
          },
          "total": {
            "type": "integer",
            "description": "URLs that matched the search, or every URL found without one."
          },
          "scanned": {
            "type": "integer",
            "description": "Every URL found before the search filter."
          },
          "sitemap_count": {
            "type": "integer",
            "description": "URLs found in the site's sitemaps."
          },
          "pages_count": {
            "type": "integer",
            "description": "URLs found in the links on its pages."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why nothing was found, or why the map failed. `null` on success."
          },
          "latency_ms": {
            "type": "integer",
            "description": "How long the map took, in milliseconds."
          },
          "credits_used": {
            "type": "integer",
            "description": "`1`, or `0` when nothing was found or the map failed."
          },
          "scraping_channel": {
            "type": "string",
            "enum": [
              "api",
              "playground"
            ],
            "description": "`api` when sent with an API key, `playground` when run from the dashboard."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the map ran."
          }
        }
      },
      "ParseOptions": {
        "type": "object",
        "description": "How to parse a document. The same options apply to `POST /parse` and to every document in `POST /parse/batch`.",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "fast",
              "ocr"
            ],
            "default": "auto",
            "description": "How pages are read.\n\n- `auto`: reads each page's text, and uses AI only on pages that are scans or images.\n- `fast`: reads text only. Scanned pages come back empty with an `error` and aren't charged.\n- `ocr`: reads every page with AI. Slower, and best for scans and handwriting.\n"
          },
          "pages": {
            "type": "string",
            "maxLength": 500,
            "description": "PDF pages to parse, as pages and ranges separated by commas. `\"10-\"` means page 10 to the end. Pages past the end are skipped. Other formats ignore this and are parsed whole, with a warning.",
            "example": "1-5,9"
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "description": "Parse at most this many pages, counted from the start of `pages` (or of the document). PDFs only.",
            "example": 3
          },
          "includePages": {
            "type": "boolean",
            "default": false,
            "description": "Adds `pages` to the result, with each page's Markdown on its own. `perPage` is accepted as another name for this field. Only applies when the result comes back inline; when polling, use `?pages=true` instead."
          },
          "pageMarkers": {
            "type": "boolean",
            "default": false,
            "description": "Puts a `<!-- page N -->` line before each page in `markdown`."
          },
          "prompt": {
            "type": "string",
            "maxLength": 5000,
            "description": "What to extract from the document, in plain English, such as `\"The paper's title and the authors' names\"`. The answer is in `json`. Costs AI credits on top of the page credits."
          },
          "schema": {
            "type": "object",
            "description": "A JSON Schema for the extracted data. The answer is in `json` and follows this shape. Can be sent with or without a `prompt`. In a multipart request, send it as a JSON string."
          },
          "dryRun": {
            "type": "boolean",
            "default": false,
            "description": "Returns the page count and the credits the parse would cost, without parsing or charging anything. The document is still stored, so you can parse it next with the returned `fileId`."
          },
          "wait": {
            "type": "boolean",
            "default": true,
            "description": "Waits up to 20 seconds for the result and returns it inline. Set to `false` to get a job to poll straight away. `POST /parse` only; a batch never waits."
          }
        }
      },
      "ParsePage": {
        "type": "object",
        "description": "One page of a parsed document.",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page number, starting at 1. A non-PDF document comes back as a single page 1."
          },
          "markdown": {
            "type": "string",
            "description": "The page as Markdown. Empty when the page couldn't be read."
          },
          "method": {
            "type": "string",
            "enum": [
              "text",
              "ocr"
            ],
            "description": "`text` when the page's text was read directly, `ocr` when it was read with AI."
          },
          "error": {
            "type": "string",
            "description": "Only when the page couldn't be read, such as `\"This page is a scan or image. Use auto or OCR mode to read it.\"` Pages with an error aren't charged."
          }
        }
      },
      "ParseJob": {
        "type": "object",
        "description": "A parse job, with its result once it has finished.",
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid",
            "description": "The job's ID. Use it with `GET /parse/{jobId}`."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed"
            ],
            "description": "- `queued`: waiting to start.\n- `running`: being parsed. `progress` says how far it has got.\n- `completed`: finished. The result is in `markdown`, and `json` when you asked for extraction.\n- `failed`: couldn't be parsed. `error` says why, and you aren't charged.\n"
          },
          "fileName": {
            "type": "string",
            "description": "The document's file name, or the last part of the link it came from."
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The link the document was downloaded from, after redirects. `null` for uploads."
          },
          "fileId": {
            "type": "string",
            "format": "uuid",
            "description": "The stored document's ID. Send it as `fileId` to parse the same document again for 24 hours without uploading or downloading it again."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "The document's format, such as `PDF`, `Word`, `Excel` or `PowerPoint`."
          },
          "totalPages": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many pages the document has. For formats without pages, an estimate of one page per 3,000 characters of text."
          },
          "pagesParsed": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many pages were read and charged. `null` until the job finishes."
          },
          "creditsUsed": {
            "type": "integer",
            "description": "Credits charged for this job, including AI credits for extraction. `0` until the job has completed, and for a failed job."
          },
          "error": {
            "type": "string",
            "description": "Only when `status` is `failed`. Why the document couldn't be parsed, such as `\"This PDF is password protected. Remove the password and try again.\"`"
          },
          "progress": {
            "type": "object",
            "description": "Only while the job is `queued` or `running`, once it has started reading pages.",
            "properties": {
              "message": {
                "type": "string",
                "description": "What the job is doing, such as `\"Reading page 3 of 12\"`."
              },
              "done": {
                "type": "integer",
                "description": "Pages read so far."
              },
              "total": {
                "type": "integer",
                "description": "Pages to read in all."
              }
            }
          },
          "markdown": {
            "type": "string",
            "description": "Once completed. The whole document as Markdown, pages joined by blank lines."
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsePage"
            },
            "description": "Only when you asked for it (`includePages`, or `?pages=true` when polling). Each page on its own."
          },
          "json": {
            "description": "Only when you sent a `prompt` or `schema`. The extracted data."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Once completed. Anything worth knowing about the result, such as `\"2 of 15 pages couldn't be read and aren't charged.\"` or that page selection was ignored for a non-PDF document. Empty when there's nothing to report."
          },
          "metadata": {
            "type": "object",
            "description": "Once completed. Facts about the parsed document.",
            "properties": {
              "fileName": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The document's file name."
              },
              "sourceUrl": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The link it was downloaded from, or `null` for uploads."
              },
              "format": {
                "type": "string",
                "description": "The format as a lowercase extension, such as `pdf` or `docx`."
              },
              "totalPages": {
                "type": "integer",
                "description": "How many pages the document has."
              },
              "pagesParsed": {
                "type": "integer",
                "description": "How many pages were read and charged."
              },
              "ocrPages": {
                "type": "integer",
                "description": "How many of those pages were read with AI."
              }
            }
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Once completed. How long parsing took, in milliseconds."
          }
        }
      },
      "ParseEstimate": {
        "type": "object",
        "description": "What a parse would cost, returned with `dryRun: true`. Nothing is parsed or charged.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "estimate"
            ]
          },
          "fileId": {
            "type": "string",
            "format": "uuid",
            "description": "The stored document's ID. Send it as `fileId` to parse the document without fetching it again."
          },
          "fileName": {
            "type": "string",
            "description": "The document's file name."
          },
          "format": {
            "type": "string",
            "description": "The document's format, such as `PDF` or `Word`."
          },
          "totalPages": {
            "type": "integer",
            "description": "How many pages the document has."
          },
          "pagesToParse": {
            "type": "integer",
            "description": "How many pages would be parsed, after `pages` and `maxPages`."
          },
          "credits": {
            "type": "integer",
            "description": "Page credits the parse would cost."
          },
          "creditsNote": {
            "type": "string",
            "description": "Only when you sent a `prompt` or `schema`. Says that AI credits for the extraction come on top."
          }
        }
      },
      "PageMetadata": {
        "type": "object",
        "description": "What the page says about itself outside its text. Each field is left out when the page doesn't declare it.",
        "properties": {
          "language": {
            "type": "string",
            "description": "The page's language as it declares it (`<html lang>`, then Content-Language, then `og:locale`), such as `en`, `en-us` or `sv-se`."
          },
          "description": {
            "type": "string",
            "description": "The page's description (meta description or og:description)."
          },
          "canonicalUrl": {
            "type": "string",
            "description": "The page's canonical link."
          },
          "image": {
            "type": "string",
            "description": "The page's preview image (og:image)."
          },
          "profiles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The profiles the site declares as its own in its structured data (schema.org `sameAs`): LinkedIn, X, GitHub, YouTube and so on. Many sites link them only there, not on the page. People's profiles (an article's author) aren't included."
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the page's structured data says it is, such as `Organization`, `Product`, `JobPosting` or `Article`."
          }
        },
        "example": {
          "language": "en-us",
          "description": "Financial infrastructure to grow your revenue.",
          "canonicalUrl": "https://stripe.com/",
          "profiles": [
            "https://www.linkedin.com/company/stripe/",
            "https://twitter.com/stripe"
          ],
          "types": [
            "WebSite",
            "Organization"
          ]
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "The API key is missing, wrong, or turned off.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "missing": {
                "summary": "No key sent",
                "value": {
                  "status": "error",
                  "message": "Missing authentication"
                }
              },
              "invalid": {
                "summary": "Wrong or turned-off key",
                "value": {
                  "status": "error",
                  "message": "Invalid token or API key"
                }
              }
            }
          }
        }
      },
      "CreditLimit": {
        "description": "Your account doesn't have enough credits left to start this job. Top up or upgrade, then send the request again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "status": "error",
              "message": "You have exceeded your monthly credit limit."
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/scrape": {
      "post": {
        "summary": "Start a scrape",
        "description": "Starts a job that reads 1 to 3 URLs and returns its `jobId` straight away. Poll [Get a scrape](/api-reference/scraping/scrape-status) until `status` is `completed` or `failed`.\n\nAll the URLs in one request go into one result. Without a `prompt` you get each page as Markdown, and with a `prompt` or `schema` you get one answer drawn from all of them. To get a separate result for each URL, or to scrape more than 3, use [Batch scrape](/api-reference/scraping/batch-scrape).\n\nIf you send the same URLs again within 5 seconds, you get the first job's `jobId` back with `deduplicated: true` instead of a second job.\n\n**Credits:** 1 per URL, plus AI credits for the tokens used when you send a `prompt` or `schema` (often 1 or 2 for a page), plus 5 per CAPTCHA solved. A URL that can't be read costs nothing. See [How credits work](/billing/how-credits-work).\n\n**Rate limits:** 60 requests a minute, and up to 10 unfinished scrapes at a time. Batch URLs count toward the 10.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "urls"
                ],
                "properties": {
                  "urls": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "items": {
                      "$ref": "#/components/schemas/ScrapeUrl"
                    },
                    "description": "1 to 3 pages to scrape, each as an object such as `{ \"url\": \"https://example.com\" }`. Plain strings aren't accepted here."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "What you want from the pages, in plain English, such as `\"Return the title and price of every book\"`. Without a `schema`, the AI picks the shape of the answer."
                  },
                  "schema": {
                    "type": "object",
                    "description": "A [JSON Schema](/options/structured-output) for the answer. You get exactly these fields and types, with `null` for anything the page doesn't show. The root must be `\"type\": \"object\"`, at most 5 levels deep and 10 KB. Sending a schema sets `output` to `\"json\"`."
                  },
                  "output": {
                    "type": "string",
                    "enum": [
                      "markdown",
                      "json"
                    ],
                    "default": "markdown",
                    "description": "`markdown` returns the page as Markdown, or the AI's answer as text when you send a `prompt`. `json` returns structured data: on [popular sites](/sites/overview) with no prompt, the page's data; elsewhere, data the AI extracts. Lowercase only."
                  },
                  "scrapeMode": {
                    "type": "string",
                    "enum": [
                      "default",
                      "fast"
                    ],
                    "default": "default",
                    "description": "`default` opens every page in a real browser. `fast` fetches the page directly and opens a browser only when the page needs one, which is quicker for static pages. `fast` doesn't run `actions` or take screenshots. `crawlerMode` is accepted as an older name for this field."
                  },
                  "useProxy": {
                    "type": "boolean",
                    "default": false,
                    "description": "Turns on [Stealth Mode](/options/proxies-and-captchas), which sends the request through residential proxies. Billed by bandwidth, not credits. Not needed when you set `proxyCountry`. `false` keeps the proxy off, even with a country. When Stealth Mode can't be used because your proxy bandwidth ran out, the request runs without it and `warnings` says so."
                  },
                  "proxyCountry": {
                    "type": "string",
                    "description": "The country to read pages from, as a two-letter code such as `us`, `gb` or `de`, or `eu` or `asia`. Setting a country turns [Stealth Mode](/options/proxies-and-captchas) on (billed by bandwidth), and the response's `warnings` says so, unless `useProxy` is `false`: then the country isn't used, and `warnings` says that instead. `global` means any country.",
                    "example": "gb"
                  },
                  "cookies": {
                    "type": "string",
                    "description": "Cookies from your own signed-in browser session, to read pages that need an account. Either `name=value; name2=value2` or rows pasted from your browser's DevTools. Never stored. See [Logged-in pages](/options/logged-in-pages)."
                  },
                  "screenshot": {
                    "type": "boolean",
                    "default": false,
                    "description": "Takes a screenshot of the visible part of each page."
                  },
                  "fullPageScreenshot": {
                    "type": "boolean",
                    "default": false,
                    "description": "Takes a screenshot of the whole page, top to bottom. You don't need to set `screenshot` as well."
                  },
                  "extractContentOnly": {
                    "type": "boolean",
                    "default": false,
                    "description": "Removes headers, footers, menus and other page furniture from the Markdown, leaving the main content."
                  }
                }
              },
              "examples": {
                "markdown": {
                  "summary": "Page as Markdown",
                  "value": {
                    "urls": [
                      {
                        "url": "https://books.toscrape.com"
                      }
                    ]
                  }
                },
                "prompt": {
                  "summary": "Extract with a prompt",
                  "value": {
                    "urls": [
                      {
                        "url": "https://books.toscrape.com"
                      }
                    ],
                    "prompt": "Return the title and price of every book on the page",
                    "output": "json"
                  }
                },
                "schema": {
                  "summary": "Extract with a JSON Schema",
                  "value": {
                    "urls": [
                      {
                        "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
                      }
                    ],
                    "prompt": "Extract the book details",
                    "schema": {
                      "type": "object",
                      "required": [
                        "title",
                        "price"
                      ],
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "price": {
                          "type": "number"
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "in_stock": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "rating": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                },
                "actions": {
                  "summary": "Log in with browser actions, then extract",
                  "value": {
                    "urls": [
                      {
                        "url": "https://quotes.toscrape.com/login",
                        "actions": [
                          {
                            "type": "type",
                            "selector": "#username",
                            "value": "demo"
                          },
                          {
                            "type": "type",
                            "selector": "#password",
                            "value": "demo"
                          },
                          {
                            "type": "click",
                            "selector": "input[type='submit']"
                          },
                          {
                            "type": "waitFor",
                            "selector": "a[href='/logout']"
                          }
                        ]
                      }
                    ],
                    "prompt": "List the first 3 quotes with their authors",
                    "output": "json"
                  }
                },
                "popular_site": {
                  "summary": "Product data from Amazon",
                  "value": {
                    "urls": [
                      {
                        "url": "https://www.amazon.com/dp/B0CG1LGWR6"
                      }
                    ],
                    "output": "json"
                  }
                },
                "stealth": {
                  "summary": "Stealth Mode from the UK",
                  "value": {
                    "urls": [
                      {
                        "url": "https://books.toscrape.com"
                      }
                    ],
                    "useProxy": true,
                    "proxyCountry": "gb"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job was queued. Poll `GET /scrape/{jobId}` for the result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The job's ID. Use it with `GET /scrape/{jobId}`."
                    },
                    "message": {
                      "type": "string",
                      "description": "Where to poll for the result."
                    },
                    "deduplicated": {
                      "type": "boolean",
                      "description": "`true` when the same URLs were sent in the last 5 seconds and this is that job's ID."
                    },
                    "schema_warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Only when your `schema` uses keywords that are ignored, such as `anyOf`. The job still runs."
                    }
                  }
                },
                "examples": {
                  "queued": {
                    "summary": "Queued",
                    "value": {
                      "status": "queued",
                      "jobId": "1027909f-f231-495b-9f9f-c5e0043c51b1",
                      "message": "Scrape job has been queued. Poll /api/scrape/1027909f-f231-495b-9f9f-c5e0043c51b1 to get the result."
                    }
                  },
                  "schema_warning": {
                    "summary": "Queued, with a schema keyword ignored",
                    "value": {
                      "status": "queued",
                      "jobId": "536b5dd6-84e7-4287-b514-5c7250750695",
                      "message": "Scrape job has been queued. Poll /api/scrape/536b5dd6-84e7-4287-b514-5c7250750695 to get the result.",
                      "schema_warnings": [
                        "\"anyOf\" at schema.properties.isbn is not supported and will be ignored"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue scraping.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/CreditLimit"
          },
          "422": {
            "description": "The request isn't valid. `errors` lists every problem, naming the URL and action where it applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_urls": {
                    "summary": "More than 3 URLs",
                    "value": {
                      "status": "error",
                      "message": "Maximum 3 URLs per request. You provided 4.",
                      "errors": [
                        "Maximum 3 URLs per request. You provided 4."
                      ]
                    }
                  },
                  "bad_output": {
                    "summary": "Unknown output value",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "\"output\" must be \"markdown\" or \"json\". You sent \"html\"."
                      ]
                    }
                  },
                  "private_url": {
                    "summary": "A private address",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "\"http://localhost:8080\" points to a private or internal address, which is not allowed."
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Either more than 60 scrapes in a minute, or 10 scrapes already unfinished. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rate_limit": {
                    "summary": "More than 60 a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many job submissions. Please slow down and try again shortly."
                    }
                  },
                  "pending": {
                    "summary": "10 scrapes still running",
                    "value": {
                      "status": "error",
                      "message": "You have too many pending scrape jobs. Please wait for some to complete before submitting more.",
                      "code": "TOO_MANY_PENDING_JOBS"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Spidra is at capacity. Wait `retry_after` seconds, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The scraping service is currently at capacity. Please retry in a few minutes.",
                  "code": "SERVICE_BUSY",
                  "retry_after": 60
                }
              }
            }
          }
        },
        "tags": [
          "Scraping"
        ]
      }
    },
    "/scrape/{jobId}": {
      "get": {
        "summary": "Get a scrape",
        "description": "Returns a scrape job's status and, once it has finished, its result. Poll every 2 to 5 seconds until `status` is `completed` or `failed`. Polling is free and has no rate limit.\n\nA failed job answers `200` with `status: \"failed\"` and the reason in `error`. You aren't charged for it.\n\nA finished job stays here for about an hour, and a failed one for 24 hours. After that this returns `404`, and the run is still listed in [scrape logs](/api-reference/scraping/scrape-logs).\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` returned by `POST /scrape`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "1027909f-f231-495b-9f9f-c5e0043c51b1"
          }
        ],
        "responses": {
          "200": {
            "description": "The job's status, and its result once it has finished.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "$ref": "#/components/schemas/JobStatus"
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "What the job is doing, such as `\"Processing content with AI...\"`."
                        },
                        "progress": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1,
                          "description": "How far along the job is, from 0 to 1."
                        }
                      }
                    },
                    "result": {
                      "description": "The result, once `status` is `completed`. `null` before that.",
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/ScrapeResult"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why the job failed, once `status` is `failed`. `null` otherwise."
                    },
                    "schema_warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Only when the request's `schema` used keywords that were ignored."
                    }
                  }
                },
                "examples": {
                  "active": {
                    "summary": "Running",
                    "value": {
                      "status": "active",
                      "progress": {
                        "message": "Opening https://books.toscrape.com...",
                        "progress": 0.1
                      },
                      "result": null,
                      "error": null
                    }
                  },
                  "completed_prompt": {
                    "summary": "Finished, with a prompt",
                    "value": {
                      "status": "completed",
                      "progress": {
                        "message": "Scraping completed successfully",
                        "progress": 1
                      },
                      "result": {
                        "content": [
                          {
                            "title": "A Light in the Attic",
                            "price": "£51.77"
                          },
                          {
                            "title": "Tipping the Velvet",
                            "price": "£53.74"
                          },
                          {
                            "title": "Soumission",
                            "price": "£50.10"
                          }
                        ],
                        "data": [
                          {
                            "url": "https://books.toscrape.com",
                            "title": "All products | Books to Scrape - Sandbox",
                            "markdownContent": "[Books to Scrape](index.html) We love being scraped! ...",
                            "success": true,
                            "captchaSolvedCount": 0,
                            "lowContent": false
                          }
                        ],
                        "screenshots": [],
                        "ai_extraction_failed": false,
                        "stats": {
                          "durationMs": 37458,
                          "captchaSolvedCount": 0,
                          "inputTokens": 2628,
                          "outputTokens": 418,
                          "totalTokens": 3046
                        }
                      },
                      "error": null
                    }
                  },
                  "completed_schema": {
                    "summary": "Finished, with a schema",
                    "value": {
                      "status": "completed",
                      "progress": {
                        "message": "Scraping completed successfully",
                        "progress": 1
                      },
                      "result": {
                        "content": {
                          "title": "A Light in the Attic",
                          "price": 51.77,
                          "currency": "£",
                          "in_stock": true,
                          "rating": null
                        },
                        "data": [
                          {
                            "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                            "title": "A Light in the Attic | Books to Scrape - Sandbox",
                            "markdownContent": "[Books to Scrape](../../index.html) We love being scraped! ...",
                            "success": true,
                            "captchaSolvedCount": 0,
                            "lowContent": false
                          }
                        ],
                        "screenshots": [],
                        "ai_extraction_failed": false
                      },
                      "error": null
                    }
                  },
                  "failed": {
                    "summary": "Failed",
                    "value": {
                      "status": "failed",
                      "progress": {
                        "message": "Failed to scrape https://books.toscrape.com/this-page-does-not-exist.html: The page was not delivered: the page answered HTTP 404. Nothing was charged. Check the URL.",
                        "progress": 0
                      },
                      "result": null,
                      "error": "Failed to scrape https://books.toscrape.com/this-page-does-not-exist.html: The page was not delivered: the page answered HTTP 404. Nothing was charged. Check the URL."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The job belongs to another account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You do not have permission to access this job.",
                  "code": "FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "There's no scrape with this ID, or it finished more than an hour ago (24 hours for a failed job).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Scrape not found",
                  "code": "JOB_NOT_FOUND"
                }
              }
            }
          },
          "503": {
            "description": "The job queue is briefly unavailable. Try again in a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Job queue temporarily unavailable. Please try again.",
                  "code": "QUEUE_UNAVAILABLE"
                }
              }
            }
          }
        },
        "tags": [
          "Scraping"
        ]
      }
    },
    "/scrape-logs": {
      "get": {
        "summary": "List scrape logs",
        "description": "Lists your past scrapes, newest first, with their settings, tokens and credits. Every scrape is logged, including each URL of a [batch](/api-reference/scraping/batch-scrape), and logs are kept after the job itself expires.\n\nThe list leaves out results. Get one with [Get a scrape log](/api-reference/scraping/scrape-logs-detail). A log's `uuid` isn't the scrape's `jobId`.\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Logs per page, from 1 to 100. Higher values are capped at 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only return logs with this status. `all` returns every status.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "success",
                "error",
                "in_progress"
              ]
            },
            "example": "success"
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Only return scrapes whose URLs contain this text.",
            "schema": {
              "type": "string"
            },
            "example": "books.toscrape.com"
          },
          {
            "name": "channel",
            "in": "query",
            "description": "Only return scrapes from this channel. `api` is scrapes sent with an API key, and `playground` is scrapes run from the dashboard. `all` returns both.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "api",
                "playground"
              ]
            }
          },
          {
            "name": "dateStart",
            "in": "query",
            "description": "Only return scrapes started at or after this date, as `YYYY-MM-DD`.",
            "schema": {
              "type": "string"
            },
            "example": "2026-10-01"
          },
          {
            "name": "dateEnd",
            "in": "query",
            "description": "Only return scrapes started at or before this date, as `YYYY-MM-DD`.",
            "schema": {
              "type": "string"
            },
            "example": "2026-10-31"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of scrape logs and the total that match.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "logs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ScrapeLogSummary"
                          },
                          "description": "The logs on this page."
                        },
                        "total": {
                          "type": "integer",
                          "description": "How many logs match the filters in all."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "logs": [
                      {
                        "uuid": "54ec8875-c92c-40cc-8fb6-ba3f6d68c0ee",
                        "status": "success",
                        "started_at": "2026-10-24T19:29:01.000Z",
                        "finished_at": "2026-10-24T19:29:11.000Z",
                        "error_message": "",
                        "urls": [
                          {
                            "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                            "actions": []
                          }
                        ],
                        "extraction_prompt": "Extract the book details",
                        "input_tokens": 571,
                        "output_tokens": 23,
                        "tokens_used": 594,
                        "captcha_solved_count": 0,
                        "scraped_sites_count": 1,
                        "ai_output_format": "json",
                        "latency_ms": 9846,
                        "credits_used": 2,
                        "use_proxy": 1,
                        "proxy_country": "ng",
                        "scrape_mode": "default",
                        "extract_content_only": 0,
                        "schema_json": "{\"type\":\"object\",\"required\":[\"title\",\"price\"],\"properties\":{\"title\":{\"type\":\"string\"},\"price\":{\"type\":\"number\"},...}}",
                        "screenshot": 0,
                        "full_page_screenshot": 0,
                        "page_title": "A Light in the Attic | Books to Scrape - Sandbox"
                      },
                      {
                        "uuid": "13fcab8f-5920-4a3a-a100-6fb764543827",
                        "status": "success",
                        "started_at": "2026-10-24T19:28:20.000Z",
                        "finished_at": "2026-10-24T19:28:57.000Z",
                        "error_message": "",
                        "urls": [
                          {
                            "url": "https://books.toscrape.com",
                            "actions": []
                          }
                        ],
                        "extraction_prompt": "Return the title and price of every book on the page",
                        "input_tokens": 2628,
                        "output_tokens": 418,
                        "tokens_used": 3046,
                        "captcha_solved_count": 0,
                        "scraped_sites_count": 1,
                        "ai_output_format": "json",
                        "latency_ms": 37458,
                        "credits_used": 3,
                        "use_proxy": 1,
                        "proxy_country": "ng",
                        "scrape_mode": "default",
                        "extract_content_only": 0,
                        "schema_json": null,
                        "screenshot": 0,
                        "full_page_screenshot": 0,
                        "page_title": "All products | Books to Scrape - Sandbox"
                      }
                    ],
                    "total": 3437
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "The logs couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Something went wrong loading this. Try again."
                }
              }
            }
          }
        },
        "tags": [
          "Scrape Logs"
        ]
      }
    },
    "/scrape-logs/{uuid}": {
      "get": {
        "summary": "Get a scrape log",
        "description": "Returns one past scrape with its settings, cost and result. Use it to get a result after the scrape job has expired from [Get a scrape](/api-reference/scraping/scrape-status).\n",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "The log's `uuid` from [List scrape logs](/api-reference/scraping/scrape-logs). Not the scrape's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "6fba5c8e-22f5-40f7-a335-9f7c20faa799"
          }
        ],
        "responses": {
          "200": {
            "description": "The scrape log with its result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/ScrapeLogDetail"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "uuid": "6fba5c8e-22f5-40f7-a335-9f7c20faa799",
                    "status": "success",
                    "started_at": "2026-10-25T04:16:33.000Z",
                    "finished_at": "2026-10-25T04:16:38.000Z",
                    "error_message": "",
                    "urls": [
                      {
                        "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                        "actions": []
                      }
                    ],
                    "extraction_prompt": null,
                    "input_tokens": 0,
                    "output_tokens": 0,
                    "tokens_used": 0,
                    "captcha_solved_count": 0,
                    "scraped_sites_count": 1,
                    "ai_output_format": "markdown",
                    "latency_ms": 5747,
                    "credits_used": 1,
                    "use_proxy": 0,
                    "proxy_country": null,
                    "scrape_mode": "default",
                    "extract_content_only": 0,
                    "schema_json": null,
                    "screenshot": 0,
                    "full_page_screenshot": 0,
                    "page_title": "A Light in the Attic | Books to Scrape - Sandbox",
                    "result_data": "[Books to Scrape](../../index.html) We love being scraped! \n\n* [Home](../../index.html)\n* [Books](../category/books%5F1/index.html)\n..."
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no scrape log with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Log not found"
                }
              }
            }
          },
          "500": {
            "description": "The log couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Something went wrong loading this. Try again."
                }
              }
            }
          }
        },
        "tags": [
          "Scrape Logs"
        ]
      }
    },
    "/account": {
      "get": {
        "summary": "Account",
        "description": "Returns your plan, how many credits you have left this billing period, and your Stealth Mode bandwidth. Use it from code to check your balance before a large batch or crawl.\n\n`credits.used` includes credits held by jobs that are still running. If a job ends up costing less than what was held, the difference comes back. For usage over time, use [Usage stats](/api-reference/account/usage-stats).\n",
        "responses": {
          "200": {
            "description": "Your plan, credits and bandwidth.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "plan": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "Your current plan."
                            }
                          }
                        },
                        "credits": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer",
                              "description": "Credits available this billing period, including top-ups."
                            },
                            "used": {
                              "type": "integer",
                              "description": "Credits used this period, including credits held by running jobs."
                            },
                            "remaining": {
                              "type": "integer",
                              "description": "`limit` minus `used`, never below 0."
                            },
                            "billingCycleStart": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date-time",
                              "description": "When the current billing period started."
                            }
                          }
                        },
                        "proxyBandwidth": {
                          "type": "object",
                          "description": "Stealth Mode bandwidth for this period, in MB.",
                          "properties": {
                            "limitMb": {
                              "type": "number",
                              "description": "Bandwidth available, including top-ups."
                            },
                            "usedMb": {
                              "type": [
                                "string",
                                "number"
                              ],
                              "description": "Bandwidth used. Currently sent as a string, such as `\"1999.998\"`, so convert it before doing math."
                            },
                            "remainingMb": {
                              "type": "number",
                              "description": "`limitMb` minus `usedMb`, never below 0."
                            }
                          }
                        },
                        "subscription": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "Your subscription, or `null` on the free plan.",
                          "properties": {
                            "status": {
                              "type": "string",
                              "description": "The subscription's status, such as `active` or `past_due`."
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "plan": {
                      "name": "Builder"
                    },
                    "credits": {
                      "limit": 25000,
                      "used": 17446,
                      "remaining": 7554,
                      "billingCycleStart": "2026-10-24T16:38:43.000Z"
                    },
                    "proxyBandwidth": {
                      "limitMb": 2000,
                      "usedMb": "1999.998",
                      "remainingMb": 0.0019999999999527063
                    },
                    "subscription": {
                      "status": "active"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Your plan couldn't be found. Contact support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Plan not found"
                }
              }
            }
          },
          "500": {
            "description": "The account couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to fetch account information"
                }
              }
            }
          }
        },
        "tags": [
          "Account"
        ]
      }
    },
    "/usage-stats": {
      "get": {
        "summary": "Usage stats",
        "description": "Returns your credits, tokens, requests, crawls and CAPTCHA solves per day or per week, oldest first. Days or weeks with no activity are included with zeros.\n\n`credits` is the total across every tool. For credits split by tool, use [Usage by tool](/api-reference/account/usage-breakdown).\n",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": true,
            "description": "`7d` for one row per day over the last 7 days, `30d` for one row per day over the last 30 days, or `weekly` for one row per week over the last 7 weeks.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "weekly"
              ]
            },
            "example": "7d"
          }
        ],
        "responses": {
          "200": {
            "description": "One row per day or week.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UsageStatsEntry"
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "label": "Oct 19",
                      "date": "2026-10-19",
                      "tokens": 76818,
                      "requests": 32,
                      "crawls": 0,
                      "captchas": 0,
                      "latency": 5560.1563,
                      "credits": 74
                    },
                    {
                      "label": "Oct 20",
                      "date": "2026-10-20",
                      "tokens": 0,
                      "requests": 3,
                      "crawls": 0,
                      "captchas": 0,
                      "latency": 4251.6667,
                      "credits": 3
                    },
                    "..."
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`range` is missing or isn't one of the allowed values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Invalid or missing range"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Usage couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Something went wrong loading usage. Try again."
                }
              }
            }
          }
        },
        "tags": [
          "Usage Stats"
        ]
      }
    },
    "/crawl": {
      "post": {
        "summary": "Crawl",
        "description": "Starts a crawl that begins at one URL, follows links toward the pages you describe in `crawlInstruction`, and returns a `jobId`. Poll [Get a crawl](/api-reference/crawling/crawl-status) until `status` is `completed`, `failed` or `cancelled`. Guide: [Crawl](/crawl).\n\n`maxPages` counts only the pages returned. Pages read just to find them are free and don't count. A crawl stays under the start URL's path unless `crawlEntireDomain` is `true`. With a `schema` or `transformInstruction`, each page's `data` is what the AI extracted. With neither, it's the page as Markdown and no AI runs.\n\nCredits are held for every page the crawl may return. If your balance can't cover `maxPages`, the crawl starts anyway with `maxPages` lowered to what it covers, and the response says so. If you send the exact same request again within 5 seconds, you get the first job's `jobId` back with `deduplicated: true`.\n\nWith `webhookUrl`, Spidra sends a `POST` for each page (`crawl.page`), and one when the crawl finishes (`crawl.completed`) or fails (`crawl.failed`). Each request times out after 5 seconds and isn't retried, so treat them as notifications and poll for the full result. See [Webhooks](/api-reference/webhooks).\n\n**Credits:** 1 per page returned, plus AI credits for the tokens used with a `schema` or `transformInstruction`, plus 5 per CAPTCHA solved. A crawl that returns no pages costs nothing. See [How credits work](/billing/how-credits-work).\n\n**Rate limits:** 60 requests a minute, shared with [extract](/api-reference/crawling/crawl-extract) and [page retries](/api-reference/crawling/crawl-retry-page), and up to 5 unfinished crawls at a time.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "baseUrl",
                  "crawlInstruction"
                ],
                "properties": {
                  "baseUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "The page to start from, starting with `http://` or `https://`. Start from a page that links to the pages you want, such as a category or index page. Private and internal addresses are rejected.",
                    "example": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html"
                  },
                  "crawlInstruction": {
                    "type": "string",
                    "description": "Which pages to return, in plain English, such as `\"Individual book pages\"`. The [report](/api-reference/crawling/crawl-report) shows how it was understood."
                  },
                  "transformInstruction": {
                    "type": "string",
                    "description": "What to extract from each returned page, in plain English, such as `\"Return the book's title and whether it is in stock\"`. Without a `schema`, the AI picks the shape."
                  },
                  "schema": {
                    "type": "object",
                    "description": "A [JSON Schema](/options/structured-output) for each page's `data`. Takes precedence over `transformInstruction` for the shape."
                  },
                  "maxPages": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 5,
                    "description": "The most pages to return. Your plan sets the top value (100 on Free, 1,000 on Starter, 5,000 on Builder, 10,000 on Pro and Enterprise)."
                  },
                  "maxDepth": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many clicks from the start page to follow. `0` returns only the start page. No limit by default."
                  },
                  "includePaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only follow and return URLs whose path matches one of these. Globs such as `\"/blog/*\"` or regexes such as `\"^/docs/v[0-9]+/\"`. A pattern starting with `/` matches from the start of the path."
                  },
                  "excludePaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Never follow or return URLs whose path matches one of these. Same pattern rules as `includePaths`."
                  },
                  "allowSubdomains": {
                    "type": "boolean",
                    "default": false,
                    "description": "Also follows links to subdomains of the start URL's host, such as `blog.example.com` from `example.com`."
                  },
                  "crawlEntireDomain": {
                    "type": "boolean",
                    "default": false,
                    "description": "Follows links anywhere on the same site, not only under the start URL's path."
                  },
                  "ignoreQueryParams": {
                    "type": "boolean",
                    "default": false,
                    "description": "Treats URLs that differ only by their query string as one page."
                  },
                  "useSitemap": {
                    "type": "boolean",
                    "default": true,
                    "description": "Also reads the site's sitemap for pages to consider."
                  },
                  "respectRobots": {
                    "type": "boolean",
                    "default": false,
                    "description": "Skips URLs the site's `robots.txt` asks crawlers not to visit."
                  },
                  "scrapeMode": {
                    "type": "string",
                    "enum": [
                      "default",
                      "fast"
                    ],
                    "default": "default",
                    "description": "`default` opens every page in a real browser. `fast` fetches pages directly and opens a browser only when a page needs one. `crawlerMode` is accepted as an older name for this field."
                  },
                  "useProxy": {
                    "type": "boolean",
                    "default": false,
                    "description": "Turns on [Stealth Mode](/options/proxies-and-captchas). Billed by bandwidth, not credits. Not needed when you set `proxyCountry`. `false` keeps the proxy off, even with a country. When Stealth Mode can't be used because your proxy bandwidth ran out, the request runs without it and `warnings` says so."
                  },
                  "proxyCountry": {
                    "type": "string",
                    "description": "The country to read pages from, as a two-letter code such as `us`, `gb` or `de`, or `eu` or `asia`. Setting a country turns [Stealth Mode](/options/proxies-and-captchas) on (billed by bandwidth), and the response's `warnings` says so, unless `useProxy` is `false`: then the country isn't used, and `warnings` says that instead. `global` means any country.",
                    "example": "gb"
                  },
                  "cookies": {
                    "type": "string",
                    "description": "Cookies from your own signed-in browser session, to crawl pages that need an account. Never stored. See [Logged-in pages](/options/logged-in-pages)."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "An `http` or `https` URL to notify for each page and when the crawl ends. Private and internal addresses are rejected. See [Webhooks](/api-reference/webhooks)."
                  }
                }
              },
              "examples": {
                "schema": {
                  "summary": "Book pages with a schema",
                  "value": {
                    "baseUrl": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html",
                    "crawlInstruction": "Individual book pages",
                    "schema": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "price": {
                          "type": "number"
                        },
                        "in_stock": {
                          "type": "boolean"
                        }
                      }
                    },
                    "maxPages": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The crawl was queued. Poll `GET /crawl/{jobId}` for the result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The crawl's ID. Use it with `GET /crawl/{jobId}`."
                    },
                    "message": {
                      "type": "string",
                      "description": "Where to poll, and whether `maxPages` was lowered."
                    },
                    "maxPages": {
                      "type": "integer",
                      "description": "Only when your credits covered fewer pages than you asked for. The `maxPages` the crawl runs with."
                    },
                    "maxPagesRequested": {
                      "type": "integer",
                      "description": "Only with `maxPages`. What you asked for."
                    },
                    "deduplicated": {
                      "type": "boolean",
                      "description": "`true` when the same request was sent in the last 5 seconds and this is that job's ID."
                    }
                  }
                },
                "example": {
                  "status": "queued",
                  "jobId": "e303fb87-846e-4a30-8aa5-bfca457a5357",
                  "message": "Crawl job queued. Poll /api/crawl/e303fb87-846e-4a30-8aa5-bfca457a5357 for results."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue crawling.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "Your account has no credits left, not even for one page. Top up or upgrade, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You have exceeded your monthly credit limit."
                }
              }
            }
          },
          "422": {
            "description": "The request isn't valid. Each check returns its own message. When `maxPages` is above your plan's limit, the response adds `code` `CRAWL_PAGE_LIMIT` and `limit`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": "integer",
                          "description": "With `CRAWL_PAGE_LIMIT`, the most pages your plan allows in one crawl."
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "missing_fields": {
                    "summary": "Missing baseUrl or crawlInstruction",
                    "value": {
                      "status": "error",
                      "message": "Missing required fields: baseUrl, crawlInstruction",
                      "errors": [
                        "Missing required fields: baseUrl, crawlInstruction"
                      ]
                    }
                  },
                  "max_pages": {
                    "summary": "maxPages isn't a whole number",
                    "value": {
                      "status": "error",
                      "message": "maxPages must be a whole number of 1 or more",
                      "errors": [
                        "maxPages must be a whole number of 1 or more"
                      ]
                    }
                  },
                  "plan_limit": {
                    "summary": "maxPages above the plan's limit",
                    "value": {
                      "status": "error",
                      "code": "CRAWL_PAGE_LIMIT",
                      "message": "Your Free plan crawls up to 100 pages at a time. Set maxPages to 100 or less, or upgrade your plan for larger crawls.",
                      "limit": 100
                    }
                  },
                  "bad_mode": {
                    "summary": "Unknown scrapeMode",
                    "value": {
                      "status": "error",
                      "message": "scrapeMode must be \"fast\" or \"default\"",
                      "errors": [
                        "scrapeMode must be \"fast\" or \"default\""
                      ]
                    }
                  },
                  "private_webhook": {
                    "summary": "Webhook on a private address",
                    "value": {
                      "status": "error",
                      "message": "webhookUrl must not point to a private or internal host",
                      "errors": [
                        "webhookUrl must not point to a private or internal host"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Either more than 60 crawl requests in a minute, or 5 crawls already unfinished. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rate_limit": {
                    "summary": "More than 60 a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many job submissions. Please slow down and try again shortly."
                    }
                  },
                  "pending": {
                    "summary": "5 crawls still running",
                    "value": {
                      "status": "error",
                      "message": "You have too many pending crawl jobs. Please wait for some to complete before submitting more.",
                      "code": "TOO_MANY_PENDING_JOBS"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The crawl couldn't be created or queued. The credits held for it were returned. Send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "create": {
                    "summary": "Couldn't create the crawl",
                    "value": {
                      "status": "error",
                      "message": "Failed to create crawl job"
                    }
                  },
                  "queue": {
                    "summary": "Couldn't queue the crawl",
                    "value": {
                      "status": "error",
                      "message": "Failed to queue crawl job"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Crawling is at capacity. Wait `retry_after` seconds, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The crawling service is currently at capacity. Please retry in a few minutes.",
                  "code": "SERVICE_BUSY",
                  "retry_after": 60
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/{jobId}": {
      "get": {
        "summary": "Get a crawl",
        "description": "Returns a crawl's status and progress and, once it has finished, its first 100 pages. Poll every few seconds until `status` is `completed`, `failed` or `cancelled`. Polling has no rate limit.\n\nWhen a crawl returned more than 100 pages, `resultTruncated` is `true`. Read every page with [Get crawl pages](/api-reference/crawling/crawl-pages). The `html` and `markdown` links expire after 1 hour.\n\nA failed crawl answers `200` with `status: \"failed\"` and the reason in `error`, and costs nothing. A finished crawl stays here for about an hour, and a failed one for 24 hours. After that this returns `404`, but its pages, details, report and download stay available from the other crawl endpoints. Extractions started with [Extract from a crawl](/api-reference/crawling/crawl-extract) are polled here too.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` returned by `POST /crawl` or `POST /crawl/{jobId}/extract`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          }
        ],
        "responses": {
          "200": {
            "description": "The crawl's status, and its pages once it has finished.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "$ref": "#/components/schemas/CrawlStatus"
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "The crawl's own stage, such as `running` or `completed`."
                        },
                        "message": {
                          "type": "string",
                          "description": "What the crawl is doing, such as `\"Visiting https://example.com to discover pages...\"`."
                        },
                        "progress": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1,
                          "description": "How far along the crawl is, from 0 to 1."
                        }
                      }
                    },
                    "result": {
                      "description": "The first 100 pages once `status` is `completed`. `null` before that.",
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CrawlPage"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why the crawl failed, once `status` is `failed`. `null` otherwise."
                    },
                    "totalPages": {
                      "type": "integer",
                      "description": "Only once `status` is `completed`. How many pages the crawl returned."
                    },
                    "resultTruncated": {
                      "type": "boolean",
                      "description": "Only when `totalPages` is more than `result` holds. Read the rest from `GET /crawl/{jobId}/pages`."
                    },
                    "message": {
                      "type": "string",
                      "description": "Only with `resultTruncated`. Says where to read every page."
                    }
                  }
                },
                "examples": {
                  "completed": {
                    "summary": "Finished",
                    "value": {
                      "status": "completed",
                      "progress": {
                        "status": "completed",
                        "message": "Crawl completed",
                        "progress": 1
                      },
                      "result": [
                        {
                          "url": "https://books.toscrape.com/catalogue/sharp-objects_997/index.html",
                          "status": "success",
                          "title": "Sharp Objects | Books to Scrape - Sandbox",
                          "data": {
                            "title": "Sharp Objects",
                            "price": 47.82,
                            "in_stock": true
                          },
                          "html": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/47837f66-2ea8-4b60-a2e6-7656c0fe1946.html?...",
                          "markdown": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/c8973f4e-da20-4927-a2ef-bd763a274bad.md?...",
                          "depth": 1,
                          "parentUrl": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html"
                        },
                        {
                          "url": "https://books.toscrape.com/catalogue/in-a-dark-dark-wood_963/index.html",
                          "status": "success",
                          "title": "In a Dark, Dark Wood | Books to Scrape - Sandbox",
                          "data": {
                            "title": "In a Dark, Dark Wood",
                            "price": 19.63,
                            "in_stock": true
                          },
                          "html": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/9b889b6c-5296-4cdb-84ca-2440acfd2c2b.html?...",
                          "markdown": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/daa293f8-28c5-4039-ae8f-40643015f855.md?...",
                          "depth": 1,
                          "parentUrl": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html"
                        },
                        "..."
                      ],
                      "error": null,
                      "totalPages": 3
                    }
                  },
                  "cancelled": {
                    "summary": "Cancelled",
                    "value": {
                      "status": "cancelled",
                      "progress": {
                        "status": "cancelled",
                        "message": "Crawl cancelled",
                        "progress": 1
                      },
                      "result": null,
                      "error": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The crawl belongs to another account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You do not have permission to access this job"
                }
              }
            }
          },
          "404": {
            "description": "There's no crawl with this ID, or it finished more than an hour ago (24 hours for a failed one). Its pages are still available from `GET /crawl/{jobId}/pages`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Crawl job not found"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      },
      "delete": {
        "summary": "Cancel a crawl",
        "description": "Cancels a queued or running crawl. A crawl that hasn't started is removed and its held credits are returned.\n\nA running crawl stops at its next check. If it had already returned pages, it finishes as `completed` with those pages, and they're charged as usual. If it hadn't, it ends as `cancelled` and costs nothing. A crawl about to finish may still complete.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` returned by `POST /crawl`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          }
        ],
        "responses": {
          "200": {
            "description": "The crawl was cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "cancelled"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The crawl's ID."
                    }
                  }
                },
                "example": {
                  "status": "cancelled",
                  "jobId": "8bc25a40-bdb4-4dff-b971-a266c1c668c7"
                }
              }
            }
          },
          "400": {
            "description": "The crawl has already finished, failed or been cancelled, so there's nothing to cancel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Cannot cancel a job with status: completed",
                  "error": "Cannot cancel a job with status: completed",
                  "code": "ALREADY_TERMINAL"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no crawl with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Job not found",
                  "error": "Job not found",
                  "code": "JOB_NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "The crawl couldn't be cancelled. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to cancel crawl job",
                  "error": "Failed to cancel crawl job"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/history": {
      "get": {
        "summary": "List crawls",
        "description": "Lists your crawls and extractions, newest first, with their settings, page counts and cost. An extraction has `source_job_id` set to the crawl it came from. Crawls are kept, so this includes ones whose `GET /crawl/{jobId}` has expired.\n\nThis response uses snake_case, and `credits_used` is a decimal string.\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Crawls per page, from 1 to 100. Higher values are capped at 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "example": 2
          }
        ],
        "responses": {
          "200": {
            "description": "One page of crawls.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "description": "The crawls on this page.",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/CrawlJobRecord"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "user_uuid": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Your account's ID."
                              },
                              "source_job_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid",
                                "description": "For an extraction, the crawl it ran on. `null` for a crawl."
                              },
                              "use_proxy": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "enum": [
                                  0,
                                  1,
                                  null
                                ],
                                "description": "`1` when the crawl went through a proxy."
                              },
                              "proxy_billing": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "none",
                                  "billed",
                                  "free_auto",
                                  null
                                ],
                                "description": "`billed` when Stealth Mode bandwidth was charged, `free_auto` when a proxy was used at no charge, `none` when no proxy was used."
                              },
                              "proxy_bandwidth_mb": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Proxy bandwidth used, in MB, as a decimal string."
                              },
                              "pages_crawled": {
                                "type": "integer",
                                "description": "How many pages were returned successfully."
                              },
                              "site_title": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The title of the first page returned, to help you recognize the crawl."
                              }
                            }
                          }
                        ]
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many crawls you have in all."
                    },
                    "page": {
                      "type": "integer",
                      "description": "This page's number."
                    },
                    "totalPages": {
                      "type": "integer",
                      "description": "How many pages there are at this `limit`."
                    }
                  }
                },
                "example": {
                  "jobs": [
                    {
                      "id": "1b4dc02b-f146-404e-9fd2-3e444f1e01cc",
                      "user_uuid": "4aeefb9f-30c3-41fb-886a-10245923dc31",
                      "source_job_id": "e303fb87-846e-4a30-8aa5-bfca457a5357",
                      "base_url": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html",
                      "crawl_instruction": null,
                      "transform_instruction": "Return the book's title and whether it is in stock",
                      "output_schema": null,
                      "max_pages": 3,
                      "include_paths": null,
                      "exclude_paths": null,
                      "max_depth": null,
                      "allow_subdomains": 0,
                      "crawl_entire_domain": 0,
                      "ignore_query_params": 0,
                      "webhook_url": null,
                      "status": "completed",
                      "input_tokens": 3367,
                      "output_tokens": 35,
                      "credits_used": "2.00",
                      "created_at": "2026-10-25T03:16:33.000Z",
                      "updated_at": "2026-10-25T03:16:35.000Z",
                      "use_proxy": 0,
                      "proxy_billing": "none",
                      "proxy_bandwidth_mb": null,
                      "pages_crawled": 3,
                      "site_title": "Sharp Objects | Books to Scrape - Sandbox"
                    },
                    {
                      "id": "e303fb87-846e-4a30-8aa5-bfca457a5357",
                      "user_uuid": "4aeefb9f-30c3-41fb-886a-10245923dc31",
                      "source_job_id": null,
                      "base_url": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html",
                      "crawl_instruction": "Individual book pages",
                      "transform_instruction": null,
                      "output_schema": {
                        "type": "object",
                        "properties": {
                          "price": {
                            "type": "number"
                          },
                          "title": {
                            "type": "string"
                          },
                          "in_stock": {
                            "type": "boolean"
                          }
                        }
                      },
                      "max_pages": 3,
                      "include_paths": null,
                      "exclude_paths": null,
                      "max_depth": null,
                      "allow_subdomains": 0,
                      "crawl_entire_domain": 0,
                      "ignore_query_params": 0,
                      "webhook_url": null,
                      "status": "completed",
                      "input_tokens": 4376,
                      "output_tokens": 59,
                      "credits_used": "6.00",
                      "created_at": "2026-10-25T03:14:45.000Z",
                      "updated_at": "2026-10-25T03:16:38.000Z",
                      "use_proxy": 1,
                      "proxy_billing": "free_auto",
                      "proxy_bandwidth_mb": "1.8537",
                      "pages_crawled": 3,
                      "site_title": "Sharp Objects | Books to Scrape - Sandbox"
                    }
                  ],
                  "total": 361,
                  "page": 1,
                  "totalPages": 181
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "The list couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to fetch crawl history",
                  "error": "Failed to fetch crawl history"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/job/{jobId}": {
      "get": {
        "summary": "Get crawl details",
        "description": "Returns a crawl's settings, tokens, credits and how many pages it returned. Unlike [Get a crawl](/api-reference/crawling/crawl-status), this stays available after the crawl finishes and doesn't include the pages.\n\nThis response uses snake_case, and `credits_used` is a decimal string.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The crawl's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          }
        ],
        "responses": {
          "200": {
            "description": "The crawl's settings and totals.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CrawlJobRecord"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "pages_crawled": {
                          "type": "integer",
                          "description": "How many pages were returned successfully."
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "e303fb87-846e-4a30-8aa5-bfca457a5357",
                  "base_url": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html",
                  "crawl_instruction": "Individual book pages",
                  "transform_instruction": null,
                  "max_pages": 3,
                  "max_depth": null,
                  "include_paths": null,
                  "exclude_paths": null,
                  "allow_subdomains": 0,
                  "crawl_entire_domain": 0,
                  "ignore_query_params": 0,
                  "output_schema": {
                    "type": "object",
                    "properties": {
                      "price": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      },
                      "in_stock": {
                        "type": "boolean"
                      }
                    }
                  },
                  "webhook_url": null,
                  "status": "completed",
                  "created_at": "2026-10-25T03:14:45.000Z",
                  "updated_at": "2026-10-25T03:15:19.000Z",
                  "input_tokens": 3450,
                  "output_tokens": 45,
                  "credits_used": "5.00",
                  "pages_crawled": 3
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no crawl with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Job not found",
                  "error": "Job not found",
                  "code": "JOB_NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "The crawl couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to fetch job details",
                  "error": "Failed to fetch job details"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/{jobId}/extract": {
      "post": {
        "summary": "Extract from a crawl",
        "description": "Runs a new `transformInstruction` on every page a finished crawl saved, without visiting the site again, and returns a new `jobId`. Poll it with [Get a crawl](/api-reference/crawling/crawl-status). The original crawl isn't changed.\n\nUse it to pull different data from pages you've already crawled. The new job shows in [List crawls](/api-reference/crawling/crawl-history) with `source_job_id` set to the original crawl.\n\n**Credits:** only the AI tokens used, about 1 credit per 3,300 input tokens or 400 output tokens, rounded up. 1 credit per page is held while it runs, and the difference comes back.\n\n**Rate limits:** 60 requests a minute, shared with `POST /crawl` and page retries. It counts toward your 5 unfinished crawls.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` of a completed crawl.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "transformInstruction"
                ],
                "properties": {
                  "transformInstruction": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "What to extract from each page, in plain English."
                  }
                }
              },
              "examples": {
                "extract": {
                  "summary": "New fields from the same pages",
                  "value": {
                    "transformInstruction": "Return the book's title and whether it is in stock"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The extraction was queued. Poll `GET /crawl/{jobId}` with the new `jobId`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The new extraction job's ID. Not the crawl's ID."
                    },
                    "message": {
                      "type": "string",
                      "description": "Where to poll for the result."
                    }
                  }
                },
                "example": {
                  "status": "queued",
                  "jobId": "1b4dc02b-f146-404e-9fd2-3e444f1e01cc",
                  "message": "Extraction job queued. Poll /api/crawl/1b4dc02b-f146-404e-9fd2-3e444f1e01cc for results."
                }
              }
            }
          },
          "400": {
            "description": "The crawl hasn't completed, so it has no saved pages to extract from. Wait for it to finish.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Source crawl job has not completed successfully",
                  "error": "Source crawl job has not completed successfully"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "Your account doesn't have enough credits to hold 1 per page. Top up or upgrade, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You have exceeded your monthly credit limit.",
                  "error": "You have exceeded your monthly credit limit."
                }
              }
            }
          },
          "404": {
            "description": "There's no crawl with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Source crawl job not found",
                  "error": "Source crawl job not found"
                }
              }
            }
          },
          "422": {
            "description": "`transformInstruction` is missing or longer than 5,000 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing": {
                    "summary": "No instruction",
                    "value": {
                      "status": "error",
                      "message": "Missing required field: transformInstruction",
                      "errors": [
                        "Missing required field: transformInstruction"
                      ]
                    }
                  },
                  "too_long": {
                    "summary": "Instruction too long",
                    "value": {
                      "status": "error",
                      "message": "transformInstruction must be 5000 characters or fewer",
                      "errors": [
                        "transformInstruction must be 5000 characters or fewer"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Either more than 60 crawl requests in a minute, or 5 crawls already unfinished. Wait, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rate_limit": {
                    "summary": "More than 60 a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many job submissions. Please slow down and try again shortly."
                    }
                  },
                  "pending": {
                    "summary": "5 crawls still running",
                    "value": {
                      "status": "error",
                      "message": "You have too many pending crawl jobs. Please wait for some to complete before submitting more.",
                      "code": "TOO_MANY_PENDING_JOBS"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The extraction couldn't be created. Any credits held for it were returned. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to create extract job",
                  "error": "Failed to create extract job"
                }
              }
            }
          },
          "503": {
            "description": "Crawling is at capacity. Wait `retry_after` seconds, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The crawling service is currently at capacity. Please retry in a few minutes.",
                  "code": "SERVICE_BUSY",
                  "retry_after": 60
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/{jobId}/pages": {
      "get": {
        "summary": "Get crawl pages",
        "description": "Returns every page of a crawl, up to 1,000 per call, oldest first. Use it for crawls bigger than the 100 pages [Get a crawl](/api-reference/crawling/crawl-status) holds, or after that endpoint has expired. Keep calling with `offset` increased by `limit` until `hasMore` is `false`.\n\nFailed pages are included with their `error_message`. Each page's `id` is what [Retry a crawl page](/api-reference/crawling/crawl-retry-page) needs. The `html` and `markdown` links expire after 1 hour.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The crawl's or extraction's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many pages to skip.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Pages per call, from 1 to 1,000. Higher values are capped at 1,000.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1000
            },
            "example": 2
          }
        ],
        "responses": {
          "200": {
            "description": "One batch of pages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pages": {
                      "type": "array",
                      "description": "The pages in this batch. Uses snake_case field names.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The page's ID. Use it with `POST /crawl/{jobId}/retry/{pageId}`."
                          },
                          "job_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The crawl's ID."
                          },
                          "url": {
                            "type": "string",
                            "description": "The page's URL."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "success",
                              "failed"
                            ],
                            "description": "Whether the page was read."
                          },
                          "title": {
                            "type": "string",
                            "description": "The page title."
                          },
                          "data": {
                            "type": [
                              "object",
                              "array",
                              "string",
                              "null"
                            ],
                            "description": "The extracted data, or the page as Markdown when the crawl had no `schema` or `transformInstruction`."
                          },
                          "error_message": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Why the page failed. `null` otherwise."
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the page was saved."
                          },
                          "html": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "A link to the page's stored HTML. Expires after 1 hour."
                          },
                          "markdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "A link to the page's stored Markdown. Expires after 1 hour."
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many pages the crawl has in all."
                    },
                    "offset": {
                      "type": "integer",
                      "description": "The `offset` used."
                    },
                    "limit": {
                      "type": "integer",
                      "description": "The `limit` used."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "`true` when there are more pages after this batch."
                    }
                  }
                },
                "example": {
                  "pages": [
                    {
                      "id": "17938855-3664-48c4-8140-4b05d16a037f",
                      "job_id": "e303fb87-846e-4a30-8aa5-bfca457a5357",
                      "url": "https://books.toscrape.com/catalogue/sharp-objects_997/index.html",
                      "status": "success",
                      "title": "Sharp Objects | Books to Scrape - Sandbox",
                      "data": {
                        "price": 47.82,
                        "title": "Sharp Objects",
                        "in_stock": true
                      },
                      "error_message": null,
                      "created_at": "2026-10-25T03:15:04.000Z",
                      "html": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/47837f66-2ea8-4b60-a2e6-7656c0fe1946.html?...",
                      "markdown": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/c8973f4e-da20-4927-a2ef-bd763a274bad.md?..."
                    },
                    {
                      "id": "baab22f2-195f-454c-a094-4b4454518ceb",
                      "job_id": "e303fb87-846e-4a30-8aa5-bfca457a5357",
                      "url": "https://books.toscrape.com/catalogue/in-a-dark-dark-wood_963/index.html",
                      "status": "success",
                      "title": "In a Dark, Dark Wood | Books to Scrape - Sandbox",
                      "data": {
                        "price": 19.63,
                        "title": "In a Dark, Dark Wood",
                        "in_stock": true
                      },
                      "error_message": null,
                      "created_at": "2026-10-25T03:15:12.000Z",
                      "html": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/9b889b6c-5296-4cdb-84ca-2440acfd2c2b.html?...",
                      "markdown": "https://.../crawl/e303fb87-846e-4a30-8aa5-bfca457a5357/daa293f8-28c5-4039-ae8f-40643015f855.md?..."
                    }
                  ],
                  "total": 3,
                  "offset": 0,
                  "limit": 2,
                  "hasMore": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "There's no crawl with this ID on your account. This endpoint answers `403` rather than `404` for an unknown ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Unauthorized access or job not found",
                  "error": "Unauthorized access or job not found"
                }
              }
            }
          },
          "500": {
            "description": "The pages couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to fetch crawl pages",
                  "error": "Failed to fetch crawl pages"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/stats": {
      "get": {
        "summary": "Count crawls",
        "description": "Returns how many crawls and extractions you've run in all. For the crawls themselves, use [List crawls](/api-reference/crawling/crawl-history).\n",
        "responses": {
          "200": {
            "description": "Your crawl count.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "How many crawls and extractions you've run."
                    }
                  }
                },
                "example": {
                  "total": 361
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "The count couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to fetch crawl stats",
                  "error": "Failed to fetch crawl stats"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/{jobId}/download": {
      "get": {
        "summary": "Download a crawl",
        "description": "Returns every successful page of a crawl as a ZIP file. Use `include` to choose what goes in.\n\nWith more than one kind of file, the ZIP has a folder per page holding `data.<ext>`, `markdown.md` and `index.html`. With one kind, the files sit at the top level, named after each page's URL. The data file's extension follows the format you asked for in `transformInstruction` (`csv`, `md`, `xml` or `json`), or what the data looks like.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The crawl's or extraction's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          },
          {
            "name": "include",
            "in": "query",
            "description": "What to put in the ZIP, as a comma-separated list of `data`, `markdown` and `html`. All three by default.",
            "schema": {
              "type": "string",
              "default": "html,markdown,data"
            },
            "example": "markdown"
          }
        ],
        "responses": {
          "200": {
            "description": "The ZIP file, sent with `Content-Disposition` `attachment; filename=crawl-{jobId}.zip`.",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "There's no crawl with this ID on your account. This endpoint answers `403` rather than `404` for an unknown ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Unauthorized access or job not found",
                  "error": "Unauthorized access or job not found"
                }
              }
            }
          },
          "404": {
            "description": "The crawl has no successful pages, either because it's still running or because none could be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "No successful pages found for this crawl",
                  "error": "No successful pages found for this crawl"
                }
              }
            }
          },
          "500": {
            "description": "The ZIP couldn't be built. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to generate download",
                  "error": "Failed to generate download"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/crawl/{jobId}/retry/{pageId}": {
      "post": {
        "summary": "Retry a crawl page",
        "description": "Runs a crawl's `schema` or `transformInstruction` again on one saved page and returns the new data in the same response. It doesn't visit the site, and the page's stored `data` is replaced. Use it when a page came back empty or wrong. Get `pageId` from [Get crawl pages](/api-reference/crawling/crawl-pages).\n\nOnly crawls with a `schema` or `transformInstruction` can be retried, since a crawl without either has no AI step.\n\n**Credits:** only the AI tokens used, about 1 credit per 3,300 input tokens or 400 output tokens, rounded up. They're added to the crawl's `credits_used`.\n\n**Rate limits:** 60 requests a minute, shared with `POST /crawl` and extract.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The crawl's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          },
          {
            "name": "pageId",
            "in": "path",
            "required": true,
            "description": "The page's `id` from `GET /crawl/{jobId}/pages`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "17938855-3664-48c4-8140-4b05d16a037f"
          }
        ],
        "responses": {
          "200": {
            "description": "The page was extracted again. `success` is `false` when the AI couldn't extract anything, and `message` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Whether the AI returned data."
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "string"
                      ],
                      "description": "The page's new data."
                    },
                    "tokensUsed": {
                      "type": "integer",
                      "description": "AI tokens used."
                    },
                    "creditsUsed": {
                      "type": "integer",
                      "description": "Credits the retry cost."
                    },
                    "message": {
                      "type": "string",
                      "description": "What happened."
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "price": 47.82,
                    "title": "Sharp Objects",
                    "in_stock": true
                  },
                  "tokensUsed": 940,
                  "creditsUsed": 1,
                  "message": "Page transformation retried successfully"
                }
              }
            }
          },
          "400": {
            "description": "The page can't be retried, either because the crawl has no `schema` or `transformInstruction`, or because the page has no saved content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "examples": {
                  "no_instruction": {
                    "summary": "Crawl without a schema or instruction",
                    "value": {
                      "status": "error",
                      "message": "This crawl has no transform instruction or schema, so there is nothing to retry. Each page's data is its markdown.",
                      "error": "This crawl has no transform instruction or schema, so there is nothing to retry. Each page's data is its markdown."
                    }
                  },
                  "no_content": {
                    "summary": "No saved content",
                    "value": {
                      "status": "error",
                      "message": "No content available for this page (missing both markdown and HTML)",
                      "error": "No content available for this page (missing both markdown and HTML)"
                    }
                  },
                  "empty": {
                    "summary": "Saved content is empty",
                    "value": {
                      "status": "error",
                      "message": "Markdown content is empty",
                      "error": "Markdown content is empty"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "Your account has no credits left. Top up or upgrade, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You have exceeded your monthly credit limit.",
                  "error": "You have exceeded your monthly credit limit."
                }
              }
            }
          },
          "404": {
            "description": "There's no crawl with this ID on your account, or no page with this ID in the crawl.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "examples": {
                  "job": {
                    "summary": "Unknown crawl",
                    "value": {
                      "status": "error",
                      "message": "Job not found",
                      "error": "Job not found",
                      "code": "JOB_NOT_FOUND"
                    }
                  },
                  "page": {
                    "summary": "Unknown page",
                    "value": {
                      "status": "error",
                      "message": "Page not found",
                      "error": "Page not found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 60 crawl requests in a minute. Wait, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many job submissions. Please slow down and try again shortly."
                }
              }
            }
          },
          "500": {
            "description": "The retry failed. When the AI step itself failed, the body has only `error`, `tokensUsed` and `creditsUsed`, you aren't charged, and the page is marked failed. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CrawlErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "description": "Why the AI step failed."
                        },
                        "tokensUsed": {
                          "type": "integer",
                          "description": "Always `0`."
                        },
                        "creditsUsed": {
                          "type": "integer",
                          "description": "Always `0`."
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "storage": {
                    "summary": "Saved content couldn't be read",
                    "value": {
                      "status": "error",
                      "message": "Failed to fetch page content from storage",
                      "error": "Failed to fetch page content from storage"
                    }
                  },
                  "other": {
                    "summary": "Something else went wrong",
                    "value": {
                      "status": "error",
                      "message": "Failed to retry transformation",
                      "error": "Failed to retry transformation"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/batch/scrape": {
      "post": {
        "summary": "Batch scrape",
        "description": "Starts a batch that scrapes up to 50 URLs, each on its own with its own result, and returns a `batchId`. Poll [Get a batch](/api-reference/scraping/batch-scrape-status) until `status` is `completed`. Guide: [Batch scrape](/batch-scrape).\n\nEvery option applies to all the URLs. Browser actions aren't supported in a batch, so use [Start a scrape](/api-reference/scraping/scrape) for pages that need them.\n\nWith `wait: true` and up to 10 URLs, the request waits up to 45 seconds and answers `200` with the finished batch, in the same shape as [Get a batch](/api-reference/scraping/batch-scrape-status). If the batch has more than 10 URLs or takes longer, you get the usual `202` and poll.\n\nBatches are kept, so you can come back to one at any time and [list](/api-reference/scraping/batch-scrape-list), [retry](/api-reference/scraping/batch-scrape-retry) or [cancel](/api-reference/scraping/batch-scrape-cancel) it.\n\n**Credits:** the same as a scrape for each URL: 1 per URL, plus AI credits when you send a `prompt` or `schema`, plus 5 per CAPTCHA solved. 1 credit per URL is held when you submit, and a URL that fails costs nothing. See [How credits work](/billing/how-credits-work).\n\n**Rate limits:** 20 batches a minute, and up to 50 unfinished URLs at a time across your batches and scrapes.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "urls"
                ],
                "properties": {
                  "urls": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "object",
                          "required": [
                            "url"
                          ],
                          "properties": {
                            "url": {
                              "type": "string",
                              "format": "uri",
                              "description": "The page to scrape."
                            }
                          }
                        }
                      ]
                    },
                    "description": "1 to 50 pages to scrape, each starting with `http://` or `https://`. Send plain strings or `{ \"url\": \"...\" }` objects. An object may only have `url`. Private and internal addresses are rejected, and tracking parameters such as `utm_source` are removed."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "What you want from each page, in plain English, such as `\"Extract the book details\"`. Without a `schema`, the AI picks the shape of the answer."
                  },
                  "schema": {
                    "type": "object",
                    "description": "A [JSON Schema](/options/structured-output) for each item's result. You get exactly these fields and types, with `null` for anything the page doesn't show. The root must be `\"type\": \"object\"`. Sending a schema sets `output` to `\"json\"`."
                  },
                  "output": {
                    "type": "string",
                    "enum": [
                      "markdown",
                      "json"
                    ],
                    "default": "markdown",
                    "description": "`markdown` returns each page as Markdown, or the AI's answer as text when you send a `prompt`. `json` returns structured data: on [popular sites](/sites/overview) with no prompt, the page's data; elsewhere, data the AI extracts. Lowercase only."
                  },
                  "scrapeMode": {
                    "type": "string",
                    "enum": [
                      "default",
                      "fast"
                    ],
                    "default": "default",
                    "description": "`default` opens every page in a real browser. `fast` fetches the page directly and opens a browser only when the page needs one, which is quicker for static pages. `crawlerMode` is accepted as an older name for this field."
                  },
                  "useProxy": {
                    "type": "boolean",
                    "default": false,
                    "description": "Turns on [Stealth Mode](/options/proxies-and-captchas) for every URL. Billed by bandwidth, not credits. Not needed when you set `proxyCountry`. `false` keeps the proxy off, even with a country. When Stealth Mode can't be used because your proxy bandwidth ran out, the request runs without it and `warnings` says so."
                  },
                  "proxyCountry": {
                    "type": "string",
                    "description": "The country to read pages from, as a two-letter code such as `us`, `gb` or `de`, or `eu` or `asia`. Setting a country turns [Stealth Mode](/options/proxies-and-captchas) on (billed by bandwidth), and the response's `warnings` says so, unless `useProxy` is `false`: then the country isn't used, and `warnings` says that instead. `global` means any country.",
                    "example": "gb"
                  },
                  "cookies": {
                    "type": "string",
                    "description": "Cookies from your own signed-in browser session, sent with every URL. Either `name=value; name2=value2` or rows pasted from your browser's DevTools. Never stored, so send them again when you [retry](/api-reference/scraping/batch-scrape-retry). See [Logged-in pages](/options/logged-in-pages)."
                  },
                  "screenshot": {
                    "type": "boolean",
                    "default": false,
                    "description": "Takes a screenshot of the visible part of each page. Each item's `screenshotUrl` links to it."
                  },
                  "fullPageScreenshot": {
                    "type": "boolean",
                    "default": false,
                    "description": "Takes a screenshot of each whole page, top to bottom. You don't need to set `screenshot` as well."
                  },
                  "extractContentOnly": {
                    "type": "boolean",
                    "default": false,
                    "description": "Removes headers, footers, menus and other page furniture from the Markdown, leaving the main content."
                  },
                  "wait": {
                    "type": "boolean",
                    "default": false,
                    "description": "With up to 10 URLs, waits up to 45 seconds and answers `200` with the finished batch. With more URLs, or if the batch takes longer, you get `202` and poll as usual. Never an error."
                  }
                }
              },
              "examples": {
                "markdown": {
                  "summary": "Pages as Markdown",
                  "value": {
                    "urls": [
                      "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                      "https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html"
                    ]
                  }
                },
                "schema_wait": {
                  "summary": "Extract with a schema and wait for the result",
                  "value": {
                    "urls": [
                      "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                      "https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html",
                      "https://this-domain-does-not-exist-spidra-test.invalid"
                    ],
                    "prompt": "Extract the book details",
                    "schema": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "price": {
                          "type": "number"
                        }
                      }
                    },
                    "wait": true
                  }
                },
                "popular_site": {
                  "summary": "Product data from Amazon",
                  "value": {
                    "urls": [
                      "https://www.amazon.com/dp/B0CG1LGWR6"
                    ],
                    "output": "json",
                    "wait": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Only with `wait: true` and up to 10 URLs. The batch finished within 45 seconds, and here it is in full.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BatchJob"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "schema_warnings": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Only when your `schema` uses keywords that are ignored, such as `anyOf`."
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "schema_wait": {
                    "summary": "Finished, one URL failed",
                    "value": {
                      "batchId": "38ae74ab-3a7f-421f-9d02-50c6b48d8c49",
                      "status": "completed",
                      "totalUrls": 3,
                      "completedCount": 2,
                      "failedCount": 1,
                      "items": [
                        {
                          "uuid": "f43aef75-1f51-455b-b4c0-bbd01c703f46",
                          "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                          "jobId": "12389b87-11da-4aad-ab47-218d07b08ccf",
                          "status": "completed",
                          "result": {
                            "title": "A Light in the Attic",
                            "price": 51.77
                          },
                          "error": null,
                          "creditsUsed": 2,
                          "startedAt": "2026-10-25T03:09:38.000Z",
                          "finishedAt": "2026-10-25T03:09:44.000Z",
                          "screenshotUrl": null
                        },
                        {
                          "uuid": "445691ac-b528-4368-85d8-3451f0fa8c75",
                          "url": "https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html",
                          "jobId": "41b0f1c0-119b-4875-9b39-a235fe95a140",
                          "status": "completed",
                          "result": {
                            "title": "Tipping the Velvet",
                            "price": 53.74
                          },
                          "error": null,
                          "creditsUsed": 2,
                          "startedAt": "2026-10-25T03:09:38.000Z",
                          "finishedAt": "2026-10-25T03:09:46.000Z",
                          "screenshotUrl": null
                        },
                        {
                          "uuid": "ac714786-f04e-44dc-8f83-2806e6d799ec",
                          "url": "https://this-domain-does-not-exist-spidra-test.invalid",
                          "jobId": "6dfa2214-0fdc-4d71-9c74-0776201741c4",
                          "status": "failed",
                          "result": null,
                          "error": "Failed to scrape https://this-domain-does-not-exist-spidra-test.invalid: the page could not be reached (ERR_TUNNEL_CONNECTION_FAILED)",
                          "creditsUsed": 0,
                          "startedAt": "2026-10-25T03:09:38.000Z",
                          "finishedAt": "2026-10-25T03:09:43.000Z",
                          "screenshotUrl": null
                        }
                      ],
                      "createdAt": "2026-10-25T03:09:37.000Z",
                      "finishedAt": "2026-10-25T03:09:45.000Z"
                    }
                  },
                  "popular_site": {
                    "summary": "Finished, Amazon product data",
                    "value": {
                      "batchId": "c9f6ea1c-d9e9-48f5-b4a8-acd81569b4ac",
                      "status": "completed",
                      "totalUrls": 1,
                      "completedCount": 1,
                      "failedCount": 0,
                      "items": [
                        {
                          "uuid": "73ffa6ce-e88d-4799-a8d1-8567605a9141",
                          "url": "https://www.amazon.com/dp/B0CG1LGWR6",
                          "jobId": "b917133c-b77f-4203-8b28-a814fdda84b9",
                          "status": "completed",
                          "result": {
                            "source": "amazon",
                            "type": "product",
                            "asin": "B0CG1LGWR6",
                            "title": "LISEN USB C to USB C Cable, 240W Fast Charging Type C Charger Cord (6.6FT)",
                            "brand": "LISEN",
                            "price": 8.97,
                            "currency": "USD",
                            "availability": "In Stock",
                            "rating": 4.5,
                            "ratingsCount": 12640,
                            "...": "..."
                          },
                          "structuredData": {
                            "source": "amazon",
                            "type": "product",
                            "asin": "B0CG1LGWR6",
                            "title": "LISEN USB C to USB C Cable, 240W Fast Charging Type C Charger Cord (6.6FT)",
                            "...": "..."
                          },
                          "error": null,
                          "creditsUsed": 1,
                          "startedAt": "2026-10-25T05:01:57.000Z",
                          "finishedAt": "2026-10-25T05:02:03.000Z",
                          "screenshotUrl": null
                        }
                      ],
                      "createdAt": "2026-10-25T05:01:57.000Z",
                      "finishedAt": "2026-10-25T05:02:03.000Z"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The batch was queued. Poll `GET /batch/scrape/{batchId}` for the results. The `Location` header holds the same path.",
            "headers": {
              "Location": {
                "description": "Where to poll, as `/api/batch/scrape/{batchId}`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "batchId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The batch's ID. Use it with `GET /batch/scrape/{batchId}`."
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many URLs were queued."
                    },
                    "schema_warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Only when your `schema` uses keywords that are ignored, such as `anyOf`. The batch still runs."
                    }
                  }
                },
                "example": {
                  "status": "queued",
                  "batchId": "dc1a12be-b028-4a46-8459-0a22ee472aef",
                  "total": 2
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue scraping.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "Your account doesn't have enough credits to hold 1 credit for every URL. Top up or upgrade, or send fewer URLs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You have exceeded your monthly credit limit."
                }
              }
            }
          },
          "422": {
            "description": "The request isn't valid. `errors` lists every problem, naming the URL by its position where it applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "bad_protocol": {
                    "summary": "Not http or https",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "URL 1: must use http or https protocol"
                      ]
                    }
                  },
                  "too_many_urls": {
                    "summary": "More than 50 URLs",
                    "value": {
                      "status": "error",
                      "message": "Maximum 50 URLs per batch. You provided 51.",
                      "errors": [
                        "Maximum 50 URLs per batch. You provided 51."
                      ]
                    }
                  },
                  "extra_fields": {
                    "summary": "A URL object with more than `url`",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "URL 1: batch items only accept \"url\" (got \"actions\"). Use POST /scrape for per-URL actions."
                      ]
                    }
                  },
                  "no_urls": {
                    "summary": "Empty list",
                    "value": {
                      "status": "error",
                      "message": "At least one URL is required.",
                      "errors": [
                        "At least one URL is required."
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Either more than 20 batches in a minute, or this batch would take you past 50 unfinished URLs across your batches and scrapes. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rate_limit": {
                    "summary": "More than 20 a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many batch job submissions. Please slow down and try again shortly."
                    }
                  },
                  "pending": {
                    "summary": "Too many unfinished URLs",
                    "value": {
                      "status": "error",
                      "message": "You have too many pending scrape jobs. Please wait for your current batch to complete before submitting more.",
                      "code": "TOO_MANY_PENDING_JOBS"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The batch couldn't be created. The credits held for it were returned. Send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to create batch job. Your credits have been refunded.",
                  "code": "BATCH_CREATE_FAILED"
                }
              }
            }
          },
          "503": {
            "description": "Spidra is at capacity. Wait `retry_after` seconds, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The scraping service is currently at capacity. Please retry in a few minutes.",
                  "code": "SERVICE_BUSY",
                  "retry_after": 60
                }
              }
            }
          }
        },
        "tags": [
          "Batch Scraping"
        ]
      },
      "get": {
        "summary": "List batches",
        "description": "Lists your batches, newest first, with their progress and the credits they've used. Items aren't included, so get them with [Get a batch](/api-reference/scraping/batch-scrape-status).\n\nThis endpoint has no rate limit.\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Batches per page, from 1 to 50. Higher values are capped at 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            },
            "example": 2
          }
        ],
        "responses": {
          "200": {
            "description": "One page of batches.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The batch's ID. Use it with `GET /batch/scrape/{batchId}`."
                          },
                          "status": {
                            "$ref": "#/components/schemas/BatchStatus"
                          },
                          "totalUrls": {
                            "type": "integer",
                            "description": "How many URLs the batch has."
                          },
                          "completedCount": {
                            "type": "integer",
                            "description": "How many URLs finished successfully."
                          },
                          "failedCount": {
                            "type": "integer",
                            "description": "How many URLs failed."
                          },
                          "outputFormat": {
                            "type": "string",
                            "enum": [
                              "markdown",
                              "json"
                            ],
                            "description": "The batch's `output`."
                          },
                          "scrapingChannel": {
                            "type": "string",
                            "enum": [
                              "api",
                              "playground"
                            ],
                            "description": "`api` when the batch was sent with an API key, `playground` when it was started from the dashboard."
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the batch was created."
                          },
                          "finishedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time",
                            "description": "When the batch finished or was cancelled."
                          },
                          "firstUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The batch's first URL, to help you recognize it."
                          },
                          "creditsUsed": {
                            "type": "integer",
                            "description": "Credits used across all its URLs so far."
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "description": "This page's number."
                        },
                        "limit": {
                          "type": "integer",
                          "description": "Batches per page."
                        },
                        "total": {
                          "type": "integer",
                          "description": "How many batches you have in all."
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "How many pages there are at this `limit`."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "jobs": [
                    {
                      "uuid": "38ae74ab-3a7f-421f-9d02-50c6b48d8c49",
                      "status": "running",
                      "totalUrls": 3,
                      "completedCount": 2,
                      "failedCount": 0,
                      "outputFormat": "json",
                      "scrapingChannel": "api",
                      "createdAt": "2026-10-25T03:09:37.000Z",
                      "finishedAt": null,
                      "firstUrl": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                      "creditsUsed": 4
                    },
                    {
                      "uuid": "7ebc7287-e3ea-4376-a2ea-4d4d4579902b",
                      "status": "completed",
                      "totalUrls": 1,
                      "completedCount": 1,
                      "failedCount": 0,
                      "outputFormat": "json",
                      "scrapingChannel": "api",
                      "createdAt": "2026-10-24T19:27:00.000Z",
                      "finishedAt": "2026-10-24T19:27:03.000Z",
                      "firstUrl": "https://www.producthunt.com/leaderboard/weekly/2026/42",
                      "creditsUsed": 1
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "limit": 2,
                    "total": 258,
                    "totalPages": 129
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "The list couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to retrieve batch jobs",
                  "code": "INTERNAL_ERROR"
                }
              }
            }
          }
        },
        "tags": [
          "Batch Scraping"
        ]
      }
    },
    "/batch/scrape/{batchId}": {
      "get": {
        "summary": "Get a batch",
        "description": "Returns a batch's progress and every item's status, result and cost. Poll every few seconds until `status` is `completed` or `cancelled`. Polling is free and has no rate limit.\n\nA `completed` batch can still have failed items. Check `failedCount`, read each failed item's `error`, and run them again with [Retry a batch](/api-reference/scraping/batch-scrape-retry).\n\nBatches are kept, so this keeps working after the batch has finished.\n",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "description": "The `batchId` returned by `POST /batch/scrape`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "38ae74ab-3a7f-421f-9d02-50c6b48d8c49"
          }
        ],
        "responses": {
          "200": {
            "description": "The batch with every item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchJob"
                },
                "examples": {
                  "completed": {
                    "summary": "Finished, one URL failed",
                    "value": {
                      "batchId": "38ae74ab-3a7f-421f-9d02-50c6b48d8c49",
                      "status": "completed",
                      "totalUrls": 3,
                      "completedCount": 2,
                      "failedCount": 1,
                      "items": [
                        {
                          "uuid": "f43aef75-1f51-455b-b4c0-bbd01c703f46",
                          "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
                          "jobId": "12389b87-11da-4aad-ab47-218d07b08ccf",
                          "status": "completed",
                          "result": {
                            "title": "A Light in the Attic",
                            "price": 51.77
                          },
                          "error": null,
                          "creditsUsed": 2,
                          "startedAt": "2026-10-25T03:09:38.000Z",
                          "finishedAt": "2026-10-25T03:09:44.000Z",
                          "screenshotUrl": null
                        },
                        {
                          "uuid": "445691ac-b528-4368-85d8-3451f0fa8c75",
                          "url": "https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html",
                          "jobId": "41b0f1c0-119b-4875-9b39-a235fe95a140",
                          "status": "completed",
                          "result": {
                            "title": "Tipping the Velvet",
                            "price": 53.74
                          },
                          "error": null,
                          "creditsUsed": 2,
                          "startedAt": "2026-10-25T03:09:38.000Z",
                          "finishedAt": "2026-10-25T03:09:46.000Z",
                          "screenshotUrl": null
                        },
                        {
                          "uuid": "ac714786-f04e-44dc-8f83-2806e6d799ec",
                          "url": "https://this-domain-does-not-exist-spidra-test.invalid",
                          "jobId": "6dfa2214-0fdc-4d71-9c74-0776201741c4",
                          "status": "failed",
                          "result": null,
                          "error": "Failed to scrape https://this-domain-does-not-exist-spidra-test.invalid: the page could not be reached (ERR_TUNNEL_CONNECTION_FAILED)",
                          "creditsUsed": 0,
                          "startedAt": "2026-10-25T03:09:38.000Z",
                          "finishedAt": "2026-10-25T03:09:43.000Z",
                          "screenshotUrl": null
                        }
                      ],
                      "createdAt": "2026-10-25T03:09:37.000Z",
                      "finishedAt": "2026-10-25T03:09:45.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no batch with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Batch scrape job not found.",
                  "code": "NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "The batch couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to retrieve batch status",
                  "code": "INTERNAL_ERROR"
                }
              }
            }
          }
        },
        "tags": [
          "Batch Scraping"
        ]
      },
      "delete": {
        "summary": "Cancel a batch",
        "description": "Cancels a batch. URLs that haven't started are stopped and the credits held for them are returned. URLs that already finished keep their results.\n\nCancelling is best effort. A URL that is running at that moment carries on and may still finish. A cancelled batch can't be retried, so start a new one instead.\n",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "description": "The `batchId` returned by `POST /batch/scrape`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "38ae74ab-3a7f-421f-9d02-50c6b48d8c49"
          }
        ],
        "responses": {
          "200": {
            "description": "The batch was cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "cancelled"
                      ]
                    },
                    "cancelledItems": {
                      "type": "integer",
                      "description": "How many URLs were stopped before they started."
                    },
                    "creditsRefunded": {
                      "type": "integer",
                      "description": "Credits returned for those URLs, 1 each."
                    }
                  }
                },
                "example": {
                  "status": "cancelled",
                  "cancelledItems": 0,
                  "creditsRefunded": 0
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no batch with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Batch scrape job not found."
                }
              }
            }
          },
          "409": {
            "description": "The batch has already finished or was already cancelled, so there's nothing to cancel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "completed": {
                    "summary": "Already finished",
                    "value": {
                      "status": "error",
                      "message": "Cannot cancel a batch that is already completed.",
                      "code": "ALREADY_TERMINAL"
                    }
                  },
                  "cancelled": {
                    "summary": "Already cancelled",
                    "value": {
                      "status": "error",
                      "message": "Cannot cancel a batch that is already cancelled.",
                      "code": "ALREADY_TERMINAL"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The batch couldn't be cancelled. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to cancel batch job",
                  "code": "INTERNAL_ERROR"
                }
              }
            }
          }
        },
        "tags": [
          "Batch Scraping"
        ]
      }
    },
    "/batch/scrape/{batchId}/retry": {
      "post": {
        "summary": "Retry a batch",
        "description": "Runs a batch's failed URLs again with the batch's original options, and leaves the rest alone. The batch goes back to `running`, so poll [Get a batch](/api-reference/scraping/batch-scrape-status) as before.\n\nCookies are never stored. If the batch used them, send them again in `cookies`. Without them, the retried URLs run logged out and the response has a `warnings` entry saying so.\n\n**Credits:** the same as the first run. 1 credit is held for each retried URL, and a URL that fails again costs nothing.\n\n**Rate limits:** no per-minute limit, but the retried URLs count toward your 50 unfinished URLs.\n",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "description": "The `batchId` returned by `POST /batch/scrape`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "38ae74ab-3a7f-421f-9d02-50c6b48d8c49"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cookies": {
                    "type": "string",
                    "description": "The cookies to send with the retried URLs, when the batch needed them. Either `name=value; name2=value2` or rows pasted from your browser's DevTools. Never stored."
                  }
                }
              },
              "examples": {
                "empty": {
                  "summary": "Retry with the original options",
                  "value": {}
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The failed URLs were queued again.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "retriedCount": {
                      "type": "integer",
                      "description": "How many failed URLs were queued again."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Only when the batch used cookies and you didn't send them again, so the retried URLs run logged out."
                    }
                  }
                },
                "examples": {
                  "queued": {
                    "summary": "Queued",
                    "value": {
                      "status": "queued",
                      "retriedCount": 1
                    }
                  },
                  "no_cookies": {
                    "summary": "Queued, without the batch's cookies",
                    "value": {
                      "status": "queued",
                      "retriedCount": 1,
                      "warnings": [
                        "This batch was sent with cookies, and cookies are never stored, so the retried URLs run logged out. Send \"cookies\" in the retry request to keep them signed in."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "None of the batch's URLs have failed, so there's nothing to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "No failed items to retry.",
                  "code": "NO_FAILED_ITEMS"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "Your account doesn't have enough credits to hold 1 credit for every retried URL. Top up or upgrade, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You have exceeded your monthly credit limit."
                }
              }
            }
          },
          "404": {
            "description": "There's no batch with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Batch scrape job not found."
                }
              }
            }
          },
          "409": {
            "description": "The batch was cancelled. Start a new batch instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "BATCH_CANCELLED",
                  "message": "This batch was cancelled. Start a new batch instead."
                }
              }
            }
          },
          "422": {
            "description": "`cookies` isn't a string.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "\"cookies\" must be a cookie string such as \"name=value; other=value\".",
                  "errors": [
                    "\"cookies\" must be a cookie string such as \"name=value; other=value\"."
                  ]
                }
              }
            }
          },
          "429": {
            "description": "The retried URLs would take you past 50 unfinished URLs across your batches and scrapes. Wait for some to finish, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "You have too many pending scrape jobs. Please wait for your current batch to complete before retrying.",
                  "code": "TOO_MANY_PENDING_JOBS"
                }
              }
            }
          },
          "500": {
            "description": "The URLs couldn't be queued again. The credits held for them were returned. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "requeue": {
                    "summary": "Couldn't queue the URLs",
                    "value": {
                      "status": "error",
                      "message": "Failed to retry items. Your credits have been refunded.",
                      "code": "RETRY_FAILED"
                    }
                  },
                  "other": {
                    "summary": "Something else went wrong",
                    "value": {
                      "status": "error",
                      "message": "Failed to retry batch items",
                      "code": "INTERNAL_ERROR"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Spidra is at capacity. Wait `retry_after` seconds, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The scraping service is currently at capacity. Please retry in a few minutes.",
                  "code": "SERVICE_BUSY",
                  "retry_after": 60
                }
              }
            }
          }
        },
        "tags": [
          "Batch Scraping"
        ]
      }
    },
    "/search": {
      "post": {
        "summary": "Search",
        "description": "Searches the web, news, images, videos, research papers or GitHub issues and pull requests, and returns a `jobId`. Poll [Get a search](/api-reference/search/search-status) until `status` is `completed` or `failed`. Guide: [Search](/search).\n\nWith `wait: true`, the request waits up to 20 seconds and answers `200` with the result. If the search takes longer, you get the usual `202` and poll. This works with `scrapeOptions` too, though reading pages often takes longer than 20 seconds.\n\n`limit` is a maximum per source, so 3 sources at 10 can return up to 30 results. A source that has fewer matches returns fewer. To get the next page of a source, send its token from `nextPageTokens` back as `pageTokens`. A source with no token has no more results. If you send the same search again within 5 seconds, you get the first job's `jobId` back with `deduplicated: true`.\n\n`safeSearch`, `language`, `startDate`/`endDate`, `sort` and `filetype` each work on some sources only. A source that can't apply one runs without it and the result says so in `warnings`. If none of the sources you asked for can apply it, you get `422`.\n\n**Credits:** 1 per 10 results per source, rounded up, so 20 web results cost 2 and 3 cost 1. A source with no results costs nothing. With `scrapeOptions`, each page read is billed as a scrape. The result's `creditsUsed` says what the search cost. See [How credits work](/billing/how-credits-work).\n\n**Rate limits:** 60 requests a minute, and up to 10 unfinished searches at a time.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "What to search for.",
                    "example": "best espresso machine"
                  },
                  "sources": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "web",
                        "news",
                        "images",
                        "videos",
                        "research",
                        "developer"
                      ]
                    },
                    "default": [
                      "web"
                    ],
                    "description": "Where to search. `research` returns academic papers and preprints, and `developer` returns GitHub issues and pull requests. Each source comes back as its own list."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20,
                    "default": 10,
                    "description": "The most results to return per source. A source can return fewer when it has fewer matches."
                  },
                  "page": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "default": 1,
                    "description": "Which page of results to return, so `page` 2 with `limit` 20 returns results 21 to 40. Once you have a result, prefer `pageTokens`, which continues the exact same result set and goes past page 5."
                  },
                  "pageTokens": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Tokens from an earlier result's `nextPageTokens`, keyed by source, such as `{ \"web\": \"v1....\" }`. Send the same query and options with them; you don't need `page`. A token that can't be used isn't an error: that source runs as a fresh search."
                  },
                  "country": {
                    "type": "string",
                    "description": "The country to search from, which changes which results you get. A two-letter code such as `us`, `gb` or `de`, or `global`, `eu` or `asia`.",
                    "example": "gb"
                  },
                  "timeRange": {
                    "type": "string",
                    "enum": [
                      "hour",
                      "day",
                      "week",
                      "month",
                      "year"
                    ],
                    "description": "Favor results from this recent period. `hour` works on web, news, images and videos. Can't be used with `startDate` or `endDate`."
                  },
                  "includeDomains": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return results from these domains, such as `[\"github.com\"]`. Can't be used with `excludeDomains`."
                  },
                  "excludeDomains": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    },
                    "description": "Leave out results from these domains. Can't be used with `includeDomains`."
                  },
                  "filetype": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "doc",
                      "docx",
                      "xls",
                      "xlsx",
                      "ppt",
                      "pptx",
                      "txt",
                      "csv",
                      "rtf",
                      "odt",
                      "ods",
                      "odp",
                      "epub"
                    ],
                    "description": "Only return web results that are files of this type. Every result is checked, so one of another type never comes back. Some queries have few such files, so expect fewer results."
                  },
                  "developerTypes": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "issues",
                        "repositories",
                        "users"
                      ]
                    },
                    "default": [
                      "issues"
                    ],
                    "description": "For the `developer` source, what to return, in this order. `issues` is GitHub issues and pull requests. Each type returns up to `limit` results into the same `developer` list."
                  },
                  "safeSearch": {
                    "type": "string",
                    "enum": [
                      "off",
                      "strict"
                    ],
                    "description": "`strict` filters adult results out of web, news, images and videos. `off`, the default, applies no filter."
                  },
                  "language": {
                    "type": "string",
                    "description": "Prefer pages in this language, separately from `country`. An ISO 639-1 code such as `de` or `fr`, or `zh-CN` or `zh-TW`. Works on web, news and videos. A query written in another language can still return some pages in that language.",
                    "example": "de"
                  },
                  "startDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Only results published on or after this date, as `YYYY-MM-DD`. Works on web, news and videos. Use with `endDate` or alone; not with `timeRange`.",
                    "example": "2024-03-01"
                  },
                  "endDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Only results published on or before this date, as `YYYY-MM-DD`.",
                    "example": "2024-03-31"
                  },
                  "sort": {
                    "type": "string",
                    "enum": [
                      "relevance",
                      "date"
                    ],
                    "default": "relevance",
                    "description": "`date` returns news newest first. News only."
                  },
                  "wait": {
                    "type": "boolean",
                    "default": false,
                    "description": "Waits up to 20 seconds and answers `200` with the result. If the search takes longer, you get `202` and poll as usual."
                  },
                  "scrapeOptions": {
                    "type": "object",
                    "required": [
                      "formats"
                    ],
                    "description": "Reads the top web results and adds each page's Markdown to its result as `markdown`. Only web results are read. The search takes as long as the slowest page, up to about two minutes.",
                    "properties": {
                      "formats": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "markdown"
                          ]
                        },
                        "description": "What to add to each result. Only `markdown` is supported."
                      },
                      "maxResults": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 20,
                        "description": "How many of the top web results to read. Without it, up to 10 are read."
                      }
                    }
                  }
                }
              },
              "examples": {
                "web_wait": {
                  "summary": "Web search, answered inline",
                  "value": {
                    "query": "best espresso machine",
                    "sources": [
                      "web"
                    ],
                    "limit": 3,
                    "wait": true
                  }
                },
                "language_and_dates": {
                  "summary": "German pages from one month",
                  "value": {
                    "query": "Olympia",
                    "limit": 10,
                    "language": "de",
                    "startDate": "2024-03-01",
                    "endDate": "2024-03-31"
                  }
                },
                "news_newest_first": {
                  "summary": "News, newest first, without adult results",
                  "value": {
                    "query": "electric vehicles",
                    "sources": [
                      "news"
                    ],
                    "sort": "date",
                    "safeSearch": "strict"
                  }
                },
                "multi_source": {
                  "summary": "News, research and GitHub at once",
                  "value": {
                    "query": "vector database",
                    "sources": [
                      "news",
                      "research",
                      "developer"
                    ],
                    "limit": 2,
                    "wait": true
                  }
                },
                "scrape_content": {
                  "summary": "Search and read the top result",
                  "value": {
                    "query": "how to redact data in posthog",
                    "sources": [
                      "web"
                    ],
                    "limit": 2,
                    "scrapeOptions": {
                      "formats": [
                        "markdown"
                      ],
                      "maxResults": 1
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Only with `wait: true`. The search finished within 20 seconds. `status` is `completed` with the result, or `failed` with the reason in `error`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed",
                        "failed"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The job's ID. Works with `GET /search/{jobId}` for the next hour."
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "A short status line."
                        },
                        "progress": {
                          "type": "number",
                          "description": "`1` when completed, `0` when failed."
                        }
                      }
                    },
                    "result": {
                      "description": "The result when `status` is `completed`, `null` otherwise.",
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/SearchResult"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why the search failed. `null` otherwise."
                    }
                  }
                },
                "example": {
                  "status": "completed",
                  "jobId": "b3629517-f38a-4827-8536-25dee8cad0ec",
                  "progress": {
                    "message": "Search completed successfully",
                    "progress": 1
                  },
                  "result": {
                    "success": true,
                    "data": {
                      "web": [
                        {
                          "title": "The 16 Best Espresso Machines of 2026, Tested & Reviewed",
                          "url": "https://www.seriouseats.com/best-espresso-machines-5185482",
                          "description": "We tested 41 home espresso machines to find which 16 pulled the best shots, steamed latte art-worthy microfoam, and were easy to use. We have top picks at all prices.",
                          "position": 1
                        },
                        {
                          "title": "Best Espresso Machines 2026 | Tested - Forbes Vetted",
                          "url": "https://www.forbes.com/sites/forbes-personal-shopper/article/best-espresso-machine/",
                          "description": "For devotees of handcrafted café beverages, investing in an espresso machine can save both time and money (particularly in the long run). ...",
                          "position": 2
                        },
                        {
                          "title": "The 7 best espresso machines you can buy in 2026 - Tom's Guide",
                          "url": "https://www.tomsguide.com/home/coffee-makers/best-espresso-machines",
                          "description": "Our editor-selected guide to the best espresso machines you can buy, and advice on finding the right one for you.",
                          "position": 3
                        }
                      ],
                      "nextPageTokens": {
                        "web": "v1.WsrkJb5NyTSUa0o5ESmXstp0yS4ES_TPYDeE7Bl7wNgf_wDV75yX8L5hUnXoANcQxXKPg-5LyY0OKsSnVPQM..."
                      }
                    },
                    "stats": {
                      "durationMs": 4015
                    },
                    "logUuid": "e5a1a64a-75ad-4db2-841e-9b9cd4597bf9"
                  },
                  "error": null
                }
              }
            }
          },
          "202": {
            "description": "The search was queued, or it was still running when the 20-second `wait` ran out. Poll `GET /search/{jobId}` for the result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The job's ID. Use it with `GET /search/{jobId}`."
                    },
                    "message": {
                      "type": "string",
                      "description": "Where to poll for the result."
                    },
                    "deduplicated": {
                      "type": "boolean",
                      "description": "`true` when the same search was sent in the last 5 seconds and this is that job's ID."
                    }
                  }
                },
                "examples": {
                  "queued": {
                    "summary": "Queued, still running after the wait",
                    "value": {
                      "status": "queued",
                      "jobId": "7ae18e2b-2953-45d8-9cea-5a246f367c2f",
                      "message": "Search job has been queued. Poll /api/search/7ae18e2b-2953-45d8-9cea-5a246f367c2f to get the result."
                    }
                  },
                  "scrape_content": {
                    "summary": "Queued, with scrapeOptions",
                    "value": {
                      "status": "queued",
                      "jobId": "08135670-12ca-442d-a48c-e83f0da437d7",
                      "message": "Search job has been queued. Poll /api/search/08135670-12ca-442d-a48c-e83f0da437d7 to get the result."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue searching.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "Either your account doesn't have enough credits for the most this search could cost (every source returning `limit` results), or search isn't turned on for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "credits": {
                    "summary": "Not enough credits",
                    "value": {
                      "status": "error",
                      "message": "You have exceeded your monthly credit limit."
                    }
                  },
                  "not_available": {
                    "summary": "Search not turned on for this account",
                    "value": {
                      "status": "error",
                      "message": "This feature isn't available on your account yet."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "The request isn't valid. `errors` lists every problem.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "query_and_limit": {
                    "summary": "Empty query and limit too high",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "\"query\" is required and must be a non-empty string.",
                        "\"limit\" must be an integer between 1 and 20."
                      ]
                    }
                  },
                  "bad_source": {
                    "summary": "Unknown source",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "\"sources\" contains invalid values: podcasts. Valid values: web, news, images, videos, research, developer."
                      ]
                    }
                  },
                  "option_not_supported": {
                    "summary": "An option none of the sources can apply",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "\"language\" works with web, news and videos results; none of the requested sources support it."
                      ]
                    }
                  },
                  "bad_dates": {
                    "summary": "A date range that ends before it starts",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "\"startDate\" must be on or before \"endDate\"."
                      ]
                    }
                  },
                  "both_domain_lists": {
                    "summary": "includeDomains and excludeDomains together",
                    "value": {
                      "status": "error",
                      "message": "Request validation failed. Fix the errors below and try again.",
                      "errors": [
                        "Use \"includeDomains\" or \"excludeDomains\", not both."
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Either more than 60 searches in a minute, or 10 searches already unfinished. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rate_limit": {
                    "summary": "More than 60 a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many job submissions. Please slow down and try again shortly."
                    }
                  },
                  "pending": {
                    "summary": "10 searches still running",
                    "value": {
                      "status": "error",
                      "message": "You have too many pending search jobs. Please wait for some to complete before submitting more.",
                      "code": "TOO_MANY_PENDING_JOBS"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Search is at capacity. Wait `retry_after` seconds, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The search service is currently at capacity. Please retry in a few minutes.",
                  "code": "SERVICE_BUSY",
                  "retry_after": 30
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/search/{jobId}": {
      "get": {
        "summary": "Get a search",
        "description": "Returns a search's status and, once it has finished, its results. Poll every 2 to 5 seconds until `status` is `completed` or `failed`. Polling is free and has no rate limit.\n\nA search that found nothing still completes, with `success: false` and empty lists, and costs nothing. A failed or cancelled search answers `200` with `status: \"failed\"` and the reason in `error`, and you aren't charged.\n\nA finished search stays here for about an hour, and a failed one for 24 hours. After that this returns `404`, and the search is still in your [search logs](/api-reference/search/search-logs).\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` returned by `POST /search`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "7ae18e2b-2953-45d8-9cea-5a246f367c2f"
          }
        ],
        "responses": {
          "200": {
            "description": "The search's status, and its result once it has finished.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "$ref": "#/components/schemas/JobStatus"
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "What the search is doing, such as `\"Fetching page content... (1/2)\"`."
                        },
                        "progress": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1,
                          "description": "How far along the search is, from 0 to 1."
                        }
                      }
                    },
                    "result": {
                      "description": "The result once `status` is `completed`. `null` before that.",
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/SearchResult"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why the search failed once `status` is `failed`, such as `\"Search cancelled\"`. `null` otherwise."
                    }
                  }
                },
                "examples": {
                  "multi_source": {
                    "summary": "Finished, news, research and GitHub",
                    "value": {
                      "status": "completed",
                      "progress": {
                        "message": "Search completed successfully",
                        "progress": 1
                      },
                      "result": {
                        "success": true,
                        "data": {
                          "news": [
                            {
                              "title": "VCs are obsessed with vector databases. Here are seven AI startups in the space that have raised millions from investors.",
                              "url": "https://www.businessinsider.com/seven-vector-database-startups-poised-to-win-ai-revolution-2024-4",
                              "description": "Vector databases don&#x27;t get as much love as their flashier counterparts ...",
                              "source": "Business Insider",
                              "date": "3 years ago",
                              "position": 1
                            }
                          ],
                          "research": [
                            {
                              "title": "BioVDB: biological vector database for high-throughput gene expression meta-analysis.",
                              "url": "https://doi.org/10.3389/frai.2024.1366273",
                              "description": "High-throughput sequencing has created an exponential increase in the amount of gene expression data ...",
                              "date": "2024-03-08",
                              "source": "PubMed",
                              "authors": "Winnicki MJ, Brown CA, Porter HL, Giles CB, Wren JD.",
                              "doi": "10.3389/frai.2024.1366273",
                              "position": 1
                            }
                          ],
                          "developer": [
                            {
                              "title": "PR: feat(vector-db): add Qdrant vector database support (#273)",
                              "url": "https://github.com/arakoodev/EdgeChains/pull/706",
                              "description": "[arakoodev/EdgeChains] (open) ### Summary Adds native support for Qdrant vector database in EdgeChains JavaScript SDK ...",
                              "date": "2026-10-23T18:27:57Z",
                              "source": "GitHub",
                              "authors": "EverVio",
                              "position": 1
                            }
                          ],
                          "nextPageTokens": {
                            "news": "v1.VUzJypAoYmbNxbMXHm6thxeI-fh1K03YfG2sDRSpPMUkca0e1s7XH51ago1JorLtdr1Y...",
                            "research": "v1.7Z_R06S8ieWzHJGARfWbvv1lRZ7JsGK7ZG6ZYzdCp-8AQYw3lBHqRSWN6rIFPq_Eso...",
                            "developer": "v1.SETjbw0J45NTTGqGPawGMXr7JL9d0uzIfW6nq4fZrIXUF1vb_9oHTi4hwi0VgCTqPP3j..."
                          }
                        },
                        "stats": {
                          "durationMs": 20019
                        },
                        "logUuid": "6ec30fde-ea19-45cf-8c88-10f2c41d5cae"
                      },
                      "error": null
                    }
                  },
                  "scrape_content": {
                    "summary": "Finished, with page content",
                    "value": {
                      "status": "completed",
                      "progress": {
                        "message": "Search completed successfully",
                        "progress": 1
                      },
                      "result": {
                        "success": true,
                        "data": {
                          "web": [
                            {
                              "title": "How to redact event data before it is sent to PostHog - PostHog",
                              "url": "https://posthog.com/tutorials/web-redact-properties",
                              "description": "PostHog will use the client IP address found during an event capture request if an $ip isn't passed through event.properties. ...",
                              "position": 1,
                              "markdown": "# How to redact event data before it is sent to PostHog\n\n* [!Vincent Ge](/community/profiles/34100)\n\nMay 29, 2025\n\n..."
                            },
                            {
                              "title": "Tutorials - Data management - PostHog",
                              "url": "https://posthog.com/tutorials/categories/data-management",
                              "description": "How to redact event data before it is sent to PostHog.A non-technical guide to understanding data in PostHog. ...",
                              "position": 2
                            }
                          ],
                          "nextPageTokens": {
                            "web": "v1.aVSFo21dizh0cI4pcsiZccigr7JalXPxiCTixRqL01jLBTAJ8J3SEXg8BBWKeb3L362L..."
                          }
                        },
                        "stats": {
                          "durationMs": 10932
                        },
                        "logUuid": "d25aa3b9-4f5c-46e4-be90-02334ea5bda5"
                      },
                      "error": null
                    }
                  },
                  "cancelled": {
                    "summary": "Cancelled",
                    "value": {
                      "status": "failed",
                      "progress": {
                        "message": "Search cancelled",
                        "progress": 0
                      },
                      "result": null,
                      "error": "Search cancelled"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The search belongs to another account, or search isn't turned on for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "forbidden": {
                    "summary": "Another account's search",
                    "value": {
                      "status": "error",
                      "message": "You do not have permission to access this job.",
                      "code": "FORBIDDEN"
                    }
                  },
                  "not_available": {
                    "summary": "Search not turned on for this account",
                    "value": {
                      "status": "error",
                      "message": "This feature isn't available on your account yet."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "There's no search with this ID, or it finished more than an hour ago (24 hours for a failed one).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Search job not found",
                  "code": "JOB_NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "The search couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to retrieve job status",
                  "code": "INTERNAL_ERROR"
                }
              }
            }
          },
          "503": {
            "description": "The job queue is briefly unavailable. Try again in a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Job queue temporarily unavailable. Please try again.",
                  "code": "QUEUE_UNAVAILABLE"
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      },
      "delete": {
        "summary": "Cancel a search",
        "description": "Cancels a search. A search that hasn't started is removed straight away and its held credits are returned.\n\nA running search can't be stopped instantly. It stops at its next checkpoint and then reports `status: \"failed\"` with `error: \"Search cancelled\"`, and the response's `message` says so. If it had already finished searching, it completes normally and is charged. Check [Get a search](/api-reference/search/search-status) for the final state.\n\nMost searches finish in seconds, so this matters mostly for searches with `scrapeOptions`.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` returned by `POST /search`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "08135670-12ca-442d-a48c-e83f0da437d7"
          }
        ],
        "responses": {
          "200": {
            "description": "The search was cancelled, or, if it was running, cancelling was requested.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "cancelled"
                      ]
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The search's ID."
                    },
                    "message": {
                      "type": "string",
                      "description": "Only when the search was already running. Says that it stops at its next checkpoint."
                    }
                  }
                },
                "examples": {
                  "queued": {
                    "summary": "Cancelled before it started",
                    "value": {
                      "status": "cancelled",
                      "jobId": "08135670-12ca-442d-a48c-e83f0da437d7"
                    }
                  },
                  "running": {
                    "summary": "Cancelling requested while running",
                    "value": {
                      "status": "cancelled",
                      "jobId": "09130a7c-c861-46b0-b3bd-86e74addff9c",
                      "message": "This search was already running, so cancellation was requested. It stops at its next checkpoint and then reports status \"failed\" with \"Search cancelled\". If it had already finished searching it completes normally. Check GET /api/search/{jobId} for the final state."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The search has already finished, so there's nothing to cancel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "completed": {
                    "summary": "Already completed",
                    "value": {
                      "status": "error",
                      "message": "Cannot cancel a job that has already completed."
                    }
                  },
                  "failed": {
                    "summary": "Already failed",
                    "value": {
                      "status": "error",
                      "message": "Cannot cancel a job that has already failed."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The search belongs to another account, or search isn't turned on for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "forbidden": {
                    "summary": "Another account's search",
                    "value": {
                      "status": "error",
                      "message": "You do not have permission to access this job.",
                      "code": "FORBIDDEN"
                    }
                  },
                  "not_available": {
                    "summary": "Search not turned on for this account",
                    "value": {
                      "status": "error",
                      "message": "This feature isn't available on your account yet."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "There's no search with this ID, or it finished more than an hour ago.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Search job not found",
                  "code": "JOB_NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "The search couldn't be cancelled. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to cancel search job"
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/search-logs": {
      "get": {
        "summary": "List search logs",
        "description": "Lists your past searches, newest first, with their settings, results and credits. Logs are kept after the search job itself expires, so this is where to find older results.\n\nFurther pages you loaded with `pageTokens` are folded into the first page's log, so each search appears once. Logs use snake_case field names, and a log's `uuid` isn't the search's `jobId`.\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Logs per page, from 1 to 100. Higher values are capped at 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only return logs with this status. `all` returns every status.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "success",
                "error",
                "in_progress",
                "cancelled"
              ]
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Only return searches whose query contains this text.",
            "schema": {
              "type": "string"
            },
            "example": "espresso"
          },
          {
            "name": "dateStart",
            "in": "query",
            "description": "Only return searches started at or after this date, such as `2026-10-01`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateEnd",
            "in": "query",
            "description": "Only return searches started at or before this date, such as `2026-10-31`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of search logs and the total that match.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "logs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SearchLogSummary"
                          },
                          "description": "The logs on this page."
                        },
                        "total": {
                          "type": "integer",
                          "description": "How many logs match the filters in all."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "logs": [
                      {
                        "uuid": "e6e7bea9-99ab-49a5-968a-6895f1ed0af8",
                        "status": "success",
                        "started_at": "2026-10-25T03:21:36.000Z",
                        "finished_at": "2026-10-25T03:21:40.000Z",
                        "query": "best espresso machine",
                        "sources": "web",
                        "country": null,
                        "include_domains": null,
                        "exclude_domains": null,
                        "scrape_content_enabled": 0,
                        "scrape_max_results": null,
                        "result_limit": 3,
                        "page": 1,
                        "time_range": null,
                        "filetype": null,
                        "result_data": {
                          "web": [
                            {
                              "title": "The 16 Best Espresso Machines of 2026, Tested & Reviewed",
                              "url": "https://www.seriouseats.com/best-espresso-machines-5185482",
                              "description": "We tested 41 home espresso machines to find which 16 pulled the best shots ...",
                              "position": 1
                            },
                            "..."
                          ]
                        },
                        "error_message": null,
                        "latency_ms": 3428,
                        "credits_used": 1,
                        "scraping_channel": "api"
                      }
                    ],
                    "total": 244
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "The logs couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Something went wrong loading this. Try again."
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/search-logs/{uuid}": {
      "get": {
        "summary": "Get a search log",
        "description": "Returns one past search with its settings, results and credits. Further pages you loaded with `pageTokens` are merged into the first page's log, and opening a further page's log returns that same merged view.\n",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "The log's `uuid` from [List search logs](/api-reference/search/search-logs), or the `logUuid` from a search result. Not the search's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e6e7bea9-99ab-49a5-968a-6895f1ed0af8"
          }
        ],
        "responses": {
          "200": {
            "description": "The search log.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/SearchLogDetail"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "id": 327,
                    "uuid": "e6e7bea9-99ab-49a5-968a-6895f1ed0af8",
                    "parent_uuid": null,
                    "user_uuid": "4aeefb9f-30c3-41fb-886a-10245923dc31",
                    "status": "success",
                    "started_at": "2026-10-25T03:21:36.000Z",
                    "finished_at": "2026-10-25T03:21:40.000Z",
                    "query": "best espresso machine",
                    "sources": "web",
                    "country": null,
                    "include_domains": null,
                    "exclude_domains": null,
                    "scrape_content_enabled": 0,
                    "scrape_max_results": null,
                    "result_limit": 3,
                    "page": 1,
                    "time_range": null,
                    "filetype": null,
                    "result_data": {
                      "web": [
                        {
                          "title": "The 16 Best Espresso Machines of 2026, Tested & Reviewed",
                          "url": "https://www.seriouseats.com/best-espresso-machines-5185482",
                          "description": "We tested 41 home espresso machines to find which 16 pulled the best shots ...",
                          "position": 1
                        },
                        {
                          "title": "Best Espresso Machines 2026 | Tested - Forbes Vetted",
                          "url": "https://www.forbes.com/sites/forbes-personal-shopper/article/best-espresso-machine/",
                          "description": "For devotees of handcrafted café beverages, investing in an espresso machine can save both time and money ...",
                          "position": 2
                        },
                        {
                          "title": "The 10 Best Espresso Machines of 2026, Tested & Reviewed",
                          "url": "https://www.foodandwine.com/lifestyle/kitchen/best-espresso-machines",
                          "description": "The 10 Best Espresso Machines for Every Type of Coffee Drinker, According to Our Tests ...",
                          "position": 3
                        }
                      ]
                    },
                    "error_message": null,
                    "latency_ms": 3428,
                    "credits_used": 1,
                    "scraping_channel": "api",
                    "created_at": "2026-10-25T03:21:36.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no search log with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Search log not found"
                }
              }
            }
          },
          "500": {
            "description": "The log couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Something went wrong loading this. Try again."
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/crawl/{jobId}/report": {
      "get": {
        "summary": "Get a crawl report",
        "description": "Returns how a crawl understood its instruction, how many pages it read only to find the ones it returned, and every link it skipped with the reason. Use it when a crawl returned fewer pages than you expected.\n\n`report` is `null` while the crawl runs, and for crawls run before reports existed. Up to 2,000 skipped links are kept per crawl. Filter them with `reason` and page through them with `limit` and `offset`. The reasons are explained in the [Crawl guide](/crawl#why-a-page-wasnt-returned).\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The crawl's `jobId`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "e303fb87-846e-4a30-8aa5-bfca457a5357"
          },
          {
            "name": "reason",
            "in": "query",
            "description": "Only list skipped links with this reason.",
            "schema": {
              "type": "string",
              "enum": [
                "not_relevant",
                "outside_start_path",
                "outside_domain",
                "include_pattern",
                "exclude_pattern",
                "file_type",
                "other_version_or_language",
                "duplicate_page",
                "redirected_off_site",
                "robots_txt",
                "action_link"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Skipped links per call, from 1 to 2,000.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000,
              "default": 200
            },
            "example": 2
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many skipped links to skip.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The crawl's report, or `null` with a `message` when there isn't one yet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "report": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "understoodAs": {
                          "type": "string",
                          "description": "The kind of page the crawl looked for. If it isn't what you meant, reword `crawlInstruction`."
                        },
                        "navigationPages": {
                          "type": "integer",
                          "description": "Pages read only to find the returned ones. Not charged."
                        },
                        "skippedTotal": {
                          "type": "integer",
                          "description": "How many links were skipped in all."
                        },
                        "skipped": {
                          "type": "array",
                          "description": "Skipped links grouped by reason.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "reason": {
                                "type": "string",
                                "description": "The reason code."
                              },
                              "count": {
                                "type": "integer",
                                "description": "How many links were skipped for it."
                              },
                              "description": {
                                "type": "string",
                                "description": "What the reason means."
                              }
                            }
                          }
                        },
                        "skippedUrls": {
                          "type": "array",
                          "description": "The skipped links in this batch.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "The skipped link."
                              },
                              "reason": {
                                "type": "string",
                                "description": "Why it was skipped."
                              },
                              "foundOn": {
                                "type": "string",
                                "description": "The page it was found on."
                              }
                            }
                          }
                        },
                        "skippedUrlsTotal": {
                          "type": "integer",
                          "description": "How many skipped links match `reason`, for paging."
                        }
                      }
                    },
                    "message": {
                      "type": "string",
                      "description": "Only when `report` is `null`. Says why."
                    }
                  }
                },
                "examples": {
                  "report": {
                    "summary": "A finished crawl",
                    "value": {
                      "status": "success",
                      "report": {
                        "understoodAs": "Individual book detail pages in the mystery category.",
                        "navigationPages": 1,
                        "skippedTotal": 60,
                        "skipped": [
                          {
                            "reason": "not_relevant",
                            "count": 60,
                            "description": "Didn't match the crawl instruction"
                          }
                        ],
                        "skippedUrls": [
                          {
                            "url": "https://books.toscrape.com/index.html",
                            "reason": "not_relevant",
                            "foundOn": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html"
                          },
                          {
                            "url": "https://books.toscrape.com/catalogue/category/books_1/index.html",
                            "reason": "not_relevant",
                            "foundOn": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html"
                          }
                        ],
                        "skippedUrlsTotal": 60
                      }
                    }
                  },
                  "running": {
                    "summary": "Still running",
                    "value": {
                      "status": "success",
                      "report": null,
                      "message": "The report is written when the crawl finishes."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no crawl with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Crawl job not found",
                  "error": "Crawl job not found"
                }
              }
            }
          },
          "500": {
            "description": "The report couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to load the crawl report",
                  "error": "Failed to load the crawl report"
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/map": {
      "post": {
        "summary": "Map",
        "description": "Lists a website's page URLs without scraping them, optionally ranked by how well they match a search. It answers in the same request, so there's no job to poll. Guide: [Map](/map).\n\nURLs come from the site's sitemaps and from the links on its pages. Without `search`, current pages come before older versions and translations. With `search`, only matching URLs come back, best matches first. A map that takes longer than 45 seconds fails with `502`.\n\nEvery call is recorded in your [map logs](/api-reference/logs/map-logs).\n\n**Credits:** 1 per call. A map that finds no URLs, or fails, costs nothing.\n\n**Rate limits:** 60 requests a minute.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The site to map, starting with `http://` or `https://`. Usually the home page or a section such as `https://docs.python.org/3/`. Private and internal addresses are rejected.",
                    "example": "https://docs.python.org/3/"
                  },
                  "search": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Only return URLs related to this text, best matches first. Matches the link text and the URL.",
                    "example": "asyncio"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000,
                    "default": 500,
                    "description": "The most URLs to return. `total` still counts every match."
                  },
                  "sitemap": {
                    "type": "string",
                    "enum": [
                      "include",
                      "skip",
                      "only"
                    ],
                    "default": "include",
                    "description": "`include` reads the sitemaps and the links on the site's pages, which finds the most. `skip` reads only page links. `only` reads only the sitemaps, which is fastest."
                  },
                  "includeSubdomains": {
                    "type": "boolean",
                    "default": false,
                    "description": "Also returns URLs on the site's subdomains, such as `blog.example.com` for `example.com`."
                  },
                  "ignoreQueryParams": {
                    "type": "boolean",
                    "default": true,
                    "description": "Treats URLs that differ only by their query string as one URL."
                  },
                  "respectRobots": {
                    "type": "boolean",
                    "default": false,
                    "description": "Leaves out URLs the site's `robots.txt` asks crawlers not to visit."
                  },
                  "cookies": {
                    "type": "string",
                    "description": "Cookies from your own signed-in browser session, as `name=value; name2=value2`, to map pages that need an account. Never stored."
                  }
                }
              },
              "examples": {
                "search": {
                  "summary": "URLs about a topic",
                  "value": {
                    "url": "https://docs.python.org/3/",
                    "search": "asyncio",
                    "limit": 20
                  }
                },
                "page_links_only": {
                  "summary": "Page links only, no sitemap",
                  "value": {
                    "url": "https://docs.python.org/3/",
                    "search": "asyncio",
                    "limit": 20,
                    "sitemap": "skip"
                  }
                },
                "sitemap_only": {
                  "summary": "What the sitemap lists",
                  "value": {
                    "url": "https://docs.python.org/3/",
                    "sitemap": "only"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The map finished. `links` is empty, with a `message` saying why, when no URLs were found. You aren't charged then.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "links": {
                      "type": "array",
                      "description": "The URLs, best matches first with `search`, up to `limit`.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "description": "The page's URL."
                          },
                          "title": {
                            "type": "string",
                            "description": "The text of the link it was found with. Missing for URLs that only came from a sitemap."
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many URLs matched the search, or how many were found without one. Can be more than `links` holds when it's capped by `limit`."
                    },
                    "scanned": {
                      "type": "integer",
                      "description": "Every URL found on the site, before the search filter. Missing when no URLs were found."
                    },
                    "sources": {
                      "type": "object",
                      "description": "Where the URLs came from.",
                      "properties": {
                        "sitemap": {
                          "type": "integer",
                          "description": "URLs found in the site's sitemaps."
                        },
                        "pages": {
                          "type": "integer",
                          "description": "URLs found in the links on its pages."
                        }
                      }
                    },
                    "creditsUsed": {
                      "type": "integer",
                      "description": "`1`, or `0` when no URLs were found."
                    },
                    "message": {
                      "type": "string",
                      "description": "Only when no URLs were found. Says why and what to try."
                    },
                    "durationMs": {
                      "type": "integer",
                      "description": "How long the map took, in milliseconds."
                    }
                  }
                },
                "examples": {
                  "search": {
                    "summary": "URLs about a topic",
                    "value": {
                      "status": "success",
                      "links": [
                        {
                          "url": "https://docs.python.org/3/library/asyncio.html",
                          "title": "asyncio"
                        },
                        {
                          "url": "https://docs.python.org/3/library/asyncio-threading.html",
                          "title": "asyncio and free-threaded Python"
                        },
                        {
                          "url": "https://docs.python.org/3/howto/a-conceptual-overview-of-asyncio.html",
                          "title": "A conceptual overview of asyncio"
                        },
                        "..."
                      ],
                      "total": 21,
                      "scanned": 595,
                      "sources": {
                        "sitemap": 7,
                        "pages": 588
                      },
                      "creditsUsed": 1,
                      "durationMs": 9552
                    }
                  },
                  "page_links_only": {
                    "summary": "Page links only",
                    "value": {
                      "status": "success",
                      "links": [
                        {
                          "url": "https://docs.python.org/3/library/asyncio.html",
                          "title": "asyncio"
                        },
                        {
                          "url": "https://docs.python.org/3/library/asyncio-threading.html",
                          "title": "asyncio and free-threaded Python"
                        },
                        {
                          "url": "https://docs.python.org/3/howto/a-conceptual-overview-of-asyncio.html",
                          "title": "A conceptual overview of asyncio"
                        },
                        "..."
                      ],
                      "total": 21,
                      "scanned": 595,
                      "sources": {
                        "sitemap": 0,
                        "pages": 595
                      },
                      "creditsUsed": 1,
                      "durationMs": 7337
                    }
                  },
                  "sitemap_only": {
                    "summary": "What the sitemap lists",
                    "value": {
                      "status": "success",
                      "links": [
                        {
                          "url": "https://docs.python.org/3/"
                        },
                        {
                          "url": "https://docs.python.org/3.11/"
                        },
                        {
                          "url": "https://docs.python.org/3.12/"
                        },
                        "..."
                      ],
                      "total": 7,
                      "scanned": 7,
                      "sources": {
                        "sitemap": 7,
                        "pages": 0
                      },
                      "creditsUsed": 1,
                      "durationMs": 24
                    }
                  },
                  "no_match": {
                    "summary": "Nothing matched the search",
                    "value": {
                      "status": "success",
                      "links": [],
                      "total": 0,
                      "sources": {
                        "sitemap": 7,
                        "pages": 0
                      },
                      "creditsUsed": 0,
                      "message": "No URLs on this site matched your search.",
                      "durationMs": 39
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/CreditLimit"
          },
          "422": {
            "description": "The request isn't valid. `errors` lists every problem.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing_url": {
                    "summary": "No URL and limit too high",
                    "value": {
                      "status": "error",
                      "message": "\"url\" is required.",
                      "errors": [
                        "\"url\" is required.",
                        "\"limit\" must be an integer between 1 and 5000."
                      ]
                    }
                  },
                  "bad_sitemap": {
                    "summary": "Unknown sitemap value",
                    "value": {
                      "status": "error",
                      "message": "\"sitemap\" must be \"include\", \"skip\" or \"only\".",
                      "errors": [
                        "\"sitemap\" must be \"include\", \"skip\" or \"only\"."
                      ]
                    }
                  },
                  "private_url": {
                    "summary": "A private address",
                    "value": {
                      "status": "error",
                      "message": "private and internal URLs are not allowed",
                      "errors": [
                        "private and internal URLs are not allowed"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 60 maps in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many map requests. Please slow down and try again shortly."
                }
              }
            }
          },
          "502": {
            "description": "The site couldn't be mapped, most often because it took longer than 45 seconds. You aren't charged. Try again, or use `sitemap` `only`, which is faster.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "creditsUsed": {
                          "type": "integer",
                          "description": "Always `0`."
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "status": "error",
                  "message": "The site took too long to map. Try again, or use sitemap: \"only\".",
                  "creditsUsed": 0
                }
              }
            }
          }
        },
        "tags": [
          "Crawling"
        ]
      }
    },
    "/parse": {
      "post": {
        "summary": "Parse",
        "description": "Turns one document into Markdown, and into JSON when you send a `prompt` or `schema`. Send exactly one source: a link in `url`, an upload in `file` (multipart), or the `fileId` of a document you've already sent. PDF, Word, Excel, PowerPoint, OpenDocument, RTF, EPUB, CSV and HTML files work. See [List formats](/api-reference/parse/parse-formats) and the [Parse guide](/parse).\n\nThe request waits up to 20 seconds. If the document is done by then, you get the result with `200`. If not, or if you send `wait: false`, you get `202` with a `jobId` to poll at [Get a parse job](/api-reference/parse/parse-status). A document that can't be parsed answers `200` with `status: \"failed\"` and the reason in `error`.\n\nUploads and links can be up to 50 MB. For bigger files, up to 500 MB, use [Prepare a large upload](/api-reference/parse/parse-uploads). One request parses up to 2,000 pages; use `pages` or `maxPages` for longer PDFs. Every document is stored for 24 hours under its `fileId`, so you can parse it again with other options, then deleted.\n\n**Credits:** 1 per page parsed, plus AI credits for the tokens used when you send a `prompt` or `schema`. Formats without pages count one page per 3,000 characters of text. Pages that can't be read and failed documents cost nothing. `dryRun: true` tells you the cost for free. See [How credits work](/billing/how-credits-work).\n\n**Rate limits:** 60 parse requests a minute, shared with `POST /parse/batch` and `POST /parse/uploads`.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "A link to the document, starting with `http://` or `https://`. Links to private or internal addresses aren't allowed. Send this, `fileId` or a `file` upload, not more than one.",
                        "example": "https://arxiv.org/pdf/1706.03762"
                      },
                      "fileId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The `fileId` of a document you parsed, estimated or uploaded in the last 24 hours. It isn't downloaded or uploaded again.",
                        "example": "0b007010-b3f6-4398-a3ba-e5c2518839c8"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/ParseOptions"
                  }
                ]
              },
              "examples": {
                "link": {
                  "summary": "Parse a link",
                  "value": {
                    "url": "https://arxiv.org/pdf/1706.03762",
                    "maxPages": 3
                  }
                },
                "extract": {
                  "summary": "Extract fields with a schema",
                  "value": {
                    "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
                    "pages": "1",
                    "prompt": "The paper's title and the authors' names",
                    "schema": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "estimate": {
                  "summary": "Estimate the cost first",
                  "value": {
                    "url": "https://arxiv.org/pdf/1706.03762",
                    "pages": "2-3",
                    "dryRun": true
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The document, up to 50 MB."
                  },
                  "options": {
                    "type": "string",
                    "description": "All the options as one JSON string, such as `{\"pages\":\"1-5\"}`. You can send each option as its own form field instead."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "fast",
                      "ocr"
                    ],
                    "default": "auto",
                    "description": "How pages are read. See `mode` in the JSON body."
                  },
                  "pages": {
                    "type": "string",
                    "description": "PDF pages to parse, such as `1-5,9`."
                  },
                  "maxPages": {
                    "type": "integer",
                    "description": "Parse at most this many pages."
                  },
                  "includePages": {
                    "type": "boolean",
                    "description": "Adds `pages` to the result."
                  },
                  "pageMarkers": {
                    "type": "boolean",
                    "description": "Puts a `<!-- page N -->` line before each page."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "What to extract, in plain English."
                  },
                  "schema": {
                    "type": "string",
                    "description": "A JSON Schema for the extracted data, as a JSON string."
                  },
                  "dryRun": {
                    "type": "boolean",
                    "description": "Returns the cost without parsing."
                  },
                  "wait": {
                    "type": "boolean",
                    "description": "Set to `false` to get a job to poll straight away."
                  }
                }
              },
              "examples": {
                "upload": {
                  "summary": "Upload a file",
                  "value": {
                    "file": "1706.03762.pdf",
                    "options": "{\"pages\":\"1-3\"}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The document finished within 20 seconds (`status` is `completed` or `failed`), or `dryRun` was `true` and this is the estimate.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ParseJob"
                    },
                    {
                      "$ref": "#/components/schemas/ParseEstimate"
                    }
                  ]
                },
                "examples": {
                  "completed": {
                    "summary": "Finished",
                    "value": {
                      "jobId": "c5a8d5a2-b10e-44f5-8c9e-dbbd334d19d1",
                      "status": "completed",
                      "fileName": "1706.03762",
                      "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                      "fileId": "29273629-c557-4ac8-9e36-14fb96b1018d",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesParsed": 3,
                      "creditsUsed": 3,
                      "markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\nreproduce the tables and figures in this paper solely for use in journalistic or scholarly works.\n\n## Attention Is All You Need\n\n...",
                      "warnings": [],
                      "metadata": {
                        "fileName": "1706.03762",
                        "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                        "format": "pdf",
                        "totalPages": 15,
                        "pagesParsed": 3,
                        "ocrPages": 0
                      },
                      "durationMs": 1005
                    }
                  },
                  "extracted": {
                    "summary": "Finished, with extraction",
                    "value": {
                      "jobId": "58eaa06c-d540-4d28-aadf-3c2722b20ab6",
                      "status": "completed",
                      "fileName": "1706.03762",
                      "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                      "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesParsed": 1,
                      "creditsUsed": 2,
                      "markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
                      "json": {
                        "title": "Attention Is All You Need",
                        "authors": [
                          "Ashish Vaswani",
                          "Noam Shazeer",
                          "Niki Parmar",
                          "..."
                        ]
                      },
                      "warnings": [],
                      "metadata": {
                        "fileName": "1706.03762",
                        "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                        "format": "pdf",
                        "totalPages": 15,
                        "pagesParsed": 1,
                        "ocrPages": 0
                      },
                      "durationMs": 1289
                    }
                  },
                  "estimate": {
                    "summary": "Estimate (dryRun)",
                    "value": {
                      "status": "estimate",
                      "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
                      "fileName": "1706.03762",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesToParse": 2,
                      "credits": 2
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The document is still being parsed after 20 seconds, or you sent `wait: false`. Poll `GET /parse/{jobId}` for the result.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ParseJob"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "How many pages are being parsed and where to poll."
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "jobId": "65245c0c-3f99-4805-bfe1-6a1c91b45478",
                  "status": "queued",
                  "fileName": "1706.03762",
                  "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                  "fileId": "df4dd604-5f72-4f54-9873-5fd1b90b66cd",
                  "format": "PDF",
                  "totalPages": 15,
                  "pagesParsed": null,
                  "creditsUsed": 0,
                  "message": "Parsing 1 page. Poll /api/parse/65245c0c-3f99-4805-bfe1-6a1c91b45478 for the result."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "description": "The account doesn't have enough credits for the pages to parse. `creditsNeeded` says how many it would take. Parse fewer pages, or top up and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "creditsNeeded": {
                          "type": "integer",
                          "description": "The page credits this parse needs."
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "status": "error",
                  "message": "You don't have enough credits to parse this document.",
                  "creditsNeeded": 15
                }
              }
            }
          },
          "404": {
            "description": "The `fileId` doesn't exist on your account, or it's more than 24 hours old or was deleted. Send the document again as a `url` or `file`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "No file with that fileId. Files can be parsed again for 24 hours after upload."
                }
              }
            }
          },
          "409": {
            "description": "The `fileId` comes from a prepared upload whose bytes haven't been sent yet, or the file was replaced after it was counted. `PUT` the file to the `uploadUrl` first, or parse it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_uploaded": {
                    "summary": "Bytes not uploaded yet",
                    "value": {
                      "status": "error",
                      "message": "The file hasn't been uploaded yet. PUT it to the uploadUrl first."
                    }
                  },
                  "changed": {
                    "summary": "File replaced after it was checked",
                    "value": {
                      "status": "error",
                      "message": "The file changed after it was checked. Parse it again."
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "The upload or the linked document is over 50 MB. Use [Prepare a large upload](/api-reference/parse/parse-uploads) for files up to 500 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "upload": {
                    "summary": "Upload over 50 MB",
                    "value": {
                      "status": "error",
                      "message": "The file is larger than 50 MB. Use POST /api/parse/uploads for files up to 500 MB."
                    }
                  },
                  "link": {
                    "summary": "Linked document over 50 MB",
                    "value": {
                      "status": "error",
                      "message": "The document is larger than 50 MB."
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "The file isn't a supported document type. The format is worked out from the file's content first and its name second.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "This file type isn't supported. Supported: pdf, docx, doc, xlsx, pptx, ppt, odt, ods, odp, rtf, epub, csv, html, htm."
                }
              }
            }
          },
          "422": {
            "description": "The request can't be parsed as sent. `message` says what to fix. This covers:\n\n- no source, or more than one;\n- an option with a wrong value (`mode`, `pages`, `maxPages`, `prompt`, `schema`, or `options` that isn't valid JSON);\n- page ranges that don't exist in the PDF, or more than 2,000 pages to parse;\n- a link that's private, unreachable, empty, or answers with an HTTP error;\n- a document that can't be opened at all. These also carry a `code`: `encrypted`, `malformed`, `empty` or `unsupported`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "no_source": {
                    "summary": "No source, or more than one",
                    "value": {
                      "status": "error",
                      "message": "Send exactly one of \"file\", \"url\" or \"fileId\"."
                    }
                  },
                  "bad_mode": {
                    "summary": "Unknown mode",
                    "value": {
                      "status": "error",
                      "message": "\"mode\" must be \"auto\", \"fast\" or \"ocr\"."
                    }
                  },
                  "no_pages": {
                    "summary": "Requested pages don't exist",
                    "value": {
                      "status": "error",
                      "message": "This PDF has 15 pages; none of the requested pages exist."
                    }
                  },
                  "too_many_pages": {
                    "summary": "More than 2,000 pages",
                    "value": {
                      "status": "error",
                      "message": "This document has 2,400 pages. Parse up to 2,000 at a time with \"pages\" or \"maxPages\"."
                    }
                  },
                  "link_error": {
                    "summary": "The link answered with an error",
                    "value": {
                      "status": "error",
                      "message": "The link returned HTTP 404."
                    }
                  },
                  "private_url": {
                    "summary": "A private address",
                    "value": {
                      "status": "error",
                      "message": "Private and internal URLs are not allowed."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 60 parse requests in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many parse requests. Please slow down and try again shortly."
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/parse/{jobId}": {
      "get": {
        "summary": "Get a parse job",
        "description": "Returns a parse job's status and, once it has finished, its Markdown, its extracted `json` and its warnings. Use it for jobs that [Parse](/api-reference/parse/parse) answered with `202`, or for any document in a [batch](/api-reference/parse/parse-batch). Poll every 2 to 5 seconds until `status` is `completed` or `failed`. Polling is free and has no rate limit.\n\nWhile the job runs, `progress` says how many pages have been read. Add `?pages=true` to get each page's Markdown on its own in `pages`.\n\nA failed job answers `200` with `status: \"failed\"` and the reason in `error`. You aren't charged for it.\n",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The `jobId` returned by `POST /parse` or `POST /parse/batch`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "c5a8d5a2-b10e-44f5-8c9e-dbbd334d19d1"
          },
          {
            "name": "pages",
            "in": "query",
            "required": false,
            "description": "Set to `true` to add `pages`, with each page's Markdown, page number and how it was read. `includePages=true` works too.",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "example": true
          }
        ],
        "responses": {
          "200": {
            "description": "The job's status, and its result once it has finished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParseJob"
                },
                "examples": {
                  "completed_pages": {
                    "summary": "Finished, with pages=true",
                    "value": {
                      "jobId": "c5a8d5a2-b10e-44f5-8c9e-dbbd334d19d1",
                      "status": "completed",
                      "fileName": "1706.03762",
                      "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                      "fileId": "29273629-c557-4ac8-9e36-14fb96b1018d",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesParsed": 3,
                      "creditsUsed": 3,
                      "markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
                      "pages": [
                        {
                          "pageNumber": 1,
                          "markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
                          "method": "text"
                        },
                        {
                          "pageNumber": 2,
                          "markdown": "# 1 Introduction\n\nRecurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks ...",
                          "method": "text"
                        },
                        {
                          "pageNumber": 3,
                          "markdown": "Figure 1: The Transformer-model architecture.\n\n...",
                          "method": "text"
                        }
                      ],
                      "warnings": [],
                      "metadata": {
                        "fileName": "1706.03762",
                        "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                        "format": "pdf",
                        "totalPages": 15,
                        "pagesParsed": 3,
                        "ocrPages": 0
                      },
                      "durationMs": 1005
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no parse job with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Parse job not found."
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/parse/batch": {
      "post": {
        "summary": "Parse a batch",
        "description": "Parses up to 50 documents in one request, mixing uploads, links and `fileId`s, and returns a `batchId` straight away. Each document becomes its own parse job with the same options. Poll [Get a parse batch](/api-reference/parse/parse-batch-status) for progress, or each document's `jobId` at [Get a parse job](/api-reference/parse/parse-status).\n\nSend uploads as `files` parts in a multipart request, links in `urls` and stored documents in `fileIds`. In a multipart request, send `urls` and `fileIds` as JSON array strings.\n\nEach document is checked and charged on its own. One that can't be fetched or read, or that your remaining credits can't cover, comes back in `documents` with `status: \"failed\"` and an `error`, and the others still run. With `dryRun: true` you get an estimate for every document and a total, and nothing is parsed.\n\n**Credits:** 1 per page parsed for each document, plus AI credits when you send a `prompt` or `schema`. Failed documents cost nothing.\n\n**Rate limits:** 60 parse requests a minute, shared with `POST /parse`.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "urls": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uri"
                        },
                        "description": "Links to documents.",
                        "example": [
                          "https://arxiv.org/pdf/1706.03762"
                        ]
                      },
                      "fileIds": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "description": "The `fileId`s of documents you parsed, estimated or uploaded in the last 24 hours.",
                        "example": [
                          "0b007010-b3f6-4398-a3ba-e5c2518839c8"
                        ]
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/ParseOptions"
                  }
                ]
              },
              "examples": {
                "mixed": {
                  "summary": "A link and a stored document",
                  "value": {
                    "urls": [
                      "https://arxiv.org/pdf/1706.03762"
                    ],
                    "fileIds": [
                      "0b007010-b3f6-4398-a3ba-e5c2518839c8"
                    ],
                    "maxPages": 1
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "The documents to upload, each up to 50 MB."
                  },
                  "urls": {
                    "type": "string",
                    "description": "Links to documents, as a JSON array string."
                  },
                  "fileIds": {
                    "type": "string",
                    "description": "Stored documents' `fileId`s, as a JSON array string."
                  },
                  "options": {
                    "type": "string",
                    "description": "The options as one JSON string, such as `{\"maxPages\":1}`. You can send each option as its own form field instead."
                  }
                }
              },
              "examples": {
                "upload": {
                  "summary": "Upload two files",
                  "value": {
                    "files": [
                      "report-2025.pdf",
                      "report-2026.pdf"
                    ],
                    "options": "{\"pages\":\"1-3\"}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`dryRun` was `true`. Each document's estimate and the total credits. Nothing was parsed or charged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "estimate"
                      ]
                    },
                    "documents": {
                      "type": "array",
                      "description": "One estimate per document, or a failed entry for a document that couldn't be read.",
                      "items": {
                        "$ref": "#/components/schemas/ParseEstimate"
                      }
                    },
                    "credits": {
                      "type": "integer",
                      "description": "Page credits for the whole batch."
                    }
                  }
                },
                "example": {
                  "status": "estimate",
                  "documents": [
                    {
                      "status": "estimate",
                      "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
                      "fileName": "1706.03762",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesToParse": 2,
                      "credits": 2
                    }
                  ],
                  "credits": 2
                }
              }
            }
          },
          "202": {
            "description": "The documents were queued. Poll `GET /parse/batch/{batchId}` for progress.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batchId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The batch's ID. Use it with `GET /parse/batch/{batchId}`."
                    },
                    "documents": {
                      "type": "array",
                      "description": "One entry per document. Uploads come first, then links, then `fileIds`.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "jobId": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The document's parse job. Missing when it failed before it was queued."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "failed"
                            ],
                            "description": "`queued` when the job was created, `failed` when the document couldn't be fetched or read, or your credits couldn't cover it."
                          },
                          "fileName": {
                            "type": "string",
                            "description": "The document's file name, or the link or `fileId` you sent when it failed early."
                          },
                          "fileId": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The stored document's ID."
                          },
                          "totalPages": {
                            "type": "integer",
                            "description": "How many pages the document has."
                          },
                          "credits": {
                            "type": "integer",
                            "description": "Page credits held for this document. Settled to the pages actually read when it finishes."
                          },
                          "error": {
                            "type": "string",
                            "description": "Only when `status` is `failed`. Why, such as `\"Not enough credits for this document.\"`"
                          }
                        }
                      }
                    },
                    "message": {
                      "type": "string",
                      "description": "Where to poll for progress."
                    }
                  }
                },
                "example": {
                  "batchId": "bd108121-f10b-407d-99d5-cb40a0939248",
                  "documents": [
                    {
                      "jobId": "60c9f3bb-f43a-4407-a86d-a45107a7c4c8",
                      "status": "queued",
                      "fileName": "1706.03762",
                      "fileId": "7578d785-660d-44fe-91ec-18bb4fe833b1",
                      "totalPages": 15,
                      "credits": 1
                    },
                    {
                      "jobId": "9cb7e05b-a16c-4fd5-8bae-ce9adf074cbf",
                      "status": "queued",
                      "fileName": "1706.03762",
                      "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
                      "totalPages": 15,
                      "credits": 1
                    }
                  ],
                  "message": "Poll /api/parse/batch/bd108121-f10b-407d-99d5-cb40a0939248 for progress."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "413": {
            "description": "One of the uploaded files is over 50 MB. Use [Prepare a large upload](/api-reference/parse/parse-uploads) for it and send its `fileId` instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "The file is larger than 50 MB. Use POST /api/parse/uploads for files up to 500 MB."
                }
              }
            }
          },
          "422": {
            "description": "No documents, more than 50, or an option with a wrong value. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "empty": {
                    "summary": "No documents",
                    "value": {
                      "status": "error",
                      "message": "Send \"files\", \"urls\" or \"fileIds\"."
                    }
                  },
                  "too_many": {
                    "summary": "More than 50 documents",
                    "value": {
                      "status": "error",
                      "message": "A batch takes up to 50 documents."
                    }
                  },
                  "too_many_files": {
                    "summary": "More than 50 uploaded files",
                    "value": {
                      "status": "error",
                      "message": "A batch takes up to 50 files."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 60 parse requests in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many parse requests. Please slow down and try again shortly."
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/parse/batch/{batchId}": {
      "get": {
        "summary": "Get a parse batch",
        "description": "Returns a parse batch's progress, counts and every document's status. `status` is `running` until every document has finished, then `completed`. Polling is free and has no rate limit.\n\nDocuments come without their results by default. Add `?include=results` to get each finished document's Markdown and extracted `json`, or read each one with [Get a parse job](/api-reference/parse/parse-status).\n\nDocuments that failed before they were queued, such as a link that couldn't be reached, aren't part of the batch here. They were reported in the response to `POST /parse/batch`.\n",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "description": "The `batchId` returned by `POST /parse/batch`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "bd108121-f10b-407d-99d5-cb40a0939248"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "Set to `results` to add each finished document's `markdown`, `json`, `warnings` and `metadata`.",
            "schema": {
              "type": "string",
              "enum": [
                "results"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The batch's progress and its documents.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batchId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The batch's ID."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "running",
                        "completed"
                      ],
                      "description": "`running` while any document is queued or running, `completed` once all have finished, whether they succeeded or failed."
                    },
                    "counts": {
                      "type": "object",
                      "description": "How many documents are in each state.",
                      "properties": {
                        "queued": {
                          "type": "integer",
                          "description": "Waiting to start."
                        },
                        "running": {
                          "type": "integer",
                          "description": "Being parsed."
                        },
                        "completed": {
                          "type": "integer",
                          "description": "Finished."
                        },
                        "failed": {
                          "type": "integer",
                          "description": "Couldn't be parsed."
                        }
                      }
                    },
                    "creditsUsed": {
                      "type": "integer",
                      "description": "Credits charged so far for the completed documents."
                    },
                    "documents": {
                      "type": "array",
                      "description": "Each document's parse job. Results are included only with `?include=results`.",
                      "items": {
                        "$ref": "#/components/schemas/ParseJob"
                      }
                    }
                  }
                },
                "example": {
                  "batchId": "bd108121-f10b-407d-99d5-cb40a0939248",
                  "status": "completed",
                  "counts": {
                    "queued": 0,
                    "running": 0,
                    "completed": 2,
                    "failed": 0
                  },
                  "creditsUsed": 2,
                  "documents": [
                    {
                      "jobId": "9cb7e05b-a16c-4fd5-8bae-ce9adf074cbf",
                      "status": "completed",
                      "fileName": "1706.03762",
                      "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                      "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesParsed": 1,
                      "creditsUsed": 1
                    },
                    {
                      "jobId": "60c9f3bb-f43a-4407-a86d-a45107a7c4c8",
                      "status": "completed",
                      "fileName": "1706.03762",
                      "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                      "fileId": "7578d785-660d-44fe-91ec-18bb4fe833b1",
                      "format": "PDF",
                      "totalPages": 15,
                      "pagesParsed": 1,
                      "creditsUsed": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no parse batch with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Batch not found."
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/parse/uploads": {
      "post": {
        "summary": "Prepare a large upload",
        "description": "Returns a link to upload a document of up to 500 MB directly, and the `fileId` to parse it by. Use it for files over the 50 MB limit of a normal upload.\n\n1. Call this endpoint with the file's name and exact size in bytes.\n2. Send the file's bytes with a `PUT` to `uploadUrl` within 15 minutes, with no API key and the same size. For example, `curl -X PUT --upload-file big.pdf \"<uploadUrl>\"`.\n3. Parse it with [Parse](/api-reference/parse/parse) and `{ \"fileId\": \"...\" }`, or add it to a [batch](/api-reference/parse/parse-batch).\n\nParsing the `fileId` before the bytes arrive returns `409`. The file can be parsed again for 24 hours, then it's deleted.\n\n**Rate limits:** 60 requests a minute, shared with `POST /parse`.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileName",
                  "size"
                ],
                "properties": {
                  "fileName": {
                    "type": "string",
                    "description": "The file's name, with an extension Parse supports, such as `report.pdf`. Names over 200 characters are cut.",
                    "example": "big.pdf"
                  },
                  "size": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 524288000,
                    "description": "The file's exact size in bytes, up to 500 MB. The upload link only accepts a file of this size.",
                    "example": 1000000
                  }
                }
              },
              "example": {
                "fileName": "big.pdf",
                "size": 1000000
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The upload link is ready. `PUT` the file to `uploadUrl` within `expiresIn` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fileId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The document's ID. Send it as `fileId` to `POST /parse` once the upload is done."
                    },
                    "uploadUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to `PUT` the file's bytes. Don't send your API key to it."
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "PUT"
                      ],
                      "description": "The HTTP method to upload with."
                    },
                    "expiresIn": {
                      "type": "integer",
                      "description": "Seconds until `uploadUrl` stops working."
                    },
                    "message": {
                      "type": "string",
                      "description": "The steps to finish the upload."
                    }
                  }
                },
                "example": {
                  "fileId": "189cfd73-ef28-4ac4-b4b9-31ec0716348b",
                  "uploadUrl": "https://.../parse/files/189cfd73-ef28-4ac4-b4b9-31ec0716348b?...",
                  "method": "PUT",
                  "expiresIn": 900,
                  "message": "PUT the file's bytes to uploadUrl within 15 minutes, then call POST /api/parse with this fileId. The file can be parsed again for 24 hours."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "413": {
            "description": "`size` is over 500 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Files can be up to 500 MB."
                }
              }
            }
          },
          "415": {
            "description": "`fileName` doesn't end in a supported extension.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "This file type isn't supported. Supported: pdf, docx, doc, xlsx, pptx, ppt, odt, ods, odp, rtf, epub, csv, html, htm."
                }
              }
            }
          },
          "422": {
            "description": "`fileName` or `size` is missing or not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "no_name": {
                    "summary": "No file name",
                    "value": {
                      "status": "error",
                      "message": "\"fileName\" is required."
                    }
                  },
                  "no_size": {
                    "summary": "No size",
                    "value": {
                      "status": "error",
                      "message": "\"size\" (bytes) is required."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 60 parse requests in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many parse requests. Please slow down and try again shortly."
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/parse/files/{fileId}": {
      "delete": {
        "summary": "Delete a document",
        "description": "Deletes a stored document now instead of when it expires. Every document you parse, estimate or upload is kept for 24 hours so you can parse it again by `fileId`, then deleted automatically.\n\nAfter this, using the `fileId` returns `404`. Results you've already parsed stay readable at [Get a parse job](/api-reference/parse/parse-status) and in [parse logs](/api-reference/logs/parse-logs).\n",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "description": "The `fileId` from a parse, an estimate or a prepared upload.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "0b007010-b3f6-4398-a3ba-e5c2518839c8"
          }
        ],
        "responses": {
          "200": {
            "description": "The document was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "deleted"
                      ]
                    },
                    "fileId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The deleted document's ID."
                    }
                  }
                },
                "example": {
                  "status": "deleted",
                  "fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no stored document with this `fileId` on your account. It may have expired after 24 hours or been deleted already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "No file with that fileId. Files can be parsed again for 24 hours after upload."
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/templates": {
      "get": {
        "summary": "List templates",
        "description": "Lists the templates you can run, with what each one returns. No API key needed.\n\nFilter with `category`, `site` or `q`. The response also lists every category and every site, so you can build filters from it. Get a template's inputs with [Get a template](/api-reference/templates/get), then [run it](/api-reference/templates/run). See [Templates](/templates).\n",
        "security": [],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only templates in this category.",
            "schema": {
              "type": "string",
              "enum": [
                "lead-generation",
                "reviews",
                "ecommerce",
                "jobs",
                "social-media",
                "real-estate",
                "ai-and-documents",
                "research",
                "travel"
              ]
            },
            "example": "lead-generation"
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "description": "Only templates for this site, by its `key` from `sites`.",
            "schema": {
              "type": "string"
            },
            "example": "google-maps"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Only templates whose title, summary or site name contains this text. Not case sensitive.",
            "schema": {
              "type": "string"
            },
            "example": "reviews"
          }
        ],
        "responses": {
          "200": {
            "description": "The templates that match, every category and every site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TemplateSummary"
                      },
                      "description": "The templates that match the filters."
                    },
                    "categories": {
                      "type": "array",
                      "description": "Every category, for filtering.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "The value to send as `category`."
                          },
                          "label": {
                            "type": "string",
                            "description": "The category's name."
                          }
                        }
                      }
                    },
                    "sites": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TemplateSite"
                      },
                      "description": "Every site with templates, for filtering. Not narrowed by the filters."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "templates": [
                    {
                      "slug": "google-maps-leads",
                      "version": 4,
                      "title": "Google Maps leads",
                      "summary": "Businesses with phone, website, rating and address for a search in one or more areas, plus emails and social links if you want them.",
                      "site": {
                        "key": "google-maps",
                        "name": "Google Maps",
                        "domain": "google.com"
                      },
                      "categories": [
                        "lead-generation"
                      ],
                      "tool": "batch",
                      "featured": true,
                      "gallery": true,
                      "status": "active",
                      "fields": [
                        "Name",
                        "Category",
                        "Phone",
                        "Website",
                        "Emails",
                        "Instagram",
                        "Facebook",
                        "LinkedIn",
                        "Rating",
                        "Reviews",
                        "Address",
                        "Maps link"
                      ],
                      "usesAi": false,
                      "availability": null
                    },
                    {
                      "slug": "google-maps-reviews-export",
                      "version": 1,
                      "title": "Google Maps reviews export",
                      "summary": "Every review for a list of places as rows, newest first, back to a date if you want.",
                      "site": {
                        "key": "google-maps",
                        "name": "Google Maps",
                        "domain": "google.com"
                      },
                      "categories": [
                        "reviews",
                        "lead-generation"
                      ],
                      "tool": "batch",
                      "featured": true,
                      "gallery": true,
                      "status": "active",
                      "fields": [
                        "Place",
                        "Stars",
                        "Date",
                        "..."
                      ],
                      "usesAi": false,
                      "availability": null
                    }
                  ],
                  "categories": [
                    {
                      "key": "lead-generation",
                      "label": "Lead generation"
                    },
                    {
                      "key": "reviews",
                      "label": "Reviews and reputation"
                    },
                    {
                      "key": "ecommerce",
                      "label": "E-commerce"
                    },
                    {
                      "key": "jobs",
                      "label": "Jobs"
                    },
                    {
                      "key": "social-media",
                      "label": "Social media"
                    },
                    {
                      "key": "real-estate",
                      "label": "Real estate"
                    },
                    {
                      "key": "ai-and-documents",
                      "label": "AI and documents"
                    },
                    {
                      "key": "research",
                      "label": "Research"
                    },
                    {
                      "key": "travel",
                      "label": "Travel"
                    }
                  ],
                  "sites": [
                    {
                      "key": "google-maps",
                      "name": "Google Maps",
                      "domain": "google.com"
                    },
                    {
                      "key": "amazon",
                      "name": "Amazon",
                      "domain": "amazon.com"
                    },
                    {
                      "key": "walmart",
                      "name": "Walmart",
                      "domain": "walmart.com"
                    },
                    {
                      "key": "ebay",
                      "name": "eBay",
                      "domain": "ebay.com"
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/templates/{slug}": {
      "get": {
        "summary": "Get a template",
        "description": "Returns everything you need to run a template: its `inputs` (the fields of its form), the `columns` its results table shows, its `limits` in plain words, and sample rows. No API key needed.\n\nSend the inputs by `key` in `inputs` when you [run the template](/api-reference/templates/run). Inputs with a `default` can be left out. The dashboard's **API** tab on a template's page shows the exact request too.\n",
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The template's `slug`, from `GET /templates`.",
            "schema": {
              "type": "string"
            },
            "example": "google-maps-leads"
          }
        ],
        "responses": {
          "200": {
            "description": "The template.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "template": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/TemplateSummary"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "description": "What the template does, in a few sentences."
                            },
                            "limits": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "What the template can't do or where it stops, in plain words."
                            },
                            "inputs": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/TemplateInput"
                              },
                              "description": "The template's inputs."
                            },
                            "columns": {
                              "type": "array",
                              "description": "The columns the results table shows by default.",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string",
                                    "description": "The path to the value inside a row, such as `socials.instagram`."
                                  },
                                  "label": {
                                    "type": "string",
                                    "description": "The column's name."
                                  },
                                  "format": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "url",
                                      "image",
                                      "date",
                                      "list",
                                      "boolean",
                                      "longtext"
                                    ],
                                    "description": "How to show the value."
                                  },
                                  "showIf": {
                                    "type": "object",
                                    "description": "Only shown when an input has a value, such as the contact columns when `findContacts` is on."
                                  }
                                }
                              }
                            },
                            "hasRows": {
                              "type": "boolean",
                              "description": "`true` when runs return rows. Crawl and parse templates link to the tool's own result instead."
                            },
                            "sample": {
                              "type": "array",
                              "items": {
                                "type": "object"
                              },
                              "description": "A few real rows from an earlier run, when the template has them."
                            },
                            "variants": {
                              "type": "array",
                              "description": "Columns and sample rows that change with an input's value, such as a template whose rows differ by tab.",
                              "items": {
                                "type": "object"
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "template": {
                    "slug": "google-maps-leads",
                    "version": 4,
                    "title": "Google Maps leads",
                    "summary": "Businesses with phone, website, rating and address for a search in one or more areas, plus emails and social links if you want them.",
                    "site": {
                      "key": "google-maps",
                      "name": "Google Maps",
                      "domain": "google.com"
                    },
                    "categories": [
                      "lead-generation"
                    ],
                    "tool": "batch",
                    "featured": true,
                    "gallery": true,
                    "status": "active",
                    "fields": [
                      "Name",
                      "Category",
                      "Phone",
                      "Website",
                      "Emails",
                      "Instagram",
                      "Facebook",
                      "LinkedIn",
                      "Rating",
                      "Reviews",
                      "Address",
                      "Maps link"
                    ],
                    "usesAi": false,
                    "description": "Type a kind of business and the areas you care about. You get every place Google Maps lists for each search, with phone, website, rating, address and a link, in one table. Places that show up in more than one area appear once. Turn on \"Find emails and social links\" to also check each place's website for emails, phone numbers and social profiles; the Emails, Instagram, Facebook and LinkedIn columns are added to the table when it is on.",
                    "limits": [
                      "Each page of a search has up to 20 places. Use more pages per area, or split a big city into neighbourhoods, to get more.",
                      "Popular times and price level need a signed-in visitor, so they are not included.",
                      "With \"Find emails and social links\" on, each website and its contact page are checked (up to 2 pages per site, 1 credit per page loaded, pages that fail are free), for up to 200 websites per run. Only details written on those pages are found."
                    ],
                    "inputs": [
                      {
                        "key": "query",
                        "label": "Business type",
                        "type": "text",
                        "required": true,
                        "example": "dentist",
                        "placeholder": "dentist, coffee shop, plumber"
                      },
                      {
                        "key": "areas",
                        "label": "Areas",
                        "type": "list",
                        "required": true,
                        "example": [
                          "Lekki, Lagos",
                          "Ikeja, Lagos"
                        ],
                        "maxItems": 25,
                        "help": "One per line. Each area is one search (1 credit)."
                      },
                      {
                        "key": "pages",
                        "label": "Pages per area",
                        "type": "number",
                        "default": 1,
                        "example": 1,
                        "min": 1,
                        "max": 5,
                        "help": "Each page adds up to 20 more places and costs 1 credit."
                      },
                      {
                        "key": "findContacts",
                        "label": "Find emails and social links",
                        "type": "boolean",
                        "default": false,
                        "help": "Also visits each place's website and its contact page for emails, phone numbers and Facebook, Instagram, LinkedIn, X, TikTok and YouTube links. 1 credit per page loaded (up to 2 per website); pages that fail are free."
                      },
                      {
                        "key": "language",
                        "label": "Language",
                        "type": "language",
                        "default": "en",
                        "advanced": true,
                        "help": "The language Google Maps writes place details in.",
                        "options": [
                          {
                            "value": "ab",
                            "label": "Abkhazian"
                          },
                          {
                            "value": "aa",
                            "label": "Afar"
                          },
                          {
                            "value": "af",
                            "label": "Afrikaans"
                          },
                          {
                            "value": "...",
                            "label": "..."
                          }
                        ]
                      }
                    ],
                    "columns": [
                      {
                        "key": "title",
                        "label": "Name"
                      },
                      {
                        "key": "category",
                        "label": "Category"
                      },
                      {
                        "key": "phone",
                        "label": "Phone"
                      },
                      {
                        "key": "website",
                        "label": "Website",
                        "format": "url"
                      },
                      {
                        "key": "emails",
                        "label": "Emails",
                        "format": "list",
                        "showIf": {
                          "input": "findContacts"
                        }
                      },
                      {
                        "key": "socials.instagram",
                        "label": "Instagram",
                        "format": "url",
                        "showIf": {
                          "input": "findContacts"
                        }
                      },
                      {
                        "key": "socials.facebook",
                        "label": "Facebook",
                        "format": "url",
                        "showIf": {
                          "input": "findContacts"
                        }
                      },
                      {
                        "key": "socials.linkedin",
                        "label": "LinkedIn",
                        "format": "url",
                        "showIf": {
                          "input": "findContacts"
                        }
                      },
                      {
                        "key": "rating",
                        "label": "Rating",
                        "format": "number"
                      },
                      {
                        "key": "reviewsCount",
                        "label": "Reviews",
                        "format": "number"
                      },
                      {
                        "key": "address",
                        "label": "Address"
                      },
                      {
                        "key": "googleMapsUrl",
                        "label": "Maps link",
                        "format": "url"
                      }
                    ],
                    "hasRows": true,
                    "sample": [],
                    "variants": [],
                    "availability": null
                  }
                }
              }
            }
          },
          "404": {
            "description": "No template has this slug. `GET /templates` lists them. A template that was folded into another one returns `TEMPLATE_REPLACED` with the new slug in `replacedBy`; the old slug still runs through the API.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "replacedBy": {
                          "type": "string",
                          "description": "Only with `TEMPLATE_REPLACED`. The template that does this job now."
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_NOT_FOUND",
                  "message": "There is no template called \"nope\". GET /api/templates lists them."
                }
              }
            }
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/templates/{slug}/estimate": {
      "post": {
        "summary": "Estimate a template run",
        "description": "Checks a template's inputs the same way a run does and returns the credits a run should cost, without running it. It's free and needs no API key, so it's also a quick way to validate inputs.\n\n`note` says what can add to the number, such as AI tokens or a second step that visits each website. `credits` is `null` when the cost can't be known in advance, such as for a parse template, where it depends on the document's pages.\n",
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The template's `slug`.",
            "schema": {
              "type": "string"
            },
            "example": "google-maps-leads"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The template's inputs by `key`, as listed by `GET /templates/{slug}`. You can also send the inputs at the top level of the body instead."
                  }
                }
              },
              "examples": {
                "inputs": {
                  "summary": "Google Maps leads",
                  "value": {
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The inputs are valid. This is what a run should cost.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "credits": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The credits a run should cost, or the most it can cost when `note` says \"at most\". `null` when it can't be known in advance."
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "What can add to `credits`, or `null`."
                    },
                    "pages": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "How many pages or searches the run would start with."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "credits": 1,
                  "note": null,
                  "pages": 1
                }
              }
            }
          },
          "404": {
            "description": "No template has this slug.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_NOT_FOUND",
                  "message": "There is no template called \"nope\". GET /api/templates lists them."
                }
              }
            }
          },
          "422": {
            "description": "Some inputs are missing or wrong. `errors` lists each one as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing": {
                    "summary": "Required inputs missing",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some inputs need fixing.",
                      "errors": [
                        {
                          "field": "query",
                          "message": "Business type is required."
                        },
                        {
                          "field": "areas",
                          "message": "Areas is required."
                        }
                      ]
                    }
                  },
                  "unknown": {
                    "summary": "An input the template doesn't have",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some inputs need fixing.",
                      "errors": [
                        {
                          "field": "locations",
                          "message": "\"locations\" is not an input of this template."
                        },
                        {
                          "field": "areas",
                          "message": "Areas is required."
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/templates/{slug}/runs": {
      "post": {
        "summary": "Run a template",
        "description": "Runs a template with your inputs and returns the run. The run reads the pages it needs and returns one row per result. Find a template's slug and inputs with [List templates](/api-reference/templates/list) and [Get a template](/api-reference/templates/get).\n\nThe response is usually `202` with `status: \"running\"`. Poll [Get a template run](/api-reference/templates/get-run) every few seconds until `status` isn't `running`. `inputs` comes back with the defaults filled in.\n\nSend `wait: true` to get a quick run back finished, with `200`. Templates that read up to 10 pages wait up to 45 seconds, and search-based templates up to 20 seconds. A run that takes longer answers `202` as usual. Templates that run several searches (such as rank trackers), and runs with a second step switched on, ignore `wait` and always answer `202`.\n\n**Credits:** what the same job costs with the tool behind it, usually 1 credit per page read. Most templates use no AI. Pages that fail aren't charged, and a failed run costs nothing. [Estimate a template run](/api-reference/templates/estimate) gives the number first, for free.\n\n**Rate limits:** 20 runs a minute. The tool behind the run applies its own limits too, such as 10 unfinished scrapes at a time for batch-based templates.\n",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The template's `slug`.",
            "schema": {
              "type": "string"
            },
            "example": "google-maps-leads"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The template's inputs by `key`, as listed by `GET /templates/{slug}`. Inputs with a `default` can be left out. You can also send the inputs at the top level of the body instead."
                  },
                  "wait": {
                    "type": "boolean",
                    "default": false,
                    "description": "Waits for a quick run to finish and returns it with `200`. Up to 45 seconds for templates that read up to 10 pages, 20 seconds for search-based ones. Ignored by templates that run several searches and by runs with a second step."
                  }
                }
              },
              "examples": {
                "run": {
                  "summary": "Start a run",
                  "value": {
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos"
                      ]
                    }
                  }
                },
                "wait": {
                  "summary": "Wait for a quick result",
                  "value": {
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos"
                      ]
                    },
                    "wait": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run finished within the `wait` window.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "run": {
                      "$ref": "#/components/schemas/TemplateRun"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "run": {
                    "runId": "e0c2890b-0f60-4443-959c-1a60045cad60",
                    "template": "google-maps-leads",
                    "templateVersion": 4,
                    "presetId": null,
                    "tool": "batch",
                    "status": "completed",
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos"
                      ],
                      "pages": 1,
                      "findContacts": false,
                      "language": "en"
                    },
                    "createdAt": "2026-10-25T08:24:39.000Z",
                    "finishedAt": "2026-10-25T08:24:39.000Z",
                    "creditsUsed": 1,
                    "urlCount": 1,
                    "rowCount": 20,
                    "job": {
                      "tool": "batch",
                      "id": "9b6f586b-8b59-4829-a25a-a360a0bcc94d"
                    },
                    "progress": {
                      "completed": 1,
                      "failed": 0,
                      "total": 1
                    },
                    "failures": [],
                    "rows": [
                      {
                        "position": 1,
                        "title": "Hilton Dental Clinic Lekki",
                        "placeId": "ChIJ89e4lQv1OxARxaJDaIA0VIE",
                        "googleMapsUrl": "https://www.google.com/maps?cid=9319131255046120133",
                        "category": "Dentist",
                        "address": "13 Whitesands St, Ikate bustop, Lagos 105102, Lagos, Nigeria",
                        "location": {
                          "lat": 6.4293659,
                          "lng": 3.4787779
                        },
                        "phone": "+234 701 007 5124",
                        "phoneE164": "+2347010075124",
                        "website": "http://www.hiltondental.com.ng/",
                        "rating": 4.9,
                        "reviewsCount": 844,
                        "businessStatus": "OPERATIONAL",
                        "hoursByDay": {
                          "monday": "8 AM–6 PM",
                          "saturday": "9 AM–3 PM",
                          "sunday": "Closed"
                        }
                      },
                      "..."
                    ]
                  }
                }
              }
            }
          },
          "202": {
            "description": "The run started. Poll `GET /template-runs/{runId}` until `status` isn't `running`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "run": {
                      "$ref": "#/components/schemas/TemplateRun"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "run": {
                    "runId": "dfefa844-ad1f-4400-b127-dc17a186d9c2",
                    "template": "google-maps-leads",
                    "templateVersion": 4,
                    "presetId": null,
                    "tool": "batch",
                    "status": "running",
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos"
                      ],
                      "pages": 1,
                      "findContacts": false,
                      "language": "en"
                    },
                    "createdAt": "2026-10-24T18:46:01.000Z",
                    "finishedAt": null,
                    "creditsUsed": null,
                    "urlCount": 1,
                    "rowCount": 0,
                    "job": {
                      "tool": "batch",
                      "id": "a566e5de-c46a-476c-a095-b26bd5cc38cf"
                    },
                    "progress": {
                      "completed": 0,
                      "failed": 0,
                      "total": 1
                    },
                    "failures": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account's payment is overdue. Update the payment method in the dashboard to continue. This comes from the tool behind the run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Your payment is overdue. Please update your payment method to continue scraping.",
                  "code": "PAYMENT_OVERDUE"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/CreditLimit"
          },
          "404": {
            "description": "No template has this slug.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_NOT_FOUND",
                  "message": "There is no template called \"nope\". GET /api/templates lists them."
                }
              }
            }
          },
          "422": {
            "description": "Some inputs are missing or wrong, or the run would fetch more than 50 pages. `errors` lists each problem as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "INVALID_INPUT",
                  "message": "Some inputs need fixing.",
                  "errors": [
                    {
                      "field": "query",
                      "message": "Business type is required."
                    },
                    {
                      "field": "areas",
                      "message": "Areas is required."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "More than 20 template runs in a minute, or the tool behind the run has too many unfinished jobs. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rate_limit": {
                    "summary": "More than 20 runs a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many template runs. Please slow down and try again shortly."
                    }
                  },
                  "pending": {
                    "summary": "Too many unfinished scrapes (batch-based templates)",
                    "value": {
                      "status": "error",
                      "message": "You have too many pending scrape jobs. Please wait for your current batch to complete before submitting more.",
                      "code": "TOO_MANY_PENDING_JOBS"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The run couldn't be started. Nothing was charged. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_RUN_FAILED",
                  "message": "The run could not be started. Nothing was charged."
                }
              }
            }
          },
          "503": {
            "description": "The template is paused for maintenance, or the tool behind it is at capacity. Nothing was charged. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "template": {
                          "type": "string",
                          "description": "With `TEMPLATE_PAUSED`, the template's slug."
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "paused": {
                    "summary": "Template paused",
                    "value": {
                      "status": "error",
                      "code": "TEMPLATE_PAUSED",
                      "message": "This template is paused for maintenance. Nothing was charged; please try again later.",
                      "template": "google-maps-leads"
                    }
                  },
                  "busy": {
                    "summary": "At capacity (batch-based templates)",
                    "value": {
                      "status": "error",
                      "message": "The scraping service is currently at capacity. Please retry in a few minutes.",
                      "code": "SERVICE_BUSY",
                      "retry_after": 60
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/template-runs": {
      "get": {
        "summary": "List template runs",
        "description": "Lists your template runs, newest first, with their status and cost but without their rows. Get a run's rows with [Get a template run](/api-reference/templates/get-run).\n\nFilter by template with `template`, and page through with `page` and `limit`. Runs still marked `running` are brought up to date before they're listed.\n",
        "parameters": [
          {
            "name": "template",
            "in": "query",
            "required": false,
            "description": "Only runs of this template, by slug.",
            "schema": {
              "type": "string"
            },
            "example": "google-maps-leads"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "The page of results, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Runs per page, from 1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your runs, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many runs match, across all pages."
                    },
                    "page": {
                      "type": "integer",
                      "description": "The page returned."
                    },
                    "runs": {
                      "type": "array",
                      "description": "The runs on this page.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "runId": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The run's ID."
                          },
                          "template": {
                            "type": "string",
                            "description": "The template's slug."
                          },
                          "title": {
                            "type": "string",
                            "description": "The template's name."
                          },
                          "site": {
                            "description": "The site the template reads, or `null`.",
                            "oneOf": [
                              {
                                "$ref": "#/components/schemas/TemplateSite"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "presetId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The preset the run was started from",
                            "or `null`.": null
                          },
                          "tool": {
                            "type": "string",
                            "enum": [
                              "batch",
                              "search",
                              "map",
                              "crawl",
                              "parse"
                            ],
                            "description": "The tool behind the run."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "running",
                              "completed",
                              "partial",
                              "failed",
                              "cancelled"
                            ],
                            "description": "The run's status."
                          },
                          "inputs": {
                            "type": "object",
                            "description": "The inputs the run used."
                          },
                          "creditsUsed": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Credits the run cost",
                            "or `null` while it runs.": null
                          },
                          "rowCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How many rows it returned."
                          },
                          "urlCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How many pages or searches it started with."
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When it started."
                          },
                          "finishedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time",
                            "description": "When it finished."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "total": 3,
                  "page": 1,
                  "runs": [
                    {
                      "runId": "b85c4c7e-0f68-4546-8cae-302a65c1fbf1",
                      "template": "google-maps-leads",
                      "title": "Google Maps leads",
                      "site": {
                        "key": "google-maps",
                        "name": "Google Maps",
                        "domain": "google.com"
                      },
                      "presetId": "15415447-7680-4dc5-90a0-f7a900c7f418",
                      "tool": "batch",
                      "status": "completed",
                      "inputs": {
                        "query": "dentist",
                        "areas": [
                          "Lekki, Lagos",
                          "Ikeja, Lagos"
                        ],
                        "pages": 1,
                        "findContacts": false,
                        "language": "en"
                      },
                      "creditsUsed": 2,
                      "rowCount": 40,
                      "urlCount": 2,
                      "createdAt": "2026-10-24T18:49:01.000Z",
                      "finishedAt": "2026-10-24T18:50:51.000Z"
                    },
                    {
                      "runId": "dfefa844-ad1f-4400-b127-dc17a186d9c2",
                      "template": "google-maps-leads",
                      "title": "Google Maps leads",
                      "site": {
                        "key": "google-maps",
                        "name": "Google Maps",
                        "domain": "google.com"
                      },
                      "presetId": null,
                      "tool": "batch",
                      "status": "completed",
                      "inputs": {
                        "query": "dentist",
                        "areas": [
                          "Lekki, Lagos"
                        ],
                        "pages": 1,
                        "findContacts": false,
                        "language": "en"
                      },
                      "creditsUsed": 1,
                      "rowCount": 20,
                      "urlCount": 1,
                      "createdAt": "2026-10-24T18:46:01.000Z",
                      "finishedAt": "2026-10-24T18:46:05.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/template-runs/{runId}": {
      "get": {
        "summary": "Get a template run",
        "description": "Returns a template run's status and progress, and its rows once it has finished. Poll it every few seconds until `status` isn't `running`. Polling is free and has no rate limit. Add `?rows=false` while polling to leave the rows out.\n\nEach row has every field the site returned, not only the columns the dashboard shows. For Google Maps that's about 50 fields per place. The template's `columns` from [Get a template](/api-reference/templates/get) list the fields its table shows by default, with the path to each one.\n\nFor crawl and parse templates, the full result is at that tool's own endpoint, using the ID in `job.id`.\n",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "The `runId` returned when the run started.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "dfefa844-ad1f-4400-b127-dc17a186d9c2"
          },
          {
            "name": "rows",
            "in": "query",
            "required": false,
            "description": "Set to `false` to leave `rows` out, which keeps polling responses small.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run, with its rows once it has finished.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "run": {
                      "$ref": "#/components/schemas/TemplateRun"
                    }
                  }
                },
                "examples": {
                  "completed": {
                    "summary": "Finished, with rows",
                    "value": {
                      "status": "success",
                      "run": {
                        "runId": "dfefa844-ad1f-4400-b127-dc17a186d9c2",
                        "template": "google-maps-leads",
                        "templateVersion": 4,
                        "presetId": null,
                        "tool": "batch",
                        "status": "completed",
                        "inputs": {
                          "query": "dentist",
                          "areas": [
                            "Lekki, Lagos"
                          ],
                          "pages": 1,
                          "findContacts": false,
                          "language": "en"
                        },
                        "createdAt": "2026-10-24T18:46:01.000Z",
                        "finishedAt": "2026-10-24T18:46:05.000Z",
                        "creditsUsed": 1,
                        "urlCount": 1,
                        "rowCount": 20,
                        "job": {
                          "tool": "batch",
                          "id": "a566e5de-c46a-476c-a095-b26bd5cc38cf"
                        },
                        "progress": {
                          "completed": 1,
                          "failed": 0,
                          "total": 1
                        },
                        "failures": [],
                        "rows": [
                          {
                            "position": 1,
                            "title": "Hilton Dental Clinic Lekki",
                            "placeId": "ChIJ89e4lQv1OxARxaJDaIA0VIE",
                            "googleMapsUrl": "https://www.google.com/maps?cid=9319131255046120133",
                            "category": "Dentist",
                            "address": "13 Whitesands St, Ikate bustop, Lagos 105102, Lagos, Nigeria",
                            "location": {
                              "lat": 6.4293659,
                              "lng": 3.4787779
                            },
                            "phone": "+234 701 007 5124",
                            "website": "http://www.hiltondental.com.ng/",
                            "domain": "hiltondental.com.ng",
                            "rating": 4.9,
                            "reviewsCount": 844,
                            "businessStatus": "OPERATIONAL",
                            "openState": "Closed · Opens 8 AM Mon"
                          },
                          {
                            "position": 2,
                            "title": "Toothmine Dental Clinic - Lekki",
                            "placeId": "ChIJDUxZFKD1OxAR_g0m4GXCymc",
                            "googleMapsUrl": "https://www.google.com/maps?cid=7479003874010205694",
                            "category": "Dentist",
                            "address": "1 Theophilus Oji Street, Lekki Phase 1, Lagos 105102, Lagos, Nigeria",
                            "rating": 4.9,
                            "reviewsCount": 146
                          },
                          "..."
                        ]
                      }
                    }
                  },
                  "no_rows": {
                    "summary": "Finished, with rows=false",
                    "value": {
                      "status": "success",
                      "run": {
                        "runId": "dfefa844-ad1f-4400-b127-dc17a186d9c2",
                        "template": "google-maps-leads",
                        "templateVersion": 4,
                        "presetId": null,
                        "tool": "batch",
                        "status": "completed",
                        "inputs": {
                          "query": "dentist",
                          "areas": [
                            "Lekki, Lagos"
                          ],
                          "pages": 1,
                          "findContacts": false,
                          "language": "en"
                        },
                        "createdAt": "2026-10-24T18:46:01.000Z",
                        "finishedAt": "2026-10-24T18:46:05.000Z",
                        "creditsUsed": 1,
                        "urlCount": 1,
                        "rowCount": 20,
                        "job": {
                          "tool": "batch",
                          "id": "a566e5de-c46a-476c-a095-b26bd5cc38cf"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no template run with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Run not found."
                }
              }
            }
          },
          "500": {
            "description": "The run couldn't be read just now. Try again in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "INTERNAL_ERROR",
                  "message": "Could not read this run. Try again in a moment."
                }
              }
            }
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/templates/lookups/airports": {
      "get": {
        "summary": "Look up airports",
        "description": "Finds airport and city codes for the Google Flights templates, whose airport inputs take codes such as `\"LOS\"` or `\"LHR\"`. Search by name, city or code with `q` to get the best matches, or look up codes you already have with `codes`.\n\n`kind` is `city` for a code that covers every airport in a city, such as `LON` for London.\n\n**Rate limits:** 240 lookups a minute. Lookups are free.\n",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "A name, city or code to search for. Up to 80 characters. Ignored when you send `codes`.",
            "schema": {
              "type": "string"
            },
            "example": "lagos"
          },
          {
            "name": "codes",
            "in": "query",
            "required": false,
            "description": "Codes to look up, separated by commas, up to 25. Codes that don't exist are left out of the answer.",
            "schema": {
              "type": "string"
            },
            "example": "JFK,LHR"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "With `q`, how many matches to return, from 1 to 25.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching airports and cities, best match first. An empty list when nothing matches or `q` is empty.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "airports": {
                      "type": "array",
                      "description": "The matches.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "The code to send in a template's airport input."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "airport",
                              "city"
                            ],
                            "description": "`airport` for one airport, `city` for a code that covers every airport in a city."
                          },
                          "name": {
                            "type": "string",
                            "description": "The airport's name, or `All airports in <city>` for a city code."
                          },
                          "city": {
                            "type": "string",
                            "description": "The city it serves."
                          },
                          "country": {
                            "type": "string",
                            "description": "The country as a two-letter code."
                          },
                          "countryName": {
                            "type": "string",
                            "description": "The country's name."
                          },
                          "region": {
                            "type": "string",
                            "description": "The region or state code, when known."
                          },
                          "airports": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Only for city codes. The codes of the airports it covers."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "airports": [
                    {
                      "code": "LOS",
                      "kind": "airport",
                      "name": "Murtala Muhammed International Airport",
                      "city": "Lagos",
                      "country": "NG",
                      "countryName": "Nigeria",
                      "region": "LA"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "More than 240 lookups in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many lookups. Please slow down and try again shortly."
                }
              }
            }
          }
        },
        "tags": [
          "Templates"
        ]
      }
    },
    "/presets": {
      "get": {
        "summary": "List presets",
        "description": "Lists your presets, newest first, 10 a page by default and up to 50 with `limit`. `total` counts every preset across all pages.\n\nEach preset has every field shown in [Get a preset](/api-reference/presets/get). See [Presets](/presets).\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "The page of results, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Presets per page, from 1 to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your presets, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "presets": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Preset"
                          },
                          "description": "The presets on this page."
                        },
                        "total": {
                          "type": "integer",
                          "description": "How many presets you have."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "presets": [
                      {
                        "id": "15415447-7680-4dc5-90a0-f7a900c7f418",
                        "name": "Dentists in Lekki",
                        "description": null,
                        "kind": "template",
                        "tool": "batch",
                        "template": {
                          "slug": "google-maps-leads",
                          "version": 4,
                          "title": "Google Maps leads",
                          "site": {
                            "key": "google-maps",
                            "name": "Google Maps",
                            "domain": "google.com"
                          },
                          "available": true
                        },
                        "inputs": {
                          "query": "dentist",
                          "areas": [
                            "Lekki, Lagos"
                          ],
                          "pages": 1,
                          "findContacts": false,
                          "language": "en"
                        },
                        "config": null,
                        "columns": null,
                        "inputsSummary": "dentist · Lekki, Lagos · 1",
                        "createdAt": "2026-10-24T18:48:38.000Z",
                        "updatedAt": "2026-10-24T18:48:38.000Z"
                      },
                      {
                        "id": "a044216c-075e-4397-abdc-75d8b2a5593e",
                        "name": "Python docs: asyncio pages",
                        "description": null,
                        "kind": "tool",
                        "tool": "map",
                        "template": null,
                        "inputs": null,
                        "config": {
                          "url": "https://docs.python.org/3/",
                          "search": "asyncio",
                          "limit": 5
                        },
                        "inputsSummary": null,
                        "createdAt": "2026-10-24T18:48:38.000Z",
                        "updatedAt": "2026-10-24T18:48:38.000Z"
                      }
                    ],
                    "total": 11
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "tags": [
          "Presets"
        ]
      },
      "post": {
        "summary": "Create a preset",
        "description": "Saves a job to run again with one call. There are two kinds:\n\n- A **template preset** (`kind: \"template\"`) is a template and its inputs, such as Google Maps leads for dentists in Lekki. The inputs are checked the same way a run checks them, and defaults are filled in.\n- A **tool preset** (`kind: \"tool\"`) is the request body for scrape, batch, crawl, map, search or parse, exactly as you'd send it to that endpoint. `config` must have what the tool requires: `urls` for scrape and batch, `baseUrl` for crawl, `url` for map, `query` for search, and `url` or `fileId` for parse.\n\n`cookies` and `wait` are never stored, so a preset never keeps a login. Run a preset with [Run a preset](/api-reference/presets/run), or [watch it for changes](/monitors) with a monitor.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind",
                  "name"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "template",
                      "tool"
                    ],
                    "description": "The kind of preset."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "A name for the preset."
                  },
                  "description": {
                    "type": "string",
                    "description": "A note about the preset."
                  },
                  "template": {
                    "type": "string",
                    "description": "With `kind: \"template\"`, the template's slug. `templateSlug` works too.",
                    "example": "google-maps-leads"
                  },
                  "inputs": {
                    "type": "object",
                    "description": "With `kind: \"template\"`, the template's inputs by `key`, as listed by [Get a template](/api-reference/templates/get)."
                  },
                  "columns": {
                    "type": "array",
                    "description": "With `kind: \"template\"`, the columns the dashboard table shows, as `{ key, label, format }` objects, up to 60. Only the dashboard uses them; runs always return every field.",
                    "items": {
                      "type": "object"
                    }
                  },
                  "tool": {
                    "type": "string",
                    "enum": [
                      "scrape",
                      "batch",
                      "crawl",
                      "map",
                      "search",
                      "parse"
                    ],
                    "description": "With `kind: \"tool\"`, the tool to run."
                  },
                  "config": {
                    "type": "object",
                    "description": "With `kind: \"tool\"`, the request body for that tool, as you'd send it to its endpoint. Up to about 200 KB."
                  }
                }
              },
              "examples": {
                "template": {
                  "summary": "Template preset",
                  "value": {
                    "kind": "template",
                    "name": "Dentists in Lekki",
                    "template": "google-maps-leads",
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos"
                      ]
                    }
                  }
                },
                "tool": {
                  "summary": "Tool preset (map)",
                  "value": {
                    "kind": "tool",
                    "name": "Python docs: asyncio pages",
                    "tool": "map",
                    "config": {
                      "url": "https://docs.python.org/3/",
                      "search": "asyncio",
                      "limit": 5
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The preset was saved. `data.id` is its ID.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "A confirmation."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The new preset's ID."
                        },
                        "uuid": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The same as `id`."
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "template": {
                    "summary": "Template preset saved",
                    "value": {
                      "status": "success",
                      "message": "Preset saved.",
                      "data": {
                        "uuid": "15415447-7680-4dc5-90a0-f7a900c7f418",
                        "id": "15415447-7680-4dc5-90a0-f7a900c7f418"
                      }
                    }
                  },
                  "tool": {
                    "summary": "Tool preset saved",
                    "value": {
                      "status": "success",
                      "message": "Preset saved.",
                      "data": {
                        "uuid": "a044216c-075e-4397-abdc-75d8b2a5593e",
                        "id": "a044216c-075e-4397-abdc-75d8b2a5593e"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No `name`, an unknown `tool`, a `config` that isn't an object, or a `config` that's too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "no_name": {
                    "summary": "No name",
                    "value": {
                      "status": "error",
                      "message": "A preset needs a name."
                    }
                  },
                  "bad_tool": {
                    "summary": "Unknown tool",
                    "value": {
                      "status": "error",
                      "message": "\"tool\" must be one of: scrape, batch, crawl, map, search, parse."
                    }
                  },
                  "bad_config": {
                    "summary": "config isn't an object",
                    "value": {
                      "status": "error",
                      "message": "\"config\" must be the request body for map, as an object."
                    }
                  },
                  "too_large": {
                    "summary": "config too large",
                    "value": {
                      "status": "error",
                      "message": "This preset is too large to save."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No template has this slug.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_NOT_FOUND",
                  "message": "There is no template called \"nope\"."
                }
              }
            }
          },
          "422": {
            "description": "Template inputs that need fixing (`errors` lists each one as `{ field, message }`), or a tool `config` missing a field the tool requires (`message` names it).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "inputs": {
                    "summary": "Template inputs need fixing",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some inputs need fixing.",
                      "errors": [
                        {
                          "field": "query",
                          "message": "Business type is required."
                        },
                        {
                          "field": "areas",
                          "message": "Areas is required."
                        }
                      ]
                    }
                  },
                  "config": {
                    "summary": "Tool config missing a field",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "The crawl settings are missing: baseUrl."
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Presets"
        ]
      }
    },
    "/presets/{presetId}": {
      "get": {
        "summary": "Get a preset",
        "description": "Returns one of your presets: a template preset with its template and inputs, or a tool preset with its request body in `config`.\n\n`template.available` is `false` when the template has been retired, and such a preset can't run. The response also carries older snake_case fields (`uuid`, `urls`, `extraction_prompt`, `use_proxy` and others), kept for scrape presets saved before October 2026. Use the camelCase fields.\n",
        "parameters": [
          {
            "name": "presetId",
            "in": "path",
            "required": true,
            "description": "The preset's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "15415447-7680-4dc5-90a0-f7a900c7f418"
          }
        ],
        "responses": {
          "200": {
            "description": "The preset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Preset"
                    }
                  }
                },
                "examples": {
                  "template": {
                    "summary": "A template preset",
                    "value": {
                      "status": "success",
                      "data": {
                        "uuid": "15415447-7680-4dc5-90a0-f7a900c7f418",
                        "name": "Dentists in Lekki",
                        "description": null,
                        "extraction_prompt": "",
                        "ai_output_format": "json",
                        "urls": [],
                        "created_at": "2026-10-24T18:48:38.000Z",
                        "updated_at": "2026-10-24T18:48:38.000Z",
                        "use_proxy": false,
                        "proxy_country": null,
                        "scrape_mode": "default",
                        "extract_content_only": false,
                        "schema_json": null,
                        "screenshot": false,
                        "full_page_screenshot": false,
                        "kind": "template",
                        "tool": "batch",
                        "template_slug": "google-maps-leads",
                        "template_version": 4,
                        "inputs": {
                          "query": "dentist",
                          "areas": [
                            "Lekki, Lagos"
                          ],
                          "pages": 1,
                          "findContacts": false,
                          "language": "en"
                        },
                        "config": null,
                        "id": "15415447-7680-4dc5-90a0-f7a900c7f418",
                        "template": {
                          "slug": "google-maps-leads",
                          "version": 4,
                          "title": "Google Maps leads",
                          "site": {
                            "key": "google-maps",
                            "name": "Google Maps",
                            "domain": "google.com"
                          },
                          "available": true
                        },
                        "columns": null,
                        "inputsSummary": "dentist · Lekki, Lagos · 1",
                        "createdAt": "2026-10-24T18:48:38.000Z",
                        "updatedAt": "2026-10-24T18:48:38.000Z"
                      }
                    }
                  },
                  "tool": {
                    "summary": "A tool preset",
                    "value": {
                      "status": "success",
                      "data": {
                        "uuid": "aee04afa-405e-46c1-89b7-f7154c978d5a",
                        "name": "verify",
                        "description": null,
                        "extraction_prompt": "",
                        "ai_output_format": "json",
                        "urls": [],
                        "created_at": "2026-10-24T19:27:04.000Z",
                        "updated_at": "2026-10-24T19:27:04.000Z",
                        "use_proxy": false,
                        "proxy_country": null,
                        "scrape_mode": "default",
                        "extract_content_only": false,
                        "schema_json": null,
                        "screenshot": false,
                        "full_page_screenshot": false,
                        "kind": "tool",
                        "tool": "map",
                        "template_slug": null,
                        "template_version": null,
                        "inputs": null,
                        "config": {
                          "url": "https://example.com"
                        },
                        "id": "aee04afa-405e-46c1-89b7-f7154c978d5a",
                        "template": null,
                        "inputsSummary": null,
                        "createdAt": "2026-10-24T19:27:04.000Z",
                        "updatedAt": "2026-10-24T19:27:04.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no preset with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Preset not found"
                }
              }
            }
          }
        },
        "tags": [
          "Presets"
        ]
      },
      "patch": {
        "summary": "Update a preset",
        "description": "Changes a preset's name, description, inputs or saved request. Send only the fields that change. `PUT` works the same way.\n\n- `name` and `description` work on any preset.\n- `inputs` and `columns` are for template presets. `inputs` replaces the saved inputs and is checked like a run.\n- `config` is for tool presets. It replaces the saved request body. `cookies` and `wait` are dropped.\n\nSending `inputs` or `columns` to a tool preset, or `config` to a template preset, returns `400`.\n",
        "parameters": [
          {
            "name": "presetId",
            "in": "path",
            "required": true,
            "description": "The preset's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "15415447-7680-4dc5-90a0-f7a900c7f418"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A new name."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A new note."
                  },
                  "inputs": {
                    "type": "object",
                    "description": "Template presets only. The full set of inputs to save, replacing the old ones."
                  },
                  "columns": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Template presets only. The columns the dashboard table shows, as `{ key, label, format }` objects."
                  },
                  "config": {
                    "type": "object",
                    "description": "Tool presets only. The full request body to save, replacing the old one."
                  }
                }
              },
              "examples": {
                "inputs": {
                  "summary": "Change a template preset's inputs",
                  "value": {
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos",
                        "Ikeja, Lagos"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preset was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "A confirmation."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "message": "Preset updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "A field that doesn't apply to this kind of preset, or nothing to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "inputs_on_tool": {
                    "summary": "inputs sent to a tool preset",
                    "value": {
                      "status": "error",
                      "message": "Only presets saved from a template have inputs."
                    }
                  },
                  "columns_on_tool": {
                    "summary": "columns sent to a tool preset",
                    "value": {
                      "status": "error",
                      "message": "\"columns\" is only for presets saved from a template."
                    }
                  },
                  "config_on_template": {
                    "summary": "config sent to a template preset",
                    "value": {
                      "status": "error",
                      "message": "\"config\" must be an object, and only tool presets have one."
                    }
                  },
                  "nothing": {
                    "summary": "Nothing to change",
                    "value": {
                      "status": "error",
                      "message": "You must provide at least one field to update."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no preset with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Preset not found or unauthorized"
                }
              }
            }
          },
          "422": {
            "description": "The new `inputs` need fixing. `errors` lists each problem as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "INVALID_INPUT",
                  "message": "Some inputs need fixing.",
                  "errors": [
                    {
                      "field": "areas",
                      "message": "Areas is required."
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Presets"
        ]
      },
      "delete": {
        "summary": "Delete a preset",
        "description": "Deletes one of your presets. Runs already made from it stay in your history.\n\nIf a [monitor](/monitors) watches the preset, its checks fail until you change the monitor's sources.\n",
        "parameters": [
          {
            "name": "presetId",
            "in": "path",
            "required": true,
            "description": "The preset's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "15415447-7680-4dc5-90a0-f7a900c7f418"
          }
        ],
        "responses": {
          "200": {
            "description": "The preset was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "A confirmation."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "message": "Preset deleted successfully"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no preset with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Preset not found or unauthorized"
                }
              }
            }
          }
        },
        "tags": [
          "Presets"
        ]
      }
    },
    "/presets/{presetId}/runs": {
      "post": {
        "summary": "Run a preset",
        "description": "Runs a preset and answers the way the job behind it answers.\n\n- A **template preset** starts a template run. The response is the same as [Run a template](/api-reference/templates/run), with `presetId` added. Poll the run with [Get a template run](/api-reference/templates/get-run).\n- A **tool preset** sends its saved request to the tool. The response is exactly that tool's response, with `presetId` and `tool` added: a map answers with its links straight away, and a scrape or crawl with a job ID to poll at its own endpoint.\n\n`overrides` replaces template inputs, or request fields of a tool preset, for this run only. The preset itself doesn't change. Send `wait: true` to wait for a quick result, as with a template run or a batch scrape.\n\n**Credits:** what the same job costs when you run the template or tool directly.\n\n**Rate limits:** 30 preset runs a minute, plus the limits of the tool behind the preset.\n",
        "parameters": [
          {
            "name": "presetId",
            "in": "path",
            "required": true,
            "description": "The preset's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "a044216c-075e-4397-abdc-75d8b2a5593e"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overrides": {
                    "type": "object",
                    "description": "Fields to change for this run only. For a template preset, inputs by `key`, merged over the saved inputs. For a tool preset, request fields, merged over the saved request body."
                  },
                  "wait": {
                    "type": "boolean",
                    "default": false,
                    "description": "Waits for a quick result, the same way `wait` works on the template or tool behind the preset."
                  }
                }
              },
              "examples": {
                "run": {
                  "summary": "Run as saved",
                  "value": {}
                },
                "override": {
                  "summary": "Change one field for this run",
                  "value": {
                    "overrides": {
                      "search": "typing"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job finished straight away, such as a map, or within the `wait` window. For a tool preset, the tool's own response with `presetId` and `tool` added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "presetId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The preset that was run."
                    },
                    "tool": {
                      "type": "string",
                      "description": "Tool presets only. The tool that ran."
                    },
                    "run": {
                      "$ref": "#/components/schemas/TemplateRun"
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "map": {
                    "summary": "A map preset",
                    "value": {
                      "status": "success",
                      "links": [
                        {
                          "url": "https://docs.python.org/3/library/asyncio.html",
                          "title": "asyncio"
                        },
                        {
                          "url": "https://docs.python.org/3/library/asyncio-threading.html",
                          "title": "asyncio and free-threaded Python"
                        },
                        {
                          "url": "https://docs.python.org/3/howto/a-conceptual-overview-of-asyncio.html",
                          "title": "A conceptual overview of asyncio"
                        },
                        "..."
                      ],
                      "total": 21,
                      "scanned": 595,
                      "sources": {
                        "sitemap": 7,
                        "pages": 588
                      },
                      "creditsUsed": 1,
                      "durationMs": 8748,
                      "presetId": "a044216c-075e-4397-abdc-75d8b2a5593e",
                      "tool": "map"
                    }
                  },
                  "override": {
                    "summary": "The same preset with overrides",
                    "value": {
                      "status": "success",
                      "links": [
                        {
                          "url": "https://docs.python.org/3/library/typing.html",
                          "title": "typing"
                        },
                        {
                          "url": "https://docs.python.org/3/whatsnew/3.7.html",
                          "title": "PEP 560: Core Support for typing module and Generic Types"
                        },
                        {
                          "url": "https://docs.python.org/3/whatsnew/3.12.html",
                          "title": "PEP 692: Using TypedDict for more precise **kwargs typing"
                        }
                      ],
                      "total": 3,
                      "scanned": 602,
                      "sources": {
                        "sitemap": 7,
                        "pages": 595
                      },
                      "creditsUsed": 1,
                      "durationMs": 8992,
                      "presetId": "a044216c-075e-4397-abdc-75d8b2a5593e",
                      "tool": "map"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The job started and is still running. For a template preset, poll `GET /template-runs/{runId}`. For a tool preset, poll that tool's status endpoint with the ID in the response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "For a template preset, `success`, with `presetId` and `run`. For a tool preset, the tool's own queued status."
                    },
                    "presetId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The preset that was run."
                    },
                    "run": {
                      "$ref": "#/components/schemas/TemplateRun"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "status": "success",
                  "presetId": "15415447-7680-4dc5-90a0-f7a900c7f418",
                  "run": {
                    "runId": "b85c4c7e-0f68-4546-8cae-302a65c1fbf1",
                    "template": "google-maps-leads",
                    "templateVersion": 4,
                    "presetId": "15415447-7680-4dc5-90a0-f7a900c7f418",
                    "tool": "batch",
                    "status": "running",
                    "inputs": {
                      "query": "dentist",
                      "areas": [
                        "Lekki, Lagos",
                        "Ikeja, Lagos"
                      ],
                      "pages": 1,
                      "findContacts": false,
                      "language": "en"
                    },
                    "createdAt": "2026-10-24T18:49:01.000Z",
                    "finishedAt": null,
                    "creditsUsed": null,
                    "urlCount": 2,
                    "rowCount": 0,
                    "job": {
                      "tool": "batch",
                      "id": "d9f24f31-e9ec-425e-a191-21e8c2e86e68"
                    },
                    "progress": {
                      "completed": 0,
                      "failed": 0,
                      "total": 2
                    },
                    "failures": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no preset with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Preset not found."
                }
              }
            }
          },
          "409": {
            "description": "The preset can't run as saved. Its template has been retired (`TEMPLATE_RETIRED`), or it names a tool that doesn't exist (`UNKNOWN_TOOL`). Save a new preset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_RETIRED",
                  "message": "The template this preset was saved from is no longer available."
                }
              }
            }
          },
          "429": {
            "description": "More than 30 preset runs in a minute. Wait, then send the request again. The tool behind the preset can also answer `429` with its own message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many preset runs. Please slow down and try again shortly."
                }
              }
            }
          },
          "500": {
            "description": "The preset couldn't be run. Nothing was charged. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "PRESET_RUN_FAILED",
                  "message": "The preset could not be run. Nothing was charged."
                }
              }
            }
          },
          "503": {
            "description": "The preset's template is paused for maintenance. Nothing was charged. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "TEMPLATE_PAUSED",
                  "message": "This template is paused for maintenance. Nothing was charged; please try again later.",
                  "template": "google-maps-leads"
                }
              }
            }
          }
        },
        "tags": [
          "Presets"
        ]
      }
    },
    "/monitors": {
      "get": {
        "summary": "List monitors",
        "description": "Lists all your monitors with their settings, schedule, last check and next check. Each monitor has every field shown in [Get a monitor](/api-reference/monitors/get). See [Monitors](/monitors).\n",
        "responses": {
          "200": {
            "description": "Your monitors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitors": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Monitor"
                      },
                      "description": "Every monitor on your account."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitors": [
                    {
                      "id": "d6761e12-b011-4633-a593-fa6be2ef466c",
                      "name": "Docs test page",
                      "status": "active",
                      "sources": [
                        {
                          "id": "ae22524a61ad",
                          "kind": "urls",
                          "urls": [
                            "https://httpbin.org/uuid"
                          ],
                          "label": "httpbin.org"
                        }
                      ],
                      "schedule": {
                        "every": "1w",
                        "day": 1,
                        "at": "08:00",
                        "timezone": "Africa/Lagos"
                      },
                      "cron": "0 8 * * 1",
                      "alertOn": "page",
                      "watchFields": [],
                      "rule": null,
                      "goal": "Only tell me if the uuid changes",
                      "notify": {
                        "email": {
                          "enabled": false
                        }
                      },
                      "nextRunAt": "2026-10-26T07:00:00.000Z",
                      "lastCheckAt": "2026-10-24T18:51:34.000Z",
                      "lastChangeAt": "2026-10-24T18:51:34.000Z",
                      "lastStatus": "completed",
                      "lastSummary": "1 page changed",
                      "createdAt": "2026-10-24T18:50:07.000Z",
                      "updatedAt": "2026-10-24T18:51:56.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "tags": [
          "Monitors"
        ]
      },
      "post": {
        "summary": "Create a monitor",
        "description": "Creates a monitor that runs its sources on a schedule, compares each check with the previous one, and alerts you when something changed. A source is a template, a preset or a list of pages. The [Monitors guide](/monitors) explains each option.\n\nThe first check runs straight away and records the starting point (\"Started watching\"). It doesn't alert. Send `checkNow: false` to wait for the schedule instead. `nextRunAt` is in UTC.\n\nAlerts go by email to your account's address unless you turn it off, and to a signed webhook, Slack or Discord if you add them. `recipients` in the response lists any extra email addresses with their status; each gets a confirmation email and receives alerts only after confirming. Try your channels first with [Send a test notification](/api-reference/monitors/test-notification).\n\nSpidra pauses a monitor whose last 5 checks all failed, and emails you, so a broken source doesn't keep using credits. Checks are kept for 30 days.\n\n**Credits:** each check costs what its sources cost to run, the same as running the template, preset or pages yourself. A `goal` adds a little AI on checks where something changed. [Estimate a monitor](/api-reference/monitors/estimate) gives the cost first, for free.\n\n**Rate limits:** 30 monitor changes a minute (creating, updating and checking now). Your plan sets how many monitors you can have and how often they can check; see [Get monitor limits](/api-reference/monitors/limits).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MonitorInput"
                  },
                  {
                    "type": "object",
                    "required": [
                      "sources"
                    ],
                    "properties": {
                      "checkNow": {
                        "type": "boolean",
                        "default": true,
                        "description": "Runs the first check straight away to record the starting point. Set to `false` to wait for the schedule."
                      }
                    }
                  }
                ]
              },
              "examples": {
                "page": {
                  "summary": "Watch a page for text changes",
                  "value": {
                    "name": "Docs test page",
                    "sources": [
                      {
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ]
                      }
                    ],
                    "schedule": {
                      "every": "1d",
                      "at": "09:00",
                      "timezone": "Africa/Lagos"
                    },
                    "alertOn": "page",
                    "notify": {
                      "email": {
                        "enabled": false
                      }
                    }
                  }
                },
                "template": {
                  "summary": "Watch a template for new items",
                  "value": {
                    "sources": [
                      {
                        "kind": "template",
                        "template": "google-maps-leads",
                        "inputs": {
                          "query": "dentist",
                          "areas": [
                            "Lekki, Lagos"
                          ]
                        }
                      }
                    ],
                    "schedule": {
                      "every": "1h"
                    },
                    "alertOn": "new"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The monitor was created, and its first check is running unless you sent `checkNow: false`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    },
                    "recipients": {
                      "type": "array",
                      "description": "Each extra email address with its status.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string",
                            "description": "The address."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "confirmed",
                              "unsubscribed"
                            ],
                            "description": "`pending` until the address confirms, `confirmed` once it has, `unsubscribed` if it opted out of alerts from your account."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitor": {
                    "id": "d6761e12-b011-4633-a593-fa6be2ef466c",
                    "name": "Docs test page",
                    "status": "active",
                    "sources": [
                      {
                        "id": "ae22524a61ad",
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ],
                        "label": "httpbin.org"
                      }
                    ],
                    "schedule": {
                      "every": "1d",
                      "at": "09:00",
                      "timezone": "Africa/Lagos"
                    },
                    "cron": "0 9 * * *",
                    "alertOn": "page",
                    "watchFields": [],
                    "rule": null,
                    "goal": null,
                    "notify": {
                      "email": {
                        "enabled": false
                      }
                    },
                    "nextRunAt": "2026-10-25T08:00:00.000Z",
                    "lastCheckAt": null,
                    "lastChangeAt": null,
                    "lastStatus": null,
                    "lastSummary": null,
                    "createdAt": "2026-10-24T18:50:07.000Z",
                    "updatedAt": "2026-10-24T18:50:07.000Z"
                  },
                  "recipients": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your plan's monitor limit is reached. Paused monitors count. Delete one or upgrade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "MONITOR_LIMIT",
                  "message": "Your plan includes 2 monitors. Delete one or upgrade to add more."
                }
              }
            }
          },
          "409": {
            "description": "Another monitor is being created on your account at the same moment. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "BUSY",
                  "message": "Another monitor is being created. Try again in a moment."
                }
              }
            }
          },
          "422": {
            "description": "Some fields need fixing. `errors` lists each one as `{ field, message }`, with paths such as `sources[0].urls[0]` or `notify.webhook.url`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "no_sources": {
                    "summary": "No sources",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some fields need fixing.",
                      "errors": [
                        {
                          "field": "sources",
                          "message": "Add at least one thing to watch: a template, a preset or a list of URLs."
                        }
                      ]
                    }
                  },
                  "several": {
                    "summary": "A private URL, a schedule faster than the plan, an unknown alertOn",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some fields need fixing.",
                      "errors": [
                        {
                          "field": "sources[0].urls[0]",
                          "message": "\"http://localhost/x\" can't be a private or internal address."
                        },
                        {
                          "field": "schedule",
                          "message": "Your plan checks at most every 15 minutes."
                        },
                        {
                          "field": "alertOn",
                          "message": "\"alertOn\" must be one of: new, changed, removed, page, every."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 30 monitor changes in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many monitor changes. Please slow down and try again shortly."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/estimate": {
      "post": {
        "summary": "Estimate a monitor",
        "description": "Returns what a monitor would cost per check and per month, before you create it. It takes the same body as [Create a monitor](/api-reference/monitors/create) and checks it the same way. Free.\n\n`usesAi` is `true` when a source extracts with AI, which adds AI credits on top. A `goal` adds a little AI only on checks where something changed, and isn't part of the estimate.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MonitorInput"
                  },
                  {
                    "type": "object",
                    "required": [
                      "sources"
                    ]
                  }
                ]
              },
              "examples": {
                "template": {
                  "summary": "A template checked every hour",
                  "value": {
                    "sources": [
                      {
                        "kind": "template",
                        "template": "google-maps-leads",
                        "inputs": {
                          "query": "dentist",
                          "areas": [
                            "Lekki, Lagos"
                          ]
                        }
                      }
                    ],
                    "schedule": {
                      "every": "1h"
                    },
                    "alertOn": "new"
                  }
                },
                "page": {
                  "summary": "A page checked every day",
                  "value": {
                    "sources": [
                      {
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ]
                      }
                    ],
                    "schedule": {
                      "every": "1d",
                      "at": "09:00",
                      "timezone": "Africa/Lagos"
                    },
                    "alertOn": "page"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cost of the monitor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "creditsPerCheck": {
                      "type": "integer",
                      "description": "Credits one check costs, roughly. AI extraction adds a little on top."
                    },
                    "checksPerMonth": {
                      "type": "integer",
                      "description": "How many checks the schedule runs in a month."
                    },
                    "creditsPerMonth": {
                      "type": "integer",
                      "description": "`creditsPerCheck` times `checksPerMonth`."
                    },
                    "usesAi": {
                      "type": "boolean",
                      "description": "`true` when a source uses AI, which adds credits on top of the estimate."
                    }
                  }
                },
                "examples": {
                  "hourly": {
                    "summary": "A template checked every hour",
                    "value": {
                      "status": "success",
                      "creditsPerCheck": 1,
                      "checksPerMonth": 720,
                      "creditsPerMonth": 720,
                      "usesAi": false
                    }
                  },
                  "daily": {
                    "summary": "A page checked every day",
                    "value": {
                      "status": "success",
                      "creditsPerCheck": 1,
                      "checksPerMonth": 30,
                      "creditsPerMonth": 30,
                      "usesAi": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Some fields need fixing. `errors` lists each one as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "INVALID_INPUT",
                  "message": "Some fields need fixing.",
                  "errors": [
                    {
                      "field": "sources[0].urls[0]",
                      "message": "\"http://localhost/x\" can't be a private or internal address."
                    },
                    {
                      "field": "schedule",
                      "message": "Your plan checks at most every 15 minutes."
                    },
                    {
                      "field": "alertOn",
                      "message": "\"alertOn\" must be one of: new, changed, removed, page, every."
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/limits": {
      "get": {
        "summary": "Get monitor limits",
        "description": "Returns what your plan allows for monitors: the shortest time between checks, how many monitors you can have, and how many you have now. Paused monitors count toward the limit.\n\n| Plan | Shortest schedule | Monitors |\n|---|---|---|\n| Free | Daily | 2 |\n| Starter | Hourly | 10 |\n| Builder | Every 15 minutes | 50 |\n| Pro | Every 5 minutes | 200 |\n| Enterprise | Every 5 minutes | 1,000 |\n",
        "responses": {
          "200": {
            "description": "Your plan's monitor limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "plan": {
                      "type": "string",
                      "description": "Your plan's name."
                    },
                    "minIntervalMinutes": {
                      "type": "integer",
                      "description": "The shortest time between checks, in minutes."
                    },
                    "maxMonitors": {
                      "type": "integer",
                      "description": "How many monitors you can have."
                    },
                    "used": {
                      "type": "integer",
                      "description": "How many monitors you have now, paused ones included."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "plan": "Builder",
                  "minIntervalMinutes": 15,
                  "maxMonitors": 50,
                  "used": 0
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/test-notification": {
      "post": {
        "summary": "Send a test notification",
        "description": "Sends a sample alert, with one new item and one price change, to the channels in `notify`. Use it to check a webhook endpoint or a Slack or Discord URL before you save a monitor. Free.\n\nEmail goes to your account's address unless `email.enabled` is `false`, and to extra `recipients` only if they've already confirmed. When a channel can't be reached, `status` is `partial` and `errors` says which one and why.\n\n**Rate limits:** 5 test notifications a minute.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notify": {
                    "$ref": "#/components/schemas/MonitorNotify"
                  },
                  "name": {
                    "type": "string",
                    "default": "Test monitor",
                    "description": "The monitor name to show in the sample alert."
                  }
                }
              },
              "examples": {
                "webhook": {
                  "summary": "Test a webhook, email off",
                  "value": {
                    "notify": {
                      "email": {
                        "enabled": false
                      },
                      "webhook": {
                        "url": "https://httpbin.org/post"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sample was sent. `status` is `partial` when a channel failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success",
                        "partial"
                      ],
                      "description": "`success` when every channel worked, `partial` when at least one failed."
                    },
                    "sent": {
                      "type": "integer",
                      "description": "How many messages went out. Each email address counts once."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "One line per channel that failed, starting with its name, such as `webhook:`."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "sent": 1,
                  "errors": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "A channel's address isn't valid. `errors` lists each problem as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "webhook": {
                    "summary": "Webhook not https",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some fields need fixing.",
                      "errors": [
                        {
                          "field": "notify.webhook.url",
                          "message": "The webhook URL must start with https://."
                        }
                      ]
                    }
                  },
                  "slack": {
                    "summary": "Not a Slack webhook URL",
                    "value": {
                      "status": "error",
                      "code": "INVALID_INPUT",
                      "message": "Some fields need fixing.",
                      "errors": [
                        {
                          "field": "notify.slack.webhookUrl",
                          "message": "Use a Slack incoming webhook URL (https://hooks.slack.com/...)."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 5 test notifications in a minute. Wait a minute, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many test notifications. Try again in a minute."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/{monitorId}": {
      "get": {
        "summary": "Get a monitor",
        "description": "Returns one monitor with its sources, schedule, alert settings and last result.\n\n`nextRunAt` is `null` while the monitor is paused. Times are in UTC. With a webhook, `notify.webhook.secret` holds the signing secret, including one Spidra made for you.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitor": {
                    "id": "d6761e12-b011-4633-a593-fa6be2ef466c",
                    "name": "Docs test page",
                    "status": "active",
                    "sources": [
                      {
                        "id": "ae22524a61ad",
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ],
                        "label": "httpbin.org"
                      }
                    ],
                    "schedule": {
                      "every": "1d",
                      "at": "09:00",
                      "timezone": "Africa/Lagos"
                    },
                    "cron": "0 9 * * *",
                    "alertOn": "page",
                    "watchFields": [],
                    "rule": null,
                    "goal": null,
                    "notify": {
                      "email": {
                        "enabled": false
                      }
                    },
                    "nextRunAt": "2026-10-25T08:00:00.000Z",
                    "lastCheckAt": "2026-10-24T18:51:34.000Z",
                    "lastChangeAt": "2026-10-24T18:51:34.000Z",
                    "lastStatus": "completed",
                    "lastSummary": "1 page changed",
                    "createdAt": "2026-10-24T18:50:07.000Z",
                    "updatedAt": "2026-10-24T18:50:07.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      },
      "patch": {
        "summary": "Update a monitor",
        "description": "Changes a monitor's sources, schedule, alerts or channels. Send only the fields that change. Everything is checked as on create.\n\n- Changing `sources` starts the comparison over for sources whose `id` is new. Their next check records a new starting point and doesn't alert.\n- Sending `notify` replaces all the channels. New email `recipients` get a confirmation email, and `recipients` in the response lists their status.\n- Send `\"goal\": null` or `\"rule\": null` to remove them.\n\n**Rate limits:** 30 monitor changes a minute, shared with creating and checking now.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonitorInput"
              },
              "examples": {
                "schedule_goal": {
                  "summary": "Check weekly and add a goal",
                  "value": {
                    "schedule": {
                      "every": "1w",
                      "day": 1,
                      "at": "08:00",
                      "timezone": "Africa/Lagos"
                    },
                    "goal": "Only tell me if the uuid changes"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated monitor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    },
                    "recipients": {
                      "type": "array",
                      "description": "When you sent `notify`, each extra email address with its status. Empty otherwise.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string",
                            "description": "The address."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "confirmed",
                              "unsubscribed"
                            ],
                            "description": "Whether it has confirmed."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitor": {
                    "id": "d6761e12-b011-4633-a593-fa6be2ef466c",
                    "name": "Docs test page",
                    "status": "active",
                    "sources": [
                      {
                        "id": "ae22524a61ad",
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ],
                        "label": "httpbin.org"
                      }
                    ],
                    "schedule": {
                      "every": "1w",
                      "day": 1,
                      "at": "08:00",
                      "timezone": "Africa/Lagos"
                    },
                    "cron": "0 8 * * 1",
                    "alertOn": "page",
                    "watchFields": [],
                    "rule": null,
                    "goal": "Only tell me if the uuid changes",
                    "notify": {
                      "email": {
                        "enabled": false
                      }
                    },
                    "nextRunAt": "2026-10-26T07:00:00.000Z",
                    "lastCheckAt": "2026-10-24T18:51:34.000Z",
                    "lastChangeAt": "2026-10-24T18:51:34.000Z",
                    "lastStatus": "completed",
                    "lastSummary": "1 page changed",
                    "createdAt": "2026-10-24T18:50:07.000Z",
                    "updatedAt": "2026-10-24T18:51:55.000Z"
                  },
                  "recipients": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          },
          "422": {
            "description": "Some fields need fixing. `errors` lists each one as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "INVALID_INPUT",
                  "message": "Some fields need fixing.",
                  "errors": [
                    {
                      "field": "schedule",
                      "message": "Your plan checks at most every 15 minutes."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "More than 30 monitor changes in a minute. Wait, then send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too many monitor changes. Please slow down and try again shortly."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      },
      "delete": {
        "summary": "Delete a monitor",
        "description": "Deletes a monitor and its check history. To stop checks but keep the history, [pause it](/api-reference/monitors/pause) instead.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor and its checks were deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "success"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/{monitorId}/check": {
      "post": {
        "summary": "Check a monitor now",
        "description": "Runs a monitor's check now, outside its schedule. The check runs in the background, costs what a scheduled check costs, and alerts like one. Read the result with [List monitor checks](/api-reference/monitors/list-checks).\n\n**Rate limits:** once a minute per monitor, and 30 monitor changes a minute across your account.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          }
        ],
        "responses": {
          "202": {
            "description": "The check was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Where the result will show."
                    }
                  }
                },
                "example": {
                  "status": "queued",
                  "message": "Checking now. The result will show in the check history."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          },
          "429": {
            "description": "This monitor was checked less than a minute ago, or you made more than 30 monitor changes in a minute. Wait, then try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_soon": {
                    "summary": "Checked less than a minute ago",
                    "value": {
                      "status": "error",
                      "code": "TOO_SOON",
                      "message": "This monitor was just checked. Try again in a minute."
                    }
                  },
                  "rate_limit": {
                    "summary": "More than 30 changes a minute",
                    "value": {
                      "status": "error",
                      "message": "Too many monitor changes. Please slow down and try again shortly."
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/{monitorId}/pause": {
      "post": {
        "summary": "Pause a monitor",
        "description": "Stops a monitor's scheduled checks until you resume it. The response is the monitor with `status: \"paused\"` and `nextRunAt: null`. Its history is kept, and it still counts toward your plan's monitor limit. [Resume it](/api-reference/monitors/resume) to start checks again.\n\nSpidra also pauses a monitor whose last 5 checks all failed, and emails you.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          }
        ],
        "responses": {
          "200": {
            "description": "The paused monitor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitor": {
                    "id": "d6761e12-b011-4633-a593-fa6be2ef466c",
                    "name": "Docs test page",
                    "status": "paused",
                    "sources": [
                      {
                        "id": "ae22524a61ad",
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ],
                        "label": "httpbin.org"
                      }
                    ],
                    "schedule": {
                      "every": "1w",
                      "day": 1,
                      "at": "08:00",
                      "timezone": "Africa/Lagos"
                    },
                    "cron": "0 8 * * 1",
                    "alertOn": "page",
                    "watchFields": [],
                    "rule": null,
                    "goal": "Only tell me if the uuid changes",
                    "notify": {
                      "email": {
                        "enabled": false
                      }
                    },
                    "nextRunAt": null,
                    "lastCheckAt": "2026-10-24T18:51:34.000Z",
                    "lastChangeAt": "2026-10-24T18:51:34.000Z",
                    "lastStatus": "completed",
                    "lastSummary": "1 page changed",
                    "createdAt": "2026-10-24T18:50:07.000Z",
                    "updatedAt": "2026-10-24T18:51:56.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/{monitorId}/resume": {
      "post": {
        "summary": "Resume a monitor",
        "description": "Starts scheduled checks again on a paused monitor. The response is the monitor with `status: \"active\"` and its next scheduled time in `nextRunAt`. The next check is compared with the last one made before the pause.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          }
        ],
        "responses": {
          "200": {
            "description": "The active monitor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitor": {
                    "id": "d6761e12-b011-4633-a593-fa6be2ef466c",
                    "name": "Docs test page",
                    "status": "active",
                    "sources": [
                      {
                        "id": "ae22524a61ad",
                        "kind": "urls",
                        "urls": [
                          "https://httpbin.org/uuid"
                        ],
                        "label": "httpbin.org"
                      }
                    ],
                    "schedule": {
                      "every": "1w",
                      "day": 1,
                      "at": "08:00",
                      "timezone": "Africa/Lagos"
                    },
                    "cron": "0 8 * * 1",
                    "alertOn": "page",
                    "watchFields": [],
                    "rule": null,
                    "goal": "Only tell me if the uuid changes",
                    "notify": {
                      "email": {
                        "enabled": false
                      }
                    },
                    "nextRunAt": "2026-10-26T07:00:00.000Z",
                    "lastCheckAt": "2026-10-24T18:51:34.000Z",
                    "lastChangeAt": "2026-10-24T18:51:34.000Z",
                    "lastStatus": "completed",
                    "lastSummary": "1 page changed",
                    "createdAt": "2026-10-24T18:50:07.000Z",
                    "updatedAt": "2026-10-24T18:51:56.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/{monitorId}/checks": {
      "get": {
        "summary": "List monitor checks",
        "description": "Lists a monitor's checks, newest first, with a summary of each. The changes themselves are in [Get a monitor check](/api-reference/monitors/get-check). Checks are kept for 30 days.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "The page of results, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Checks per page, from 1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor's checks, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many checks the monitor has."
                    },
                    "page": {
                      "type": "integer",
                      "description": "The page returned."
                    },
                    "checks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MonitorCheck"
                      },
                      "description": "The checks on this page, without their changes."
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "total": 2,
                  "page": 1,
                  "checks": [
                    {
                      "id": "45da0eb4-7969-4beb-861d-107ce34178e1",
                      "trigger": "manual",
                      "status": "completed",
                      "startedAt": "2026-10-24T18:51:26.000Z",
                      "finishedAt": "2026-10-24T18:51:33.000Z",
                      "creditsUsed": 1,
                      "hasChanges": true,
                      "summary": "1 page changed",
                      "notified": false,
                      "judgment": null,
                      "error": null
                    },
                    {
                      "id": "63922522-ede6-42b3-88af-a74b033645b4",
                      "trigger": "manual",
                      "status": "completed",
                      "startedAt": "2026-10-24T18:50:08.000Z",
                      "finishedAt": "2026-10-24T18:50:15.000Z",
                      "creditsUsed": 1,
                      "hasChanges": false,
                      "summary": "Started watching (1 items)",
                      "notified": false,
                      "judgment": null,
                      "error": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no monitor with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Monitor not found."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/monitors/{monitorId}/checks/{checkId}": {
      "get": {
        "summary": "Get a monitor check",
        "description": "Returns one check of a monitor with everything that changed, per source: new, changed and removed items, and page text changes. Get check IDs from [List monitor checks](/api-reference/monitors/list-checks).\n\nA source's first check has `baseline: true` and only records the starting point. `judgment` is set when the monitor has a `goal` and something changed; when `meaningful` is `false`, no alert went out. `notified` is `false` when no alert went out, for example because no channel was switched on.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          },
          {
            "name": "checkId",
            "in": "path",
            "required": true,
            "description": "The check's `id`, from `GET /monitors/{monitorId}/checks`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "45da0eb4-7969-4beb-861d-107ce34178e1"
          }
        ],
        "responses": {
          "200": {
            "description": "The check, with each source's changes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "check": {
                      "$ref": "#/components/schemas/MonitorCheck"
                    }
                  }
                },
                "examples": {
                  "page_changed": {
                    "summary": "A page whose text changed",
                    "value": {
                      "status": "success",
                      "check": {
                        "id": "45da0eb4-7969-4beb-861d-107ce34178e1",
                        "trigger": "manual",
                        "status": "completed",
                        "startedAt": "2026-10-24T18:51:26.000Z",
                        "finishedAt": "2026-10-24T18:51:33.000Z",
                        "creditsUsed": 1,
                        "hasChanges": true,
                        "summary": "1 page changed",
                        "notified": false,
                        "judgment": null,
                        "error": null,
                        "sources": [
                          {
                            "sourceId": "ae22524a61ad",
                            "label": "httpbin.org",
                            "baseline": false,
                            "added": [],
                            "removed": [],
                            "changed": [],
                            "pages": [
                              {
                                "url": "https://httpbin.org/uuid",
                                "added": [
                                  "\"uuid\": \"1d984f94-ab9f-4ceb-b87b-c8eb49296cc6\""
                                ],
                                "removed": [
                                  "\"uuid\": \"2cd9cc3c-4f93-4da9-bf79-7dd362324291\""
                                ]
                              }
                            ],
                            "rowCount": 1
                          }
                        ]
                      }
                    }
                  },
                  "baseline": {
                    "summary": "The first check (starting point)",
                    "value": {
                      "status": "success",
                      "check": {
                        "id": "63922522-ede6-42b3-88af-a74b033645b4",
                        "trigger": "manual",
                        "status": "completed",
                        "startedAt": "2026-10-24T18:50:08.000Z",
                        "finishedAt": "2026-10-24T18:50:15.000Z",
                        "creditsUsed": 1,
                        "hasChanges": false,
                        "summary": "Started watching (1 items)",
                        "notified": false,
                        "judgment": null,
                        "error": null,
                        "sources": [
                          {
                            "sourceId": "ae22524a61ad",
                            "label": "httpbin.org",
                            "baseline": true,
                            "added": [],
                            "removed": [],
                            "changed": [],
                            "pages": [],
                            "rowCount": 1
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no check with this ID on this monitor, or the check is more than 30 days old.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "code": "NOT_FOUND",
                  "message": "Check not found."
                }
              }
            }
          }
        },
        "tags": [
          "Monitors"
        ]
      }
    },
    "/parse/formats": {
      "get": {
        "summary": "List formats",
        "description": "Returns the document formats Parse accepts, its size and page limits, and its price per page. No API key needed.\n\nThe format of a document is worked out from its content first and its file name second, so a file with the wrong extension still works.\n",
        "security": [],
        "responses": {
          "200": {
            "description": "The formats and limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "extensions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The file extensions Parse accepts."
                    },
                    "maxUploadBytes": {
                      "type": "integer",
                      "description": "The largest file, in bytes, you can upload directly or send as a link (50 MB)."
                    },
                    "maxPreparedUploadBytes": {
                      "type": "integer",
                      "description": "The largest file, in bytes, you can send through a [prepared upload](/api-reference/parse/parse-uploads) (500 MB)."
                    },
                    "maxPagesPerDocument": {
                      "type": "integer",
                      "description": "The most pages parsed from one document in one request."
                    },
                    "creditsPerPage": {
                      "type": "integer",
                      "description": "Credits per page parsed, before any AI extraction."
                    }
                  }
                },
                "example": {
                  "extensions": [
                    "pdf",
                    "docx",
                    "doc",
                    "xlsx",
                    "pptx",
                    "ppt",
                    "odt",
                    "ods",
                    "odp",
                    "rtf",
                    "epub",
                    "csv",
                    "html",
                    "htm"
                  ],
                  "maxUploadBytes": 52428800,
                  "maxPreparedUploadBytes": 524288000,
                  "maxPagesPerDocument": 2000,
                  "creditsPerPage": 1
                }
              }
            }
          }
        },
        "tags": [
          "Parse"
        ]
      }
    },
    "/map-logs": {
      "get": {
        "summary": "List map logs",
        "description": "Lists your past [maps](/api-reference/crawling/map), newest first, with their settings, counts and credits. Every map is logged, including ones that found nothing or failed.\n\nThe list leaves out the links. Get them with [Get a map log](/api-reference/logs/map-logs-detail).\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Logs per page, from 1 to 100. Higher values are capped at 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only return logs with this status. `all` returns every status.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "success",
                "empty",
                "error"
              ]
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Only return maps whose URL or search contains this text.",
            "schema": {
              "type": "string"
            },
            "example": "docs.python.org"
          },
          {
            "name": "dateStart",
            "in": "query",
            "description": "Only return maps run at or after this date, as `YYYY-MM-DD`.",
            "schema": {
              "type": "string"
            },
            "example": "2026-10-01"
          },
          {
            "name": "dateEnd",
            "in": "query",
            "description": "Only return maps run at or before this date, as `YYYY-MM-DD`.",
            "schema": {
              "type": "string"
            },
            "example": "2026-10-31"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of map logs and the total that match.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "logs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/MapLogSummary"
                          },
                          "description": "The logs on this page."
                        },
                        "total": {
                          "type": "integer",
                          "description": "How many logs match the filters in all."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "logs": [
                      {
                        "uuid": "c25cf706-80fa-4403-be7b-5a3b33afcb2a",
                        "user_uuid": "4aeefb9f-30c3-41fb-886a-10245923dc31",
                        "status": "success",
                        "url": "https://docs.python.org/3/",
                        "search": "asyncio",
                        "sitemap_mode": "include",
                        "url_limit": 20,
                        "include_subdomains": false,
                        "respect_robots": false,
                        "total": 21,
                        "scanned": 595,
                        "sitemap_count": 7,
                        "pages_count": 588,
                        "message": null,
                        "latency_ms": 9625,
                        "credits_used": 1,
                        "scraping_channel": "api",
                        "created_at": "2026-10-25T03:19:23.000Z"
                      }
                    ],
                    "total": 16
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "The logs couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to load map logs"
                }
              }
            }
          }
        },
        "tags": [
          "Logs"
        ]
      }
    },
    "/map-logs/{uuid}": {
      "get": {
        "summary": "Get a map log",
        "description": "Returns one past map with its settings and the links it returned.\n",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "The log's `uuid` from [List map logs](/api-reference/logs/map-logs).",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "c25cf706-80fa-4403-be7b-5a3b33afcb2a"
          }
        ],
        "responses": {
          "200": {
            "description": "The map log with its links.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/MapLogSummary"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "description": "The log's row number."
                            },
                            "links": {
                              "type": "array",
                              "description": "The links the map returned, as in the `POST /map` response. Empty when nothing was found.",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string",
                                    "description": "The page's URL."
                                  },
                                  "title": {
                                    "type": "string",
                                    "description": "The link text",
                                    "when the URL came from a page.": null
                                  }
                                }
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "id": 16,
                    "uuid": "c25cf706-80fa-4403-be7b-5a3b33afcb2a",
                    "user_uuid": "4aeefb9f-30c3-41fb-886a-10245923dc31",
                    "status": "success",
                    "url": "https://docs.python.org/3/",
                    "search": "asyncio",
                    "sitemap_mode": "include",
                    "url_limit": 20,
                    "include_subdomains": false,
                    "respect_robots": false,
                    "total": 21,
                    "scanned": 595,
                    "sitemap_count": 7,
                    "pages_count": 588,
                    "message": null,
                    "latency_ms": 9625,
                    "credits_used": 1,
                    "scraping_channel": "api",
                    "created_at": "2026-10-25T03:19:23.000Z",
                    "links": [
                      {
                        "url": "https://docs.python.org/3/library/asyncio.html",
                        "title": "asyncio"
                      },
                      {
                        "url": "https://docs.python.org/3/library/asyncio-threading.html",
                        "title": "asyncio and free-threaded Python"
                      },
                      "..."
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "There's no map log with this ID on your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Map log not found"
                }
              }
            }
          },
          "500": {
            "description": "The log couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Failed to load the map log"
                }
              }
            }
          }
        },
        "tags": [
          "Logs"
        ]
      }
    },
    "/parse-logs": {
      "get": {
        "summary": "List parse logs",
        "description": "Lists the documents you've [parsed](/api-reference/parse/parse), newest first, with their pages, how they were read and credits. Open a full result with [Get a parse job](/api-reference/parse/parse-status) using the log's `jobId`.\n\nUnlike the other logs, parse logs use camelCase field names.\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Logs per page, from 1 to 100. Higher values are capped at 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only return documents with this status. `all` returns every status.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "queued",
                "running",
                "completed",
                "failed"
              ]
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Only return documents whose file name or source URL contains this text.",
            "schema": {
              "type": "string"
            },
            "example": "arxiv.org"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of parse logs and the total that match.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "description": "How many logs match the filters in all."
                        },
                        "logs": {
                          "type": "array",
                          "description": "The logs on this page.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "jobId": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The parse job's ID. Use it with `GET /parse/{jobId}`."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "queued",
                                  "running",
                                  "completed",
                                  "failed"
                                ],
                                "description": "Where the job is."
                              },
                              "fileName": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The document's file name."
                              },
                              "sourceUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The URL the document was read from, when it came from a URL."
                              },
                              "sourceType": {
                                "type": "string",
                                "enum": [
                                  "url",
                                  "upload"
                                ],
                                "description": "`url` when the document was read from a link, `upload` when the file was sent, including a file uploaded earlier and sent by its ID."
                              },
                              "format": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The document's format, such as `PDF`."
                              },
                              "mode": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The `mode` the document was parsed with."
                              },
                              "pageSelection": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The pages asked for, such as `1` or `1-3`. `null` for every page."
                              },
                              "totalPages": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "How many pages the document has."
                              },
                              "pagesParsed": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "How many pages were parsed."
                              },
                              "ocrPages": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "How many pages were read with AI because they had no text layer."
                              },
                              "hasPrompt": {
                                "type": "boolean",
                                "description": "Whether a `prompt` or `schema` was sent."
                              },
                              "creditsUsed": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "Credits the document cost."
                              },
                              "latencyMs": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "How long parsing took, in milliseconds."
                              },
                              "channel": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "`api` when sent with an API key, `playground` when run from the dashboard."
                              },
                              "error": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Why the job failed. `null` otherwise."
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "description": "When the document was sent."
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": {
                    "total": 21,
                    "logs": [
                      {
                        "jobId": "a5ce0370-85a4-478e-acb0-89090b67a6b2",
                        "status": "completed",
                        "fileName": "northwind-7781.pdf",
                        "sourceUrl": null,
                        "sourceType": "upload",
                        "format": "PDF",
                        "mode": "auto",
                        "pageSelection": null,
                        "totalPages": 1,
                        "pagesParsed": 1,
                        "ocrPages": 0,
                        "hasPrompt": true,
                        "creditsUsed": 2,
                        "latencyMs": 764,
                        "channel": "api",
                        "error": null,
                        "createdAt": "2026-10-25T03:54:31.000Z"
                      },
                      {
                        "jobId": "60c9f3bb-f43a-4407-a86d-a45107a7c4c8",
                        "status": "completed",
                        "fileName": "1706.03762",
                        "sourceUrl": "https://arxiv.org/pdf/1706.03762",
                        "sourceType": "url",
                        "format": "PDF",
                        "mode": "auto",
                        "pageSelection": "1",
                        "totalPages": 15,
                        "pagesParsed": 1,
                        "ocrPages": 0,
                        "hasPrompt": false,
                        "creditsUsed": 1,
                        "latencyMs": 555,
                        "channel": "api",
                        "error": null,
                        "createdAt": "2026-10-25T03:23:34.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "tags": [
          "Logs"
        ]
      }
    },
    "/usage-stats/breakdown": {
      "get": {
        "summary": "Usage by tool",
        "description": "Returns the credits you used each day, split by tool: scrape, crawl, search, parse and map. Rows are oldest first, and days with no activity are included with zeros. Batch scrapes count under `scrapeCredits`.\n\nFor totals with tokens and requests, use [Usage stats](/api-reference/account/usage-stats).\n",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": true,
            "description": "`1d`, `7d` or `30d` for that many days up to today, or `custom` with `startDate` and `endDate`.",
            "schema": {
              "type": "string",
              "enum": [
                "1d",
                "7d",
                "30d",
                "custom"
              ]
            },
            "example": "7d"
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "With `range=custom`, the first day as `YYYY-MM-DD`. At most 90 days before `endDate`.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-10-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "With `range=custom`, the last day as `YYYY-MM-DD`.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-10-25"
          }
        ],
        "responses": {
          "200": {
            "description": "One row per day.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "A short label for a chart axis, such as `Oct 19`."
                          },
                          "date": {
                            "type": "string",
                            "description": "The day as `YYYY-MM-DD`."
                          },
                          "scrapeCredits": {
                            "type": "integer",
                            "description": "Credits used by scrapes and batch scrapes."
                          },
                          "crawlCredits": {
                            "type": "integer",
                            "description": "Credits used by crawls."
                          },
                          "searchCredits": {
                            "type": "integer",
                            "description": "Credits used by searches."
                          },
                          "parseCredits": {
                            "type": "integer",
                            "description": "Credits used by parsing documents."
                          },
                          "mapCredits": {
                            "type": "integer",
                            "description": "Credits used by maps."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "label": "Oct 19",
                      "date": "2026-10-19",
                      "scrapeCredits": 74,
                      "crawlCredits": 0,
                      "searchCredits": 0,
                      "parseCredits": 0,
                      "mapCredits": 0
                    },
                    {
                      "label": "Oct 20",
                      "date": "2026-10-20",
                      "scrapeCredits": 3,
                      "crawlCredits": 0,
                      "searchCredits": 0,
                      "parseCredits": 0,
                      "mapCredits": 0
                    },
                    "..."
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`range` is missing or not allowed, or the custom dates are missing, in the wrong order or more than 90 days apart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "range": {
                    "summary": "Missing or unknown range",
                    "value": {
                      "status": "error",
                      "message": "Invalid or missing range"
                    }
                  },
                  "custom_dates": {
                    "summary": "Custom range without dates",
                    "value": {
                      "status": "error",
                      "message": "startDate and endDate (yyyy-mm-dd) are required for a custom range"
                    }
                  },
                  "order": {
                    "summary": "Dates in the wrong order",
                    "value": {
                      "status": "error",
                      "message": "startDate must be on or before endDate"
                    }
                  },
                  "too_long": {
                    "summary": "More than 90 days",
                    "value": {
                      "status": "error",
                      "message": "Custom range can't exceed 90 days"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Usage couldn't be loaded. Try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Something went wrong loading usage. Try again."
                }
              }
            }
          }
        },
        "tags": [
          "Account"
        ]
      }
    },
    "/monitors/{monitorId}/snapshot": {
      "get": {
        "summary": "Get a monitor's snapshot",
        "tags": [
          "Monitors"
        ],
        "description": "Returns what the monitor holds now: for each source, the rows (template and preset sources) or pages (URL sources) its last check saw, with when that was. Each check is compared with this, so it's the monitor's current view of the data. Use it to sync your own database, for example a job board's current jobs.\n\nFree, and not rate limited. Before a source's first check finishes, it has `kind: \"none\"`.\n",
        "parameters": [
          {
            "name": "monitorId",
            "in": "path",
            "required": true,
            "description": "The monitor's `id`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "d6761e12-b011-4633-a593-fa6be2ef466c"
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "One source's `id`, to get only that source.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most rows (or pages) to return per source.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000,
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor's current data, per source, in the monitor's order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "monitorId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sourceId": {
                            "type": "string",
                            "description": "The source's `id`."
                          },
                          "label": {
                            "type": "string",
                            "description": "The source's label."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "rows",
                              "pages",
                              "none"
                            ],
                            "description": "`rows` for template and preset sources, `pages` for URL sources, `none` before the first check finishes."
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time",
                            "description": "When the last check saved this data."
                          },
                          "rowCount": {
                            "type": "integer",
                            "description": "`rows` only: how many rows the monitor holds."
                          },
                          "rows": {
                            "type": "array",
                            "items": {
                              "type": "object"
                            },
                            "description": "`rows` only: the rows, up to `limit`."
                          },
                          "pageCount": {
                            "type": "integer",
                            "description": "`pages` only: how many pages."
                          },
                          "pages": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "text": {
                                  "type": "string",
                                  "description": "The page's text as compared between checks."
                                },
                                "fields": {
                                  "type": [
                                    "object",
                                    "null"
                                  ],
                                  "description": "The page's data, for pages a [popular site](/sites/overview) reader understands."
                                }
                              }
                            },
                            "description": "`pages` only: the pages, up to `limit`."
                          },
                          "truncated": {
                            "type": "boolean",
                            "description": "`true` when there were more rows or pages than `limit`."
                          },
                          "message": {
                            "type": "string",
                            "description": "`none` only: why there's nothing yet."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "monitorId": "d6761e12-b011-4633-a593-fa6be2ef466c",
                  "sources": [
                    {
                      "sourceId": "4849f762b267",
                      "label": "example.com",
                      "kind": "pages",
                      "updatedAt": "2026-11-10T10:06:26.000Z",
                      "pageCount": 1,
                      "pages": [
                        {
                          "url": "https://example.com",
                          "text": "Example Domain\nThis domain is for use in documentation examples without needing permission.",
                          "fields": null
                        }
                      ],
                      "truncated": false
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No monitor with this ID, or no source with that `source` ID."
          }
        }
      }
    },
    "/template-runs/{runId}/retry": {
      "post": {
        "summary": "Retry a template run's failed pages",
        "tags": [
          "Templates"
        ],
        "description": "Runs the failed pages of a finished run again, with the run's original inputs, and leaves the rest alone. The run goes back to `running`, so poll [Get a template run](/api-reference/templates/get-run) as before. Each failure in `failures` has a `code` (such as `blocked` or `not_found`) to decide whether a retry is worth it.\n\nWorks on runs of a single step. Runs with a second step (such as checking each website for contacts) or that run many searches answer `409` with `RETRY_NOT_SUPPORTED`; start a new run instead.\n\n**Credits:** only the retried pages, at the template's usual price. A page that fails again costs nothing.\n",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "The `runId` returned when the run started.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "dfefa844-ad1f-4400-b127-dc17a186d9c2"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cookies": {
                    "type": "string",
                    "description": "Cookies are never stored. Send them again if the run used them."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The failed pages are running again.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "retriedCount": {
                      "type": "integer",
                      "description": "How many pages are running again."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "run": {
                      "$ref": "#/components/schemas/TemplateRun"
                    }
                  }
                },
                "example": {
                  "status": "success",
                  "retriedCount": 1,
                  "run": {
                    "runId": "cba40eaa-3593-41c2-8688-d0984d255695",
                    "template": "github-repo-details",
                    "status": "running"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`NO_FAILED_PAGES`: the run has no failed pages."
          },
          "404": {
            "description": "No run with this ID."
          },
          "409": {
            "description": "`RUN_RUNNING`: the run hasn't finished yet. `RETRY_NOT_SUPPORTED`: the run has more than one step."
          }
        }
      }
    }
  }
}
