openapi: 3.0.1
info:
  title: Spider API
  version: 1.0.0
  description: >-
    Spider is a web crawling, scraping and search API. It turns a page or a whole site into
    markdown, text or structured JSON, and it runs a browser when a page needs JavaScript.


    Base URL https://api.spider.cloud. Every POST path also accepts a /v1/ prefix. Send
    "Authorization: Bearer YOUR_API_KEY". Create a key at https://spider.cloud/api-keys.


    Keyless access is /scrape only and needs no account. Send Authorization: Bearer free. It is
    rate limited. On a 429, honor Retry-After. Get a key for anything sustained. Without a key,
    every route returns 402 with an x402 payment challenge, /scrape included, except /unlimited/*,
    which returns 401. With Bearer free, every route other than /scrape returns 402.


    Content routes return a JSON array with one object per page, /scrape included. The status on
    each object is the page's own HTTP status, separate from the status of the API call. An attempt
    bills for the bandwidth and compute it used, whatever status the page returns. A failed page is
    not free.


    Pay as you go starts at 10,000 requests per minute and rises through four levels to 80,000 as
    the account uses more. RateLimit-Limit on each response carries your current limit.


    If you are an agent, read these next. Compact index: https://spider.cloud/llms.txt. Full
    parameter reference: https://spider.cloud/llms-full.txt. Setup skill:
    https://spider.cloud/agent-skill/SKILL.md. Hosted MCP server: https://mcp.spider.cloud/mcp.
  termsOfService: https://spider.cloud/eula
  contact:
    name: Spider support
    email: support@spider.cloud
    url: https://spider.cloud/docs/api
externalDocs:
  description: API reference
  url: https://spider.cloud/docs/api
servers:
  - url: https://api.spider.cloud
security:
  - bearerAuth: []
tags:
  - name: Core
    description: Fetch, crawl, search and convert. Billed in credits.
  - name: Unlimited
    description: The same routes at a flat monthly rate by concurrency. Needs an Unlimited plan.
  - name: AI
    description: Routes driven by a natural-language prompt. Needs an AI plan.
  - name: Account
    description: Your balance.
paths:
  /crawl:
    post:
      operationId: crawl
      tags:
        - Core
      summary: Crawl a site
      description: Follows links from the starting URL and returns one object per page. Set limit to bound
        the crawl.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              limit: 10
              return_format: markdown
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: One object per page. Streams as pages finish.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://example.com
                  content: |-
                    # Example Domain

                    This domain is for use in documentation examples.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs:
                    total_cost: 0.00004
                    ai_cost: 0
                    compute_cost: 0.00001
                    file_cost: 0.00002
                    bytes_transferred_cost: 0.00001
                    transform_cost: 0
                - url: https://example.com/about
                  content: |-
                    # About

                    Who we are.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs:
                    total_cost: 0.00004
                    ai_cost: 0
                    compute_cost: 0.00001
                    file_cost: 0.00002
                    bytes_transferred_cost: 0.00001
                    transform_cost: 0
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /scrape:
    post:
      operationId: scrape
      tags:
        - Core
      summary: Scrape one page
      description: >-
        Fetches one page with no traversal. This is the one route with a free tier.
        Keyless access is /scrape only and needs no account. Send Authorization: Bearer free. It is
        rate limited. On a 429, honor Retry-After. Get a key for anything sustained. A call with no
        Authorization header gets 402 with code x402_payment_required and a PAYMENT-REQUIRED header,
        like every other priced route.
      security:
        - bearerAuth: []
        - freeTier: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              return_format: markdown
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: The page, as a one element array.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScrapeSuccessResponse"
              example:
                - url: https://example.com
                  content: |-
                    # Example Domain

                    This domain is for use in documentation examples.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs:
                    total_cost: 0.00004
                    ai_cost: 0
                    compute_cost: 0.00001
                    file_cost: 0.00002
                    bytes_transferred_cost: 0.00001
                    transform_cost: 0
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /unblocker:
    post:
      operationId: unblocker
      tags:
        - Core
      summary: Unblock a page (deprecated)
      description: 'Deprecated. The route still answers requests, but new integrations should call /scrape
        instead. For pages that block plain requests, send "stealth": true to /scrape.'
      deprecated: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              return_format: markdown
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: The page, as a one element array.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScrapeSuccessResponse"
              example:
                - url: https://example.com
                  content: |-
                    # Example Domain

                    This domain is for use in documentation examples.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs:
                    total_cost: 0.00004
                    ai_cost: 0
                    compute_cost: 0.00001
                    file_cost: 0.00002
                    bytes_transferred_cost: 0.00001
                    transform_cost: 0
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /links:
    post:
      operationId: links
      tags:
        - Core
      summary: Collect links
      description: Crawls like /crawl and returns the URLs found on each page instead of the content.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              limit: 5
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: One object per page, each with its links.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LinksSuccessResponse"
              example:
                - url: https://example.com
                  status: 200
                  error: null
                  duration_elasped_ms: 698
                  links:
                    - https://example.com/about
                    - https://example.com/pricing
                  costs:
                    total_cost: 0.00011
                    compute_cost: 0.00001
                    file_cost: 0.0001
                    bytes_transferred_cost: 1e-7
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /unlimited/crawl:
    post:
      operationId: unlimitedCrawl
      tags:
        - Unlimited
      summary: Unlimited crawl
      description: Needs a key on an account with an active Unlimited plan. Billing is by purchased
        concurrency, not credits. AI parameters are refused with a 400. With every seat busy the
        route answers 429 at once and queues nothing. With no key it answers 401.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              limit: 10
              return_format: markdown
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: One object per page. Streams as pages finish.
          headers:
            X-Concurrency-Limit:
              description: The number of purchased Unlimited concurrency seats.
              schema:
                type: integer
            X-Concurrency-Active:
              description: How much of your Unlimited plan is in use, rounded up to a whole number. A request counts as 1 in http mode and 2 in browser mode. Smart mode counts as 1, and as 2 once a page needs a browser.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://example.com
                  content: |-
                    # Example Domain

                    This domain is for use in documentation examples.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs: null
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
        "400":
          description: AI and LLM extraction parameters are not supported on Unlimited routes.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/UnlimitedPlanRequired"
        "429":
          $ref: "#/components/responses/UnlimitedConcurrencyLimitReached"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /unlimited/scrape:
    post:
      operationId: unlimitedScrape
      tags:
        - Unlimited
      summary: Unlimited scrape
      description: Needs a key on an account with an active Unlimited plan. Billing is by purchased
        concurrency, not credits. AI parameters are refused with a 400. With every seat busy the
        route answers 429 at once and queues nothing. With no key it answers 401.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              return_format: markdown
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: The page, as a one element array.
          headers:
            X-Concurrency-Limit:
              description: The number of purchased Unlimited concurrency seats.
              schema:
                type: integer
            X-Concurrency-Active:
              description: How much of your Unlimited plan is in use, rounded up to a whole number. A request counts as 1 in http mode and 2 in browser mode. Smart mode counts as 1, and as 2 once a page needs a browser.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScrapeSuccessResponse"
              example:
                - url: https://example.com
                  content: |-
                    # Example Domain

                    This domain is for use in documentation examples.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs: null
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
        "400":
          description: AI and LLM extraction parameters are not supported on Unlimited routes.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/UnlimitedPlanRequired"
        "429":
          $ref: "#/components/responses/UnlimitedConcurrencyLimitReached"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /unlimited/links:
    post:
      operationId: unlimitedLinks
      tags:
        - Unlimited
      summary: Unlimited links
      description: Needs a key on an account with an active Unlimited plan. Billing is by purchased
        concurrency, not credits. AI parameters are refused with a 400. With every seat busy the
        route answers 429 at once and queues nothing. With no key it answers 401.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              url: https://example.com
              limit: 5
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: One object per page, each with its links.
          headers:
            X-Concurrency-Limit:
              description: The number of purchased Unlimited concurrency seats.
              schema:
                type: integer
            X-Concurrency-Active:
              description: How much of your Unlimited plan is in use, rounded up to a whole number. A request counts as 1 in http mode and 2 in browser mode. Smart mode counts as 1, and as 2 once a page needs a browser.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LinksSuccessResponse"
              example:
                - url: https://example.com
                  status: 200
                  error: null
                  duration_elasped_ms: 698
                  links:
                    - https://example.com/about
                    - https://example.com/pricing
                  costs: null
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
        "400":
          description: AI and LLM extraction parameters are not supported on Unlimited routes.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/UnlimitedPlanRequired"
        "429":
          $ref: "#/components/responses/UnlimitedConcurrencyLimitReached"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /search:
    post:
      operationId: search
      tags:
        - Core
      summary: Search the web
      description: "Returns ranked results for a query. With fetch_page_content: true it also fetches each
        result and returns page objects instead."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/SearchRequestParams"
                - type: object
                  required:
                    - search
            example:
              search: rust web crawler
              search_limit: 5
              fetch_page_content: false
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: Ranked results, or one object per fetched result when fetch_page_content is true.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/SearchResultsResponse"
                  - $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                content:
                  - title: spider-rs/spider
                    description: A web crawler and scraper for Rust.
                    url: https://github.com/spider-rs/spider
                  - title: Spider
                    description: Web crawling, scraping and search API.
                    url: https://spider.cloud
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /screenshot:
    post:
      operationId: screenshot
      tags:
        - Core
      summary: Take a screenshot
      description: "Renders the page in a browser and returns the image as URL-safe base64 in
        content."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScreenshotRequestParams"
            example:
              url: https://example.com
              full_page: true
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: One object per page, with the image as URL-safe base64 in content.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScrapeSuccessResponse"
              example:
                - url: https://example.com
                  content: iVBORw0KGgoAAAANSUhEUgAA...
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs:
                    total_cost: 0.00004
                    ai_cost: 0
                    compute_cost: 0.00001
                    file_cost: 0.00002
                    bytes_transferred_cost: 0.00001
                    transform_cost: 0
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /transform:
    post:
      operationId: transform
      tags:
        - Core
      summary: Convert HTML you already have
      description: Converts HTML to markdown or text. It fetches nothing. Up to 10 MB per request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransformRequestParams"
            example:
              return_format: markdown
              data:
                - html: <html><body><h1>Hello</h1><p>World</p></body></html>
                  url: https://example.com
          text/csv:
            schema:
              type: string
          application/xml:
            schema:
              type: string
          application/jsonl:
            schema:
              type: string
      responses:
        "200":
          description: The converted documents.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransformResponse"
              example:
                content:
                  - |-
                    # Hello

                    World
            text/csv:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/jsonl:
              schema:
                type: string
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /ai/crawl:
    post:
      operationId: aiCrawl
      tags:
        - AI
      summary: AI crawl
      description: Crawls a site and lets the prompt decide what to extract from each page. Needs a key on
        an account with an active AI plan, see https://spider.cloud/ai/pricing. Extracted fields
        arrive under metadata.extracted_data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/RequestParams"
                - $ref: "#/components/schemas/AIRequestExtras"
            example:
              url: https://spider.cloud
              prompt: Collect every pricing plan with its monthly cost.
              limit: 25
              return_format: markdown
      responses:
        "200":
          description: One object per page.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://spider.cloud/pricing
                  error: null
                  status: 200
                  content: |-
                    # Pricing

                    Starter, Pro and Enterprise plans.
                  metadata:
                    title: Pricing
                    extracted_data:
                      tier: Pro
                      monthly_cost: 99
                      is_annual: false
                  costs: null
                  duration_elasped_ms: 2140
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/AIPlanRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /ai/scrape:
    post:
      operationId: aiScrape
      tags:
        - AI
      summary: AI scrape
      description: Fetches one page and extracts what the prompt asks for. Needs a key on an account with
        an active AI plan, see https://spider.cloud/ai/pricing. Extracted fields arrive under
        metadata.extracted_data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/RequestParams"
                - $ref: "#/components/schemas/AIRequestExtras"
            example:
              url: https://spider.cloud/pricing
              prompt: Pull the Pro plan name, its monthly cost, and whether annual billing is selected.
      responses:
        "200":
          description: The page, as a one element array.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://spider.cloud/pricing
                  error: null
                  status: 200
                  content: |-
                    # Pricing

                    Starter, Pro and Enterprise plans.
                  metadata:
                    title: Pricing
                    extracted_data:
                      tier: Pro
                      monthly_cost: 99
                      is_annual: false
                  costs: null
                  duration_elasped_ms: 2140
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/AIPlanRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /ai/search:
    post:
      operationId: aiSearch
      tags:
        - AI
      summary: AI search
      description: Searches the web with a query built from the prompt and returns the results. Needs a
        key on an account with an active AI plan, see https://spider.cloud/ai/pricing. Extracted
        fields arrive under metadata.extracted_data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/SearchRequestParams"
                - $ref: "#/components/schemas/AIRequestExtras"
            example:
              prompt: Find recent benchmarks comparing Rust web crawlers on throughput.
              num: 10
              fetch_page_content: true
              return_format: markdown
      responses:
        "200":
          description: One object per result.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://example.com/rust-crawler-benchmarks
                  error: null
                  status: 200
                  content: |-
                    # Rust crawler benchmarks

                    Throughput measured across 12 runs.
                  metadata:
                    title: Rust crawler benchmarks
                    extracted_data:
                      results:
                        - title: Rust crawler benchmarks
                          rank: 1
                  costs: null
                  duration_elasped_ms: 2140
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/AIPlanRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /ai/browser:
    post:
      operationId: aiBrowser
      tags:
        - AI
      summary: AI browser automation
      description: Drives a browser to carry out the prompt, so clicks and form steps happen before
        extraction. Needs a key on an account with an active AI plan, see
        https://spider.cloud/ai/pricing. Extracted fields arrive under metadata.extracted_data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/RequestParams"
                - $ref: "#/components/schemas/AIRequestExtras"
            example:
              url: https://spider.cloud/pricing
              prompt: Switch the billing toggle to annual, then read back each plan name with its price.
      responses:
        "200":
          description: The page, as a one element array.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://spider.cloud/pricing
                  error: null
                  status: 200
                  content: |-
                    # Pricing

                    Annual billing selected.
                  metadata:
                    title: Pricing
                    extracted_data:
                      billing_period: annual
                      plans:
                        - plan: Pro
                          price: 79
                  costs: null
                  duration_elasped_ms: 2140
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/AIPlanRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /ai/links:
    post:
      operationId: aiLinks
      tags:
        - AI
      summary: AI links extraction
      description: Returns the links on a page that match the prompt. Needs a key on an account with an
        active AI plan, see https://spider.cloud/ai/pricing. Extracted fields arrive under
        metadata.extracted_data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/RequestParams"
                - $ref: "#/components/schemas/AIRequestExtras"
            example:
              url: https://spider.cloud
              prompt: Find every documentation link under the API reference.
              limit: 50
      responses:
        "200":
          description: One object per page, each with its links.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrawlSuccessResponse"
              example:
                - url: https://spider.cloud
                  error: null
                  status: 200
                  links:
                    - https://spider.cloud/docs/api
                    - https://spider.cloud/docs/quickstart
                  costs: null
                  duration_elasped_ms: 1988
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/AIPlanRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /fetch/{domain}/{path}:
    post:
      operationId: fetch
      tags:
        - Core
      summary: Fetch a page by path with stored settings
      description: Reads one page. The target is the path instead of a url field, so POST
        /fetch/news.ycombinator.com/newest reads https://news.ycombinator.com/newest. The settings
        saved for that domain and exact path apply before the fetch, and a body overrides them. A url in the body
        is dropped. The first call for a path with no stored settings runs discovery, which is slow
        and can return a retryable 503. A GET returns 400.
      parameters:
        - name: domain
          in: path
          required: true
          description: The host to read, for example news.ycombinator.com.
          schema:
            type: string
          example: example.com
        - name: path
          in: path
          required: true
          description: The rest of the address. It can contain slashes. Leave it empty for the site root.
          schema:
            type: string
          example: pricing
      requestBody:
        required: false
        description: Optional. The same parameters as /scrape except url, overriding the stored settings.
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestParams"
            example:
              return_format: markdown
      responses:
        "200":
          description: The page, as a one element array. Stored settings usually name fields, so the answer
            tends to arrive in css_extracted.
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute on your account.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScrapeSuccessResponse"
              example:
                - url: https://example.com/pricing
                  content: |-
                    # Example Domain

                    This domain is for use in documentation examples.
                  status: 200
                  error: null
                  duration_elasped_ms: 122
                  costs:
                    total_cost: 0.00004
                    ai_cost: 0
                    compute_cost: 0.00001
                    file_cost: 0.00002
                    bytes_transferred_cost: 0.00001
                    transform_cost: 0
                  css_extracted:
                    title:
                      - Pricing
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/ServerError"
        "503":
          $ref: "#/components/responses/ServerError"
  /data/credits:
    get:
      operationId: getCredits
      tags:
        - Account
      summary: Remaining credit balance
      description: Returns the credits left on the account. There is no GET /credits.
      responses:
        "200":
          description: The balance.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreditsResponse"
              example:
                data:
                  id: 8d662167-5a5f-41aa-9cb8-0cbb7d536891
                  user_id: 6bd06efa-bb0a-4f1f-a29f-05db0c4b1bf0
                  credits: 53334
                  created_at: 2024-04-21T01:21:32.886863+00:00
                  updated_at: 2024-04-21T01:21:32.886863+00:00
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/PaymentRequired"
        "429":
          $ref: "#/components/responses/RateLimited"
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send "Authorization: Bearer YOUR_API_KEY". Create a key at https://spider.cloud/api-keys.'
    freeTier:
      type: http
      scheme: bearer
      description: 'The free tier on /scrape, with no account. Send "Authorization: Bearer free". Any
        token that starts with "free-" works the same way. It is rate limited per IP. On a 429, honor
        Retry-After. With this token, a route other than /scrape returns 402 free_tier_route_blocked.'
  responses:
    BadRequest:
      description: Bad parameters, malformed JSON, or a GET sent to a POST route. The body can be empty,
        so read the status code. Fix the request before sending it again.
    Unauthorized:
      description: 'Missing, invalid or expired key. The body can be empty. Send "Authorization: Bearer"
        with a key from https://spider.cloud/api-keys.'
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    PaymentRequired:
      description: 'Out of credits, a call with no key, or the free token on a route other than
        /scrape. A call with no Authorization header, /scrape included, gets code
        x402_payment_required and a PAYMENT-REQUIRED header with the x402 payment challenge. Add
        credits at https://spider.cloud/credits/new, get a key at https://spider.cloud/api-keys, or
        for the free tier on /scrape, send "Authorization: Bearer free".'
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            outOfCredits:
              summary: The balance is empty
              value:
                error: Your credit balance is empty. Add credits at https://spider.cloud/credits/new to continue.
                code: credits_required
                upgrade_url: https://spider.cloud/credits/new?utm_source=api&utm_medium=paywall&utm_content=credits_required
            freeTokenBlocked:
              summary: The free token on a route other than /scrape
              value:
                error: This route requires an account. The free API-key-less tier supports only /scrape.
                code: free_tier_route_blocked
                upgrade_url: https://spider.cloud/pricing?utm_source=free_tier&utm_medium=api&utm_campaign=free_api_upgrade&utm_content=free_tier_route_blocked
    AIPlanRequired:
      description: No active AI plan, out of credits, or a call with no key. Pick a plan at
        https://spider.cloud/ai/pricing, add credits at https://spider.cloud/credits/new, or get a
        key at https://spider.cloud/api-keys.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: AI Studio subscription required
            code: ai_subscription_required
            url: https://spider.cloud/ai/pricing
    RateLimited:
      description: >-
        Rate limited. Wait the number of seconds in Retry-After, then send the request again.
        A body with "window": "5h" means the account reached its 5-hour usage limit, and
        Retry-After is the time until that window resets.
      headers:
        Retry-After:
          description: Seconds to wait before retrying the request.
          schema:
            type: integer
        RateLimit-Limit:
          description: Requests allowed per minute on your account.
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left in the current window.
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: Rate limit exceeded
            status: 429
    ServerError:
      description: Server side. Retry with exponential backoff, honoring Retry-After when the response has one.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    UnlimitedPlanRequired:
      description: An active Unlimited subscription is required for this route. Start one at
        https://spider.cloud/pricing?plan=unlimited, or call the same route without the /unlimited
        prefix to spend credits.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UnlimitedPlanError"
          example:
            error: unlimited_plan_required
    UnlimitedConcurrencyLimitReached:
      description: >
        All purchased Unlimited concurrency seats are active. The request was not queued; retry
        after the Retry-After interval.
      headers:
        Retry-After:
          description: Seconds to wait before retrying the request.
          schema:
            type: integer
        X-Concurrency-Limit:
          description: The number of purchased Unlimited concurrency seats.
          schema:
            type: integer
        X-Concurrency-Active:
          description: How much of your Unlimited plan is in use, rounded up to a whole number. A request counts as 1 in http mode and 2 in browser mode. Smart mode counts as 1, and as 2 once a page needs a browser.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UnlimitedConcurrencyLimitError"
          example:
            error: concurrency_limit_reached
            seats: 2
            active: 2
  schemas:
    CrawlSuccessResponse:
      type: array
      description: One object per page.
      items:
        $ref: "#/components/schemas/PageResult"
    ScrapeSuccessResponse:
      type: array
      description: One object for the page, still inside an array.
      items:
        $ref: "#/components/schemas/PageResult"
    LinksSuccessResponse:
      type: array
      description: One object per page, each with its links.
      items:
        $ref: "#/components/schemas/PageResult"
    UnlimitedPlanError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          enum:
            - unlimited_plan_required
            - unlimited_plan_inactive
    UnlimitedConcurrencyLimitError:
      type: object
      required:
        - error
        - seats
        - active
      properties:
        error:
          type: string
          enum:
            - concurrency_limit_reached
        seats:
          type: integer
        active:
          type: integer
    RequestParams:
      type: object
      properties:
        url:
          type: string
          description: The page or site to fetch. Separate several URLs with commas.
        limit:
          type: integer
          description: Maximum pages to crawl per site. Unset or 0 crawls every page found, capped by your
            remaining credit balance.
        smart_mode:
          type: boolean
          description: Legacy boolean form of request "smart". Set request instead.
        webhook:
          allOf:
            - $ref: "#/components/schemas/Webhook"
          description: Legacy name. The API no longer reads it. Send webhooks instead.
          deprecated: true
        authorization:
          type: string
          description: An API key in the body, for running a request as another member of a team. The
            Authorization header is the usual place for a key. /unlimited routes reject this field.
        cookies:
          type: string
          description: Cookie header value to send with each request, for pages that need a session.
        refresh_token:
          type: string
          description: Legacy field kept for older clients. The API no longer reads it.
          deprecated: true
        hard_limit:
          type: integer
          description: Legacy field kept for older clients. The API no longer reads it.
          deprecated: true
        cache:
          description: Use HTTP caching. Defaults to true. Standard routes skip browser when cached; AI routes
            always use browser.
          default: true
          oneOf:
            - type: boolean
            - type: object
              properties:
                maxAge:
                  type: integer
                  description: "Freshness window in ms (default: 172800000 = 2 days)"
                allowStale:
                  type: boolean
                skipBrowser:
                  type: boolean
                  description: "Skip browser if cached HTML exists (default: true for standard routes, false for AI
                    routes)"
                period:
                  type: string
                  description: RFC3339 timestamp cutoff
        budget:
          type: object
          description: 'Page budget per path, for example {"*": 100, "/docs/": 20}. "*" matches every path.'
        store_data:
          type: boolean
          description: Legacy field kept for older clients. The API no longer reads it.
          deprecated: true
        use_chrome:
          type: boolean
          description: Legacy field. The API no longer reads it. Set request to "browser" instead.
          deprecated: true
        root_selector:
          type: string
          description: CSS selector for the subtree to extract, for example "#container".
        exclude_selector:
          type: string
          description: CSS selector for content to drop from the output.
        run_in_background:
          type: boolean
          description: Return at once and run the crawl in the background. Needs webhooks to deliver results.
        return_format:
          allOf:
            - $ref: "#/components/schemas/Content"
          description: Output format, or an array of formats. Default raw, the unmodified HTML. Use markdown
            for LLM input. An unrecognized value falls back to raw.
        request:
          allOf:
            - $ref: "#/components/schemas/RequestType"
          description: How to fetch. http is fastest and runs no JavaScript. browser renders the page. smart,
            the default, tries http and moves to a browser only when the page needs it. chrome and
            headless are older names for browser. An unrecognized value falls back to http. On Unlimited
            a request counts as 1 in http mode and 2 in browser mode. Smart mode counts as 1, and
            as 2 once a page needs a browser.
        depth:
          type: integer
          description: Maximum crawl depth. Default 25. 0 removes the limit.
        encoding:
          type: string
          description: Character encoding for the content, for example UTF-8 or SHIFT_JIS.
        locale:
          type: string
          description: Locale for the request, for example en-US.
        request_timeout:
          type: integer
          description: Timeout for each request in seconds, from 5 to 255.
        delay:
          type: integer
          description: Milliseconds to wait between requests, up to 60000. Turns off concurrency.
        stealth:
          type: boolean
          description: Set true for a page that refuses plain requests or returns a challenge page. Costs more
            than a standard request.
        headers:
          type: object
          description: HTTP headers to send with every request, as a map of name to value.
        viewport:
          type: object
          description: "Browser viewport: width, height, device_scale_factor, emulating_mobile, is_landscape,
            has_touch."
        device:
          allOf:
            - $ref: "#/components/schemas/DeviceType"
          description: Device class to present as.
        readability:
          type: boolean
          description: Strip boilerplate before converting. Default false.
        subdomains:
          type: boolean
          description: Follow links to subdomains. Default false.
        tld:
          type: boolean
          description: Follow links to other top level domains of the same name. Default false.
        user_agent:
          type: string
          description: User agent to send. The default rotates real agents.
        blacklist:
          type: array
          items:
            type: string
          description: Paths to skip. Regex is supported.
        whitelist:
          type: array
          items:
            type: string
          description: Paths to allow. Everything else is skipped. Regex is supported.
        full_resources:
          type: boolean
          description: Download every resource on the site, images and scripts included.
        metadata:
          type: boolean
          description: Add title, description, keywords and og:image to each page. Default false.
        fingerprint:
          type: boolean
          description: Give browser requests a complete, consistent browser profile. Default true.
        gpt_config:
          allOf:
            - $ref: "#/components/schemas/GPTConfigs"
          description: Legacy field. The API no longer reads it. Use the /ai routes with a prompt.
          deprecated: true
        anti_bot:
          type: boolean
          description: Legacy field kept for older clients. The API no longer reads it.
          deprecated: true
        respect_robots:
          type: boolean
          description: Follow robots.txt. Default true.
        chunking_alg:
          allOf:
            - $ref: "#/components/schemas/ChunkingAlgorithm"
          description: 'Split the output into chunks, for example {"type": "bysentence", "value": 2}.'
        skip_config_checks:
          type: boolean
          description: Skip the lookup of stored settings for the site. Faster for single page requests.
        text:
          type: string
          description: Text to pull URLs from when no url is sent. Up to 10 MB.
        website_limit:
          type: integer
          description: How many sites to take from a list sent in url or text.
        sitemap:
          type: boolean
          description: Add pages from the sitemap to the crawl. Default false.
        sitemap_path:
          type: string
          description: The sitemap URL to read when sitemap is true.
        country_code:
          type: string
          description: ISO country code for the proxy exit, for example gb.
        wait_for:
          type: object
          description: 'When a browser page counts as ready. Keys: selector, dom, idle_network, idle_network0,
            almost_idle_network0, delay, page_navigations. Each timeout is {"secs": n, "nanos": n}.
            Applies to browser and smart requests.'
          properties:
            selector:
              type: object
              description: Wait until this CSS selector is on the page.
              properties:
                selector:
                  type: string
                timeout:
                  $ref: "#/components/schemas/WaitTimeout"
              example:
                selector: h1.product-title
                timeout:
                  secs: 10
                  nanos: 0
            dom:
              type: object
              description: Wait until the element this selector names stops changing.
              properties:
                selector:
                  type: string
                timeout:
                  $ref: "#/components/schemas/WaitTimeout"
              example:
                selector: "#results"
                timeout:
                  secs: 10
                  nanos: 0
            idle_network:
              type: object
              description: Wait until the network has been idle for 500 ms.
              properties:
                timeout:
                  $ref: "#/components/schemas/WaitTimeout"
              example:
                timeout:
                  secs: 5
                  nanos: 0
            idle_network0:
              type: object
              description: Wait until no network requests are open, up to the timeout.
              properties:
                timeout:
                  $ref: "#/components/schemas/WaitTimeout"
              example:
                timeout:
                  secs: 5
                  nanos: 0
            almost_idle_network0:
              type: object
              description: Wait until the network is almost idle, up to the timeout.
              properties:
                timeout:
                  $ref: "#/components/schemas/WaitTimeout"
              example:
                timeout:
                  secs: 5
                  nanos: 0
            delay:
              type: object
              description: Wait a fixed time. Meant for testing.
              properties:
                timeout:
                  $ref: "#/components/schemas/WaitTimeout"
              example:
                timeout:
                  secs: 5
                  nanos: 0
            page_navigations:
              type: boolean
              description: Wait for page navigations to finish. Default false.
          example:
            selector:
              selector: h1.product-title
              timeout:
                secs: 10
                nanos: 0
            idle_network:
              timeout:
                secs: 5
                nanos: 0
        execution_scripts:
          type: object
          description: 'JavaScript to run per path, as {"/path": "script"}. Needs a browser or smart request.'
        disable_intercept:
          type: boolean
          description: Turn off request interception on browser and smart requests. Default false.
        disable_first_party_stylesheets:
          type: boolean
          description: Also block first-party stylesheets when block_stylesheets is on. Default false, so
            first-party CSS still loads and single page apps hydrate.
        disable_first_party_javascript:
          type: boolean
          description: Apply blocklists to first-party scripts too. Default false.
        disable_first_party_visuals:
          type: boolean
          description: Also block first-party visuals when visuals are blocked. Default false.
        external_domains:
          type: array
          items:
            type: string
          description: Other domains to treat as part of the same site. "*" allows all.
        css_extraction_map:
          type: object
          description: 'Fields to extract by CSS selector, keyed by URL path. "/" matches every page. Any
            other key matches only the page whose path is exactly that key; a prefix such as "/products"
            currently matches nothing. Each value is a list of {"name": "field", "selectors": ["css"]}.
            Results arrive under css_extracted.'
          example:
            /:
              - name: title
                selectors:
                  - h1
              - name: price
                selectors:
                  - .price .value
        scroll:
          type: integer
          description: Scroll the page as new content loads, for up to this many milliseconds. Needs a browser
            request.
        automation_scripts:
          type: object
          description: Browser actions to run per path, such as Click, Fill, Wait and Scroll. Needs a browser
            or smart request.
        return_headers:
          type: boolean
          description: Add the response headers to each page. Default false.
        return_cookies:
          type: boolean
          description: Add the response cookies to each page. Default false.
        return_page_links:
          type: boolean
          description: Add the links found on each page. Default false.
        return_json_data:
          type: boolean
          description: Add JSON found in script tags used for server rendering. Default false.
        return_embeddings:
          type: boolean
          description: "Add embeddings for the title and description. Needs metadata: true."
        virtual_display:
          type: boolean
          description: Legacy browser setting. Leave it unset.
        redirect_policy:
          allOf:
            - $ref: "#/components/schemas/RedirectPolicy"
          description: How redirects are followed. Default Loose.
        preserve_host:
          type: boolean
          description: Keep the original Host header. Default false.
        filter_output_images:
          type: boolean
          description: Drop images from the output.
        filter_output_svg:
          type: boolean
          description: Drop SVG from the output.
        filter_output_main_only:
          type: boolean
          description: Drop nav, aside and footer from the output. When unset, markdown and text are filtered and raw HTML is the whole page.
        remote_proxy:
          type: string
          description: Your own proxy, as http://user:pass@host:port. Halves the data transfer cost.
        concurrency_limit:
          type: integer
          description: Cap on parallel requests, for sites that slow down under load.
        webhooks:
          allOf:
            - $ref: "#/components/schemas/Webhook"
          description: Where to push results and account events while the crawl runs.
        session:
          type: boolean
          description: Keep headers and cookies across the crawl. Default true.
        block_ads:
          type: boolean
          description: Block ads in the browser. Default true.
        block_analytics:
          type: boolean
          description: Block analytics scripts in the browser. Default true.
        block_stylesheets:
          type: boolean
          description: Block stylesheets in the browser. Default true.
      description: Parameters shared by the content routes. The body is flat JSON.
    ScreenshotRequestParams:
      description: The shared parameters plus the screenshot ones, in one flat body.
      allOf:
        - $ref: "#/components/schemas/RequestParams"
        - type: object
          properties:
            binary:
              type: boolean
              description: Has no effect. The response is always JSON with the image as URL-safe base64 in content.
            full_page:
              type: boolean
              description: Capture the whole page instead of the viewport. Default true.
            block_images:
              type: boolean
              description: Block images while rendering. Default false.
            omit_background:
              type: boolean
              description: Leave the background transparent. Default false.
            cdp_params:
              allOf:
                - $ref: "#/components/schemas/CaptureScreenshotParams"
              description: "Capture settings: format, quality, clip."
    SearchRequestParams:
      description: The shared parameters plus the search ones, in one flat body. The query field is
        search, not query.
      allOf:
        - $ref: "#/components/schemas/RequestParams"
        - type: object
          properties:
            search:
              type: string
              description: The query. Required on /search. On /ai/search the prompt becomes the query when this is
                left out.
            search_limit:
              type: integer
              description: How many results to fetch or crawl. 0 for all.
            fetch_page_content:
              type: boolean
              description: Fetch the content of each result. Default false.
            location:
              type: string
              description: Where the search originates, for example United Kingdom.
            country:
              type: string
              description: Two letter country code, for example us.
            language:
              type: string
              description: Two letter language code, for example en.
            latitude:
              type: number
              format: double
              description: Latitude for a search pinned to coordinates. Send it with longitude. It takes
                precedence over location.
            longitude:
              type: number
              format: double
              description: Longitude for a search pinned to coordinates. Send it with latitude.
            radius:
              type: integer
              description: Bias radius in meters around the coordinates. Default -1, which means unset.
            num:
              type: integer
              description: Maximum results to return.
            page:
              type: integer
              description: Result page number.
            tbs:
              type: string
              description: "Time range: qdr:h, qdr:d, qdr:w, qdr:m or qdr:y."
            quick_search:
              type: boolean
              description: Favor speed over result count. Default true.
            auto_pagination:
              type: boolean
              description: Page through results to reach the requested count. Costs more.
    AIRequestExtras:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          description: What to extract or do, in plain language.
        extraction_schema:
          type: object
          description: The shape of the extracted data, as {"name", "schema"} plus optional description and
            strict. schema is a JSON Schema, sent as an object or a JSON encoded string. A bare JSON Schema
            with no name and schema keys is currently refused with a 400.
          required:
            - name
            - schema
          properties:
            name:
              type: string
              description: A label for the shape, such as product.
            description:
              type: string
              description: What the extraction is for.
            schema:
              description: JSON Schema for the output, as an object or a JSON encoded string.
            strict:
              type: boolean
              description: Ask the model to follow the schema strictly. Not every model supports it. Default
                false.
          example:
            name: product
            schema:
              type: object
              properties:
                name:
                  type: string
                price:
                  type:
                    - number
                    - "null"
              required:
                - name
                - price
        cleaning_intent:
          type: string
          enum:
            - extraction
            - action
            - general
          description: How to clean the page before the model reads it.
    WaitTimeout:
      type: object
      description: A duration. Every wait_for timeout takes this shape.
      required:
        - secs
        - nanos
      properties:
        secs:
          type: integer
        nanos:
          type: integer
      example:
        secs: 10
        nanos: 0
    DeviceType:
      type: string
      enum:
        - mobile
        - tablet
        - desktop
    GPTConfigs:
      type: object
      properties:
        prompt:
          type: string
        max_tokens:
          type: integer
        temperature:
          type: number
        user:
          type: string
        top_p:
          type: number
        prompt_url_map:
          type: object
        extra_ai_data:
          type: boolean
        paths_map:
          type: boolean
        screenshot:
          type: boolean
        api_key:
          type: string
        cache:
          type: object
        json_schema:
          type: object
    ChunkingAlgorithm:
      type: object
      properties:
        type:
          type: string
          enum:
            - bywords
            - bylines
            - bycharacterlength
            - bysentence
        value:
          type: integer
          description: How many words, lines, characters or sentences go in each chunk.
    RedirectPolicy:
      type: string
      enum:
        - Loose
        - Strict
        - None
    RequestType:
      type: string
      enum:
        - smart
        - http
        - browser
        - chrome
        - headless
        - SmartMode
      default: smart
    ReturnFormat:
      type: string
      enum:
        - raw
        - bytes
        - text
        - html2text
        - markdown
        - commonmark
        - xml
        - empty
        - screenshot
    Content:
      oneOf:
        - $ref: "#/components/schemas/ReturnFormat"
        - type: array
          items:
            $ref: "#/components/schemas/ReturnFormat"
    Webhook:
      type: object
      properties:
        destination:
          type: string
          description: The URL that receives the events.
        on_credits_depleted:
          type: boolean
        on_credits_half_depleted:
          type: boolean
        on_website_status:
          type: boolean
        on_find:
          type: boolean
        on_find_metadata:
          type: boolean
    CaptureScreenshotParams:
      type: object
      properties:
        format:
          type: string
        quality:
          type: integer
        clip:
          type: object
        from_surface:
          type: boolean
        capture_beyond_viewport:
          type: boolean
    FeedbackType:
      type: object
      properties:
        comment:
          type: string
        rating:
          type: integer
          minimum: 1
          maximum: 5
    WebsitesType:
      type: object
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
        domain:
          type: string
        crawl_budget:
          type: object
        full_resources:
          type: boolean
        metadata:
          type: boolean
        anti_bot:
          type: boolean
        limit:
          type: integer
        request:
          type: string
          enum:
            - http
            - headless
            - smart
        cron:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        gpt_config:
          type: object
        return_format:
          type: string
        whitelist:
          type: array
          items:
            type: string
          maxItems: 50
          uniqueItems: true
        blacklist:
          type: array
          items:
            type: string
          maxItems: 50
          uniqueItems: true
      required:
        - url
    PagesType:
      type: object
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        url:
          type: string
        domain:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        pathname:
          type: string
        fts:
          type: string
        scheme:
          type: string
        last_checked_at:
          type: string
        screenshot:
          type: boolean
        status_code:
          type: number
    PagesMetadataType:
      type: object
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        url:
          type: string
        domain:
          type: string
        resource_type:
          type: string
        title:
          type: string
        description:
          type: string
        file_size:
          type: number
        embedding:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        pathname:
          type: string
        keywords:
          type: array
          items:
            type: string
        labels:
          type: array
          items:
            type: string
        extracted_data:
          type: object
        fts:
          type: string
        page_insights:
          type: object
    ChatQueryType:
      type: object
      properties:
        customPrompt:
          type: string
        messages:
          type: array
          items:
            type: object
        previewToken:
          type: string
        url:
          type: string
    ContactsType:
      type: object
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        domain:
          type: string
        full_name:
          type: string
        title:
          type: string
        email:
          type: string
        phone_number:
          type: string
        url:
          type: string
        last_checked_at:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        fts:
          type: string
    Error:
      type: object
      description: The body of an error response. Branch on code when it is present. A 400, 401 or 404 can
        arrive with an empty or plain text body.
      required:
        - error
      properties:
        error:
          type: string
          description: What went wrong, in words.
        code:
          type: string
          description: A stable identifier such as credits_required, free_tier_route_blocked or
            ai_subscription_required.
        upgrade_url:
          type: string
          description: Where to add credits or create an account.
        url:
          type: string
          description: Where to pick a plan, on an AI plan refusal.
        status:
          type: integer
          description: The HTTP status, repeated in the body on a 429.
    Costs:
      type: object
      description: What the page cost, in USD. Each key has a _formatted string twin with full precision.
      properties:
        total_cost:
          type: number
        ai_cost:
          type: number
        compute_cost:
          type: number
        file_cost:
          type: number
          description: The page body. Spider counts the bytes of the page as fetched, before converting them
            to your return_format, at 10,000 credits, or $1, per GB. An empty or blocked page pays the 0.01
            credit page minimum instead. The proxy a request goes through can raise the per GB rate. Some
            sites have a minimum price per page, and when a page costs less, Spider adds the difference here.
            return_format does not change file_cost. To lower it, fetch fewer pages with limit, depth,
            blacklist or whitelist, or send your own proxy in remote_proxy, which halves it.
        bytes_transferred_cost:
          type: number
          description: "Bytes beyond the page body at the same rate: response headers, and the scripts and
            images a browser loads."
        transform_cost:
          type: number
    PageResult:
      type: object
      description: One fetched page.
      properties:
        url:
          type: string
          description: The address that was fetched.
        content:
          type: string
          nullable: true
          description: The page in the return_format you asked for. On /screenshot, the image as URL-safe base64.
        status:
          type: integer
          description: The page's own HTTP status. A 200 from the API can carry a page with status 404. A 504
            means the page did not finish loading within the time the request allows. Spider sets 597 itself
            when the page came back with no content to return. An attempt bills for the bandwidth and compute
            it used, whatever status the page returns. A failed page is not free. A blocked or empty page pays
            the 0.01 credit page minimum plus the compute it used, usually a fraction of a cent. Spider does
            not bill bandwidth for bytes it never received.
        error:
          type: string
          nullable: true
          description: Why the page failed, or null.
        duration_elasped_ms:
          type: integer
          description: Time spent on the page in milliseconds. The key is misspelled in the API and this is
            the spelling to read.
        costs:
          allOf:
            - $ref: "#/components/schemas/Costs"
          nullable: true
          description: Null when nothing was billed.
        links:
          type: array
          items:
            type: string
          description: Links found on the page. Present on /links and with return_page_links.
        metadata:
          type: object
          description: "Title, description, keywords and og:image. Present with metadata: true. AI routes put
            extracted_data here."
        css_extracted:
          type: object
          description: Fields from css_extraction_map.
        headers:
          type: object
          description: Response headers. Present with return_headers.
        cookies:
          type: object
          description: Response cookies. Present with return_cookies.
        json_data:
          type: object
          description: JSON found in script tags. Present with return_json_data.
    SearchResultsResponse:
      type: object
      description: Ranked results, returned when fetch_page_content is false.
      properties:
        content:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              description:
                type: string
              url:
                type: string
    TransformResponse:
      type: object
      description: One string for each converted document. An empty input document is skipped. This is
        the one content route that returns an object instead of an array.
      properties:
        content:
          type: array
          items:
            type: string
    CreditsResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
            user_id:
              type: string
              format: uuid
            credits:
              type: number
              description: Credits left. 10,000 credits are $1.
            created_at:
              type: string
            updated_at:
              type: string
    TransformRequestParams:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          description: The documents to convert.
          items:
            type: object
            properties:
              html:
                type: string
                description: The HTML to convert. Send content instead if you prefer that name.
              content:
                type: string
                description: An alternative to html.
              url:
                type: string
                description: Where the HTML came from.
              lang:
                type: string
                description: The language of the document.
        return_format:
          type: string
          enum:
            - markdown
            - commonmark
            - text
            - xml
            - raw
          default: raw
          description: The output format. Use markdown for LLM input.
        readability:
          type: boolean
          description: Reader-mode extraction of the main content before converting.
        clean:
          type: boolean
          description: Remove scripts, styles, comments, hidden elements, iframes and ad or tracking
            elements. Default false.
        clean_full:
          type: boolean
          description: Currently does the same as clean. Default false.
