Skip to main content
Guides / Spider API: endpoints, quick start and SDKs
API knowledge transfer icon.

Send the Spider API a URL and get each page back as markdown

For developers who feed web pages to their own code or to an LLM: the endpoints, request modes, output formats and SDKs for Python, JavaScript and Rust.

• 2 min read •

One POST to /crawl follows the links from a URL and streams each page back as its own JSON line, already in markdown. This request is one we sent, field for field.

From $0.16 per 1,000 pages on light static pages, pay as you go. Cost varies by site.

POST /crawl Sent September 9, 2026
curl https://api.spider.cloud/crawl \
  -H "Authorization: Bearer $SPIDER_API_KEY" \
  -H "Content-Type: application/jsonl" \
  -d '{"url": "https://doc.rust-lang.org/book/", "limit": 30, "return_format": "markdown", "request": "smart", "country_code": "de", "whitelist": ["doc\\.rust-lang\\.org/book/"], "blacklist": ["print\\.html", "/stable/"]}'

HTTP 200, 30 pages of markdown, 319 KB in all

First page back, /book/, first 3 lines of its markdown 1,482 B in all at 5.0 s

# The Rust Programming Language
*by Steve Klabnik, Carol Nichols, and Chris Krycho, with contributions from the
Rust Community*

Quick start

The same crawl of the Rust book in Python. Each page arrives as one JSON line, and the loop prints it before the crawl ends.

import requests, json, os

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

response = requests.post('https://api.spider.cloud/crawl',
  headers=headers,
  json={
      "url": "https://doc.rust-lang.org/book/",
      "limit": 30,
      "return_format": "markdown",
      "request": "smart",
      "country_code": "de",
      "whitelist": [
          "doc\\.rust-lang\\.org/book/"
      ],
      "blacklist": [
          "print\\.html",
          "/stable/"
      ]
  },
  stream=True
)

for line in response.iter_lines(decode_unicode=True):
    if line:
        page = json.loads(line)
        print(page['url'], page['status'], len(page['content']))
What this request returned Captured on : HTTP 200, 30 pages of markdown, 319 KB in all. The first page arrived after 5.0 s and the stream closed after 21.5 s.
Page Status Bytes Arrived
/ 200 1,482 5.0 s
/ch01-01-installation.html 200 6,012 8.3 s
/appendix-05-editions.html 200 3,293 8.3 s
/appendix-06-translation.html 200 2,237 8.3 s
/foreword.html 200 3,072 8.4 s

What the API does

You send a URL and a few settings. You get back each page as HTML, markdown, plain text or JSON.

The API handles proxy rotation, JavaScript rendering, rate limits and protected pages for you.

What the API handles

Proxies
Residential proxies rotate, and a failed IP fails over to another.
Concurrency
The Rust engine fetches the pages of one crawl in parallel.
Smart mode
The default. Each page gets plain HTTP or a browser, whichever it needs. Set request to http or browser to choose yourself.
Caching
On by default. It helps only a repeat crawl of pages already fetched, and you can turn it off per request.
Formats
Markdown, HTML, plain text or raw bytes, set with return_format.
Extraction
Opt in per request. An LLM step pulls structured fields from a page and bills on top of the fetch.
Hard pages
A real browser profile and proxy rotation keep blocks down.

See the full API reference for every endpoint and parameter.

Endpoints

EndpointPurpose
/crawlStart from a URL, follow links, return content for each page
/scrapeFetch a single URL and return its content. The web scraping API page shows one recorded response
/searchSearch the web and optionally scrape the results
/screenshotCapture a full-page screenshot as base64 PNG
/linksGet the link graph for a URL
/pipeline/extract-contactsExtract contact information from pages

Request modes

The request parameter controls how Spider fetches each page:

ModeWhen to use
smart (default)Automatically picks HTTP or Chrome based on page requirements
httpStatic pages, sitemaps, APIs. Fastest and cheapest
browserSPAs, JS-rendered content, pages behind Cloudflare or similar protections (the legacy value chrome still works)

Output formats

Set return_format to control what you get back:

FormatOutputBest for
rawOriginal HTMLParsing with your own tools
markdownClean markdownLLM ingestion, RAG pipelines
textPlain textSearch indexing, NLP tasks
bytesRaw bytesBinary content, downloads

For AI workflows, markdown strips navigation, ads, and boilerplate, giving you just the page content.

Streaming large crawls

The quick start already streams. With Content-Type set to application/jsonl and stream=True in your HTTP client, each page arrives as its own line, so you can work on it before the crawl ends.

For a larger crawl, raise limit and set max_credits_allowed to cap what the crawl can spend. The streaming docs cover the rest.

SDK libraries

Official SDKs handle authentication and provide typed methods for all endpoints:

Spider also works as a document loader in LangChain, LlamaIndex, CrewAI and other AI frameworks.

Getting set up

  1. Register or sign in.
  2. Purchase credits. Pay-as-you-go at $1 per 10,000 credits.
  3. Create an API key on the API keys page.
  4. Start making requests.

Track your usage on the usage page.

Run this on a page you care about

The playground sends the request this page describes and shows you the response. Keyless runs work without an account and are rate limited.