# Crawl API reference: depth, limits and streaming | Spider

Use the Spider Crawl API to crawl a whole site and collect every page in one call. Get markdown, HTML or text back, with depth limits and streaming output.

Canonical: https://spider.cloud/docs/api/crawl/

POST /crawl

The Crawl API starts at one URL and follows links to find every page on the domain. Results stream back as they are found, so you can process pages before the full crawl completes. Set depth limits, page caps and the output format to decide what comes back.

## Parameters

Endpoint Parameters (1)

| Name         | Type   | Default | Description                                                                  |
| ------------ | ------ | ------- | ---------------------------------------------------------------------------- |
| url required | string |         | The URI resource to crawl. This can be a comma split list for multiple URLs. |

Common parameters (79)

Advanced (38) blacklist, block_ads, block_analytics, block_stylesheets, budget, chunking_alg, concurrency_limit, crawl_timeout, data_connectors, depth, disable_first_party_javascript, disable_first_party_stylesheets, disable_first_party_visuals, disable_intercept, event_tracker, exclude_selector, execution_scripts, external_domains, full_resources, max_credits_allowed, max_credits_per_page, metadata, preserve_host, redirect_policy, request, request_timeout, root_selector, run_in_background, session, sitemap, sitemap_only, sitemap_path, subdomains, tld, user_agent, wait_for, webhooks, whitelist

| Name                                     | Type    | Default     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------------------------------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| blacklist optional                       | array   |             | Blacklist a set of paths that you do not want to crawl. You can use regex patterns to help with the list.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| block_ads optional                       | boolean | true        | Block advertisements when running request as `browser` or `smart`. This can greatly increase performance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| block_analytics optional                 | boolean | true        | Block analytics when running request as `browser` or `smart`. This can greatly increase performance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| block_stylesheets optional               | boolean | true        | Block stylesheets when running request as `browser` or `smart`. This can greatly increase performance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| budget optional                          | object  |             | Object that has paths with a counter for limiting the amount of pages. Use `{"*":1}` for only crawling the root page. The wildcard matches all routes and you can set child paths to limit depth, e.g. `{ "/docs/colors": 10, "/docs/": 100 }`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| chunking_alg optional                    | object  |             | Use a chunking algorithm to segment your content output. Pass an object like `{ "type": "bysentence", "value": 2 }` to split the text into an array by every 2 sentences. Works well with markdown or text formats.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| concurrency_limit optional               | number  |             | Set the concurrency limit to help balance request for slower websites. The default is unlimited.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| crawl_timeout optional                   | object  |             | The `crawl_timeout` parameter allows you to put a max duration on the entire crawl. The default setting is 2 mins.The values for the timeout duration are in the object shape `{ secs: 300, nanos: 0 }`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| data_connectors optional                 | object  |             | Stream crawl results directly to cloud storage and data services. Configure one or more connectors to automatically receive page data as it is crawled. Supports S3, Google Cloud Storage, Google Sheets, Azure Blob Storage, and Supabase. `{ s3: { bucket, access_key_id, secret_access_key, region?, prefix?, content_type? }, gcs: { bucket, service_account_base64, prefix? }, google_sheets: { spreadsheet_id, service_account_base64, sheet_name? }, azure_blob: { connection_string, container, prefix? }, supabase: { url, anon_key, table }, on_find: bool, on_find_metadata: bool }`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| depth optional                           | number  | 25          | The crawl limit for maximum depth. If `0`, no limit will be applied.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| disable_first_party_javascript optional  | boolean | false       | Disable the first-party JavaScript allow through downstream blockers (intercept manager, adblock, blocklists). By default first-party scripts pass even when blocklists would skip them. Set to `true` to enforce blocklists strictly even on first-party scripts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| disable_first_party_stylesheets optional | boolean | false       | Disable the first-party stylesheet allow when `block_stylesheets` is on. By default first-party CSS still passes, so SPAs that load their own stylesheets via dynamic imports keep hydrating. That covers React, Next.js, AppFabric, and requirejs-style loaders. Set to `true` for a strict block-all-CSS bandwidth-minimal crawl.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| disable_first_party_visuals optional     | boolean | false       | Disable the first-party visual allow when `block_visuals` / `ignore_visuals` is on. By default first-party images, media, and fonts still pass. Set to `true` for a strictly bandwidth-minimal crawl that drops ALL visuals regardless of origin.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| disable_intercept optional               | boolean | false       | Disable request interception when running request as `browser` or `smart`. This may help with pages that use third-party scripts or external domains.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| event_tracker optional                   | object  |             | Track the event request, responses, and automation output when using browser rendering. Pass in the object with the following `requests` and `responses` for the network output of the page. `automation` will send detailed information including a screenshot of each automation step used under `automation_scripts`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| exclude_selector optional                | string  |             | A CSS query selector to use for ignoring content from the markup of the response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| execution_scripts optional               | object  |             | Run custom JavaScript on certain paths. Requires `browser` or `smart` request mode. The values should be in the shape `"/path_or_url": "custom js"`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| external_domains optional                | array   |             | A list of external domains to treat as one domain. You can use regex paths to include the domains. Set one of the array values to `*` to include all domains.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| full_resources optional                  | boolean |             | Crawl and download all the resources for a website.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| max_credits_allowed optional             | number  |             | Set the maximum number of credits to use per run. This will return a blocked by client if the initial response is empty. Credits are measured in decimal units, where 10,000 credits equal one dollar (100 credits per penny).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| max_credits_per_page optional            | number  |             | Set the maximum number of credits to use per page. Credits are measured in decimal units, where 10,000 credits equal one dollar (100 credits per penny).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| metadata optional                        | boolean | false       | Collect metadata about the content found like page title, description, keywords and etc. This could help improve AI interoperability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| preserve_host optional                   | boolean | false       | Preserve the default HOST header for the client. This may help with pages that require a HOST, and when the TLS cannot be determined.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| redirect_policy optional                 | string  | Loose       | The network redirect policy to use when performing HTTP request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| request optional                         | string  | smart       | The request type to perform. Use `smart` to perform HTTP request by default until JavaScript rendering is needed for the HTML.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| request_timeout optional                 | number  | 60          | The timeout to use for request. Timeouts can be from `5-255` seconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| root_selector optional                   | string  |             | The root CSS query selector to use extracting content from the markup for the response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| run_in_background optional               | boolean | false       | Run the request in the background. Useful if storing data and wanting to trigger crawls to the dashboard.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| session optional                         | boolean | true        | Persist the session for the client that you use on a website. This allows the HTTP headers and cookies to be set like a real browser session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| sitemap optional                         | boolean | false       | Include the sitemap results to crawl.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| sitemap_only optional                    | boolean | false       | Only include the sitemap results to crawl.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sitemap_path optional                    | string  | sitemap.xml | The sitemap URL to use when using `sitemap`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| subdomains optional                      | boolean | false       | Allow subdomains to be included.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| tld optional                             | boolean | false       | Allow TLD's to be included.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| user_agent optional                      | string  |             | Add a custom HTTP user agent to the request. By default this is set to a random agent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| wait_for optional                        | object  |             | The `wait_for` parameter allows you to specify various waiting conditions for a website operation. If provided, it contains the following sub-parameters:The key `idle_network` specifies the conditions to wait for the network request to be idle within a period. It can include an optional timeout value.The key `idle_network0` specifies the conditions to wait for the network request to be idle with a max timeout. It can include an optional timeout value.The key `almost_idle_network0` specifies the conditions to wait for the network request to be almost idle with a max timeout. It can include an optional timeout value.The key `selector` specifies the conditions to wait for a particular CSS selector to be found on the page. It includes an optional timeout value, and the CSS selector to wait for.The key `dom` specifies the conditions to wait for a particular element to stop updating for a duration on the page. It includes an optional timeout value, and the CSS selector to wait for.The key `delay` specifies a delay to wait for, with an optional timeout value.The key `page_navigations`set to `true` then waiting for all page navigations will be handled.If `wait_for` is not provided, the default behavior is to wait for the network to be idle for 500 milliseconds. All of the durations are capped at 60 seconds.The values for the timeout duration are in the object shape `{ secs: 10, nanos: 0 }`. |
| webhooks optional                        | object  |             | Use webhooks to get notified on events like credit depleted, new pages, metadata, and website status. `{ destination: string, on_credits_depleted: bool, on_credits_half_depleted: bool, on_website_status: bool, on_find: bool, on_find_metadata: bool }`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| whitelist optional                       | array   |             | Whitelist a set of paths that you want to crawl, ignoring all other routes that do not match the patterns. You can use regex patterns to help with the list.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

Core (5) disable_hints, limit, max_size, network_blacklist, network_whitelist

| Name                       | Type      | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| disable_hints optional     | boolean   |         | Disables service-provided hints that automatically optimize request types, geo-region selection, and network filters (for example, updating `network_blacklist`/`network_whitelist` recommendations based on observed request-pattern outcomes). Hints are enabled by default for all `smart` request modes.Enable this if you want fully manual control over filtering behavior, are debugging request load order/coverage, or need deterministic behavior across runs.                                                              |
| limit optional             | number    | 0       | The maximum amount of pages allowed to crawl per website. Remove the value or set it to `0` to crawl all pages.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| max_size optional          | number    |         | The max content size in bytes per page response. Content exceeding this limit will be truncated with a smart head/tail strategy that preserves the beginning and end of the content.                                                                                                                                                                                                                                                                                                                                                  |
| network_blacklist optional | string\[] |         | Blocks matching network requests from being fetched/loaded. Use this to reduce bandwidth and noise by preventing known-unneeded third-party resources from ever being requested.Each entry is a string match pattern (commonly a hostname, domain, or URL substring). If both whitelist and blacklist are set, whitelist takes precedence.* Good targets: `googletagmanager.com`, `doubleclick.net`, `maps.googleapis.com`
* Prefer specific domains over broad substrings to avoid breaking essential assets.                        |
| network_whitelist optional | string\[] |         | Allows only matching network requests to be fetched/loaded. Use this for a strict "allowlist-first" approach: keep the crawl lightweight while still permitting the essential scripts/styles needed for rendering and JS execution.Each entry is a string match pattern (commonly a hostname, domain, or URL substring). When set, requests not matching any whitelist entry are blocked by default.* Start with first-party: `example.com`, `cdn.example.com`
* Add only what you observe you truly need (fonts/CDNs), then iterate. |

Output (16) clean_html, css_extraction_map, encoding, filter_images, filter_output_images, filter_output_main_only, filter_output_svg, filter_svg, link_rewrite, readability, return_cookies, return_embeddings, return_format, return_headers, return_json_data, return_page_links

| Name                             | Type            | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------- | --------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| clean_html optional              | boolean         |         | Clean the HTML of unwanted attributes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| css_extraction_map optional      | object          |         | Use CSS or XPath selectors to scrape contents from the web page. Set the paths and the extraction object map to perform extractions per path or page.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| encoding optional                | string          |         | The type of encoding to use like `UTF-8`, `SHIFT_JIS`, or etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| filter_images optional           | boolean         |         | Filter image elements from the markup.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| filter_output_images optional    | boolean         |         | Filter the images from the output.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| filter_output_main_only optional | boolean         | true    | Filter the nav, aside, and footer from the output. When unset, markdown and text are filtered and raw HTML is the whole page. Set true to filter raw HTML too.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| filter_output_svg optional       | boolean         |         | Filter the svg tags from the output.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| filter_svg optional              | boolean         |         | Filter SVG elements from the markup.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| link_rewrite optional            | json            |         | Optional URL rewrite rule applied to every discovered link before it's crawled. This lets you normalize or redirect URLs (for example, rewriting paths or mapping one host pattern to another).The value must be a JSON object with a `type` field. Supported types:* `"replace"` – simple substring replacement. Fields:

  - `host?: string` (optional) – only apply when the link's host matches this value (e.g. `"blog.example.com"`).
  - `find: string` – substring to search for in the URL.
  - `replace_with: string` – replacement substring.

* `"regex"` – regex-based rewrite with capture groups. Fields:

  - `host?: string` (optional) – only apply for this host.
  - `pattern: string` – regex applied to the full URL.
  - `replace_with: string` – replacement string supporting `$1`, `$2`, etc.Invalid or unsafe regex patterns (overly long, unbalanced parentheses, advanced lookbehind constructs, etc.) are rejected by the server and ignored. |
| readability optional             | boolean         | false   | Use [readability](https://github.com/mozilla/readability) to pre-process the content for reading. This may drastically improve the content for LLM usage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| return_cookies optional          | boolean         | false   | Return the HTTP response cookies with the results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| return_embeddings optional       | boolean         | false   | Include OpenAI embeddings for `title` and `description`. Requires `metadata` to be enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| return_format optional           | string \| array | raw     | The format to return the data in. Possible values are `markdown`, `commonmark`, `raw`, `text`, `xml`, `bytes`, and `empty`. Use `raw` to return the default format of the page like `HTML` etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| return_headers optional          | boolean         | false   | Return the HTTP response headers with the results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| return_json_data optional        | boolean         | false   | Return the JSON data found in scripts used for SSR.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| return_page_links optional       | boolean         | false   | Return the links found on each page.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

Config (9) cookies, fingerprint, headers, provider, provider_options, remote_proxy, router, stealth, vendor_credentials

| Name                        | Type                    | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------- | ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| cookies optional            | string                  |         | Add HTTP cookies to use for request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| fingerprint optional        | boolean                 | true    | Give browser requests a complete, consistent browser profile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| headers optional            | object                  |         | Forward HTTP headers to use for all requests. The object is expected to be a map of key value pairs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| provider optional           | string                  |         | Name an outside scraping provider to prefer when Spider's own stack cannot reach a page. `mode` on the router object is where you ask for placement. Pass a provider name such as `zyte`, never a route id. An unknown name is ignored and the request still runs. This is the older top-level form of `router.provider`. Both still work, and `router.provider` wins when both are sent. **Provider routing is still rolling out.** Spider accepts the value on every request. A provider is dispatched on it as the rollout reaches the fleet.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| provider_options optional   | object                  |         | Provider-native settings, keyed by provider name, passed through when that provider handles the request. Keep it top level, outside `router`. Keys named `url`, `api_key`, or `token` inside it are dropped; the target goes in `url` and the key in `router.token` or `router.credentials`. Check the provider's own documentation for the settings it supports. **Provider routing is still rolling out.** Spider accepts the value on every request. A provider is dispatched on it as the rollout reaches the fleet.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| remote_proxy optional       | string                  |         | Use a remote external proxy connection. You also save 50% on data transfer costs when you bring your own proxy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| router optional             | object                  |         | Ask for an outside scraping provider in one object. All five fields are optional. `mode` is `fallback`, which asks for an eligible provider to sit behind Spider's own stack, or `first`, which asks for a provider before Spider. `off` keeps the URL on Spider's own stack and asks no outside provider. `provider` takes one of the eleven names listed under `provider`. `token` is your key for that provider and needs `provider` beside it. `credentials` is a map keyed by credential name, the same shape as `vendor_credentials`. `funding` is `any`, the default, or `own`, which allows only routes your own keys can pay for. Unknown modes and provider names are ignored and the request still runs. See the [provider router setup](https://spider.cloud/docs/api/router/) for examples and precedence. **Provider routing is still rolling out.** Spider accepts the value on every request. A provider is dispatched on it as the rollout reaches the fleet. |
| stealth optional            | boolean                 | true    | Routes the request through a premium residential proxy pool when the target turns away datacenter or standard flat-rate IPs. The serving pool is chosen automatically by health and cost.Reach for it when you see consistent 403s, repeated challenge pages, or "unusual activity" pages on otherwise plain HTML targets. Adds credit cost (residential pools bill at 1.5–2× the flat-rate baseline); leave it off for sites that work without it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| vendor_credentials optional | Record\<string, string> |         | Use your own provider account for the fallback. Supply each key under the provider's own environment variable name, for example `{"ZYTE_API_KEY": "sk-..."}`. The provider bills you directly, so Spider charges its markup and not the provider's fee. Spider reads a key on the request to authenticate that one dispatch. It is never echoed in a response, sent to a webhook, or written to a crawl log. This is the older top-level form of `router.credentials`. Both still work. For the same credential name, `router.token` wins, then `router.credentials`, then this map. **Provider routing is still rolling out.** Spider accepts the value on every request. A provider is dispatched on it as the rollout reaches the fleet.                                                                                                                                                                                                                                    |

Performance (5) cache, delay, respect_robots, service_worker_enabled, skip_config_checks

| Name                            | Type                                                                                         | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------- | -------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| cache optional                  | boolean \| { maxAge?: number; allowStale?: boolean; period?: string; skipBrowser?: boolean } | true    | Use HTTP caching for the crawl to speed up repeated runs. Defaults to `true`.Accepts either:* `true` / `false`

* A cache control object:

  - `maxAge` (ms): freshness window (default: `172800000` = 2 days). Set `0` for always fetch fresh.
  - `allowStale`: serve cached results even if stale.
  - `period`: RFC3339 timestamp cutoff (overrides `maxAge`), e.g. `"2025-11-29T12:00:00Z"`
  - `skipBrowser`: skip browser entirely if cached HTML exists. Returns cached HTML directly without launching Chrome for instant responses.Default behavior by route type:* **Standard routes** (`/crawl`, `/scrape`): cache is `true` with `skipBrowser` enabled by default. Cached pages return instantly without re-launching Chrome. To force a fresh browser fetch, set `cache: false` or `{ "skipBrowser": false }`.
* **AI routes** (`/ai/crawl`, `/ai/scrape`, etc.): cache is `true` but `skipBrowser` is **not** enabled. AI routes always use the browser to ensure live page content for extraction. |
| delay optional                  | number                                                                                       | 0       | Add a crawl delay of up to 60 seconds, disabling concurrency. The delay needs to be in milliseconds format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| respect_robots optional         | boolean                                                                                      | true    | Respect the robots.txt file for crawling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| service_worker_enabled optional | boolean                                                                                      | true    | Allow the website to use [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) as needed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| skip_config_checks optional     | boolean                                                                                      | true    | Skip checking the database for website configuration. This will increase performance for requests that use limit=1.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

Automation (4) automation_scripts, evaluate_on_new_document, scroll, viewport

| Name                              | Type   | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| automation_scripts optional       | object |         | Run custom web automated tasks on certain paths. Requires `browser` or `smart` request mode.Below are the available actions for web automation:* **Evaluate:** Runs custom JavaScript code. `{ "Evaluate": "console.log('Hello, World!');" }`
* **Click:** Clicks on an element identified by a CSS selector. `{ "Click": "button#submit" }`
* **ClickAll:** Clicks on all elements matching a CSS selector. `{ "ClickAll": "button.loadMore" }`
* **ClickPoint:** Clicks at the position x and y coordinates. `{ "ClickPoint": { "x": 120.5, "y": 340.25 } }`
* **ClickAllClickable:** Clicks on common clickable elements (buttons/inputs/role=button/etc.). `{ "ClickAllClickable": true }`
* **ClickHold:** Clicks and holds on an element (via selector) for a duration in milliseconds. `{ "ClickHold": { "selector": "#sliderThumb", "hold_for_ms": 750 } }`
* **ClickHoldPoint:** Clicks and holds at a point for a duration in milliseconds. `{ "ClickHoldPoint": { "x": 250.0, "y": 410.0, "hold_for_ms": 750 } }`
* **ClickDrag:** Click-and-drag from one element to another (selector → selector) with optional modifier. `{ "ClickDrag": { "from": "#handle", "to": "#target", "modifier": 8 } }`
* **ClickDragPoint:** Click-and-drag from one point to another with optional modifier. `{ "ClickDragPoint": { "from_x": 100.0, "from_y": 200.0, "to_x": 500.0, "to_y": 220.0, "modifier": 0 } }`
* **Wait:** Waits for a specified duration in milliseconds. `{ "Wait": 2000 }`
* **WaitForNavigation:** Waits for the next navigation event. `{ "WaitForNavigation": true }`
* **WaitFor:** Waits for an element to appear identified by a CSS selector. `{ "WaitFor": "div#content" }`
* **WaitForWithTimeout:** Waits for an element to appear with a timeout (ms). `{ "WaitForWithTimeout": { "selector": "div#content", "timeout": 8000 } }`
* **WaitForAndClick:** Waits for an element to appear and then clicks on it, identified by a CSS selector. `{ "WaitForAndClick": "button#loadMore" }`
* **WaitForDom:** Waits for DOM updates to settle (quiet/stable) on a selector (or body) with timeout (ms). `{ "WaitForDom": { "selector": "main", "timeout": 12000 } }`
* **ScrollX:** Scrolls the screen horizontally by a specified number of pixels. `{ "ScrollX": 100 }`
* **ScrollY:** Scrolls the screen vertically by a specified number of pixels. `{ "ScrollY": 200 }`
* **Fill:** Fills an input element with a specified value. `{ "Fill": { "selector": "input#name", "value": "John Doe" } }`
* **Type:** Type a key into the browser with an optional modifier. `{ "Type": { "value": "John Doe", "modifier": 0 } }`
* **InfiniteScroll:** Scrolls the page until the end for certain duration. `{ "InfiniteScroll": 3000 }`
* **Screenshot:** Perform a screenshot on the page. `{ "Screenshot": { "full_page": true, "omit_background": true, "output": "out.png" } }`
* **ValidateChain:** Set this before a step to validate the prior action to break out of the chain. `{ "ValidateChain": true }` |
| evaluate_on_new_document optional | string |         | Set a custom script to evaluate on new document creation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| scroll optional                   | number |         | Infinite scroll the page as new content loads, up to a duration in milliseconds. You may still need to use the `wait_for` parameters. Requires `browser` request mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| viewport optional                 | object |         | Configure the viewport for browser requests.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

Geolocation (2) country_code, locale

| Name                  | Type   | Default | Description                                                                                                         |
| --------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------- |
| country_code optional | string |         | Set a ISO country code for proxy connections. View the [locations list](/proxy-locations/) for available countries. |
| locale optional       | string |         | The locale to use for request, example `en-US`.                                                                     |

## Request samples

cURL

```
curl 'https://api.spider.cloud/crawl' \
    -H "Authorization: Bearer $SPIDER_API_KEY" \
    -H 'Content-Type: application/json' \
    -d'{"limit":5,"return_format":"markdown","url":""}'
```

Python

```
import requests, os

headers = {
    'Authorization': f'Bearer {os.getenv("SPIDER_API_KEY")}',
    'Content-Type': 'application/json',
}

json_data = {"limit":5,"return_format":"markdown","url":"https://spider.cloud"}

response = requests.post('https://api.spider.cloud/crawl', 
  headers=headers, json=json_data)

print(response.json())
```

Node.js

```
import https from 'https';

const options = {
  hostname: 'api.spider.cloud',
  port: 443,
  path: '/crawl',
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.SPIDER_API_KEY}`,
    'Content-Type': 'application/json'
  }
};

const req = https.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({"limit":5,"return_format":"markdown","url":""}));
req.end();
```
