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.
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 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
| Endpoint | Purpose |
|---|---|
/crawl | Start from a URL, follow links, return content for each page |
/scrape | Fetch a single URL and return its content. The web scraping API page shows one recorded response |
/search | Search the web and optionally scrape the results |
/screenshot | Capture a full-page screenshot as base64 PNG |
/links | Get the link graph for a URL |
/pipeline/extract-contacts | Extract contact information from pages |
Request modes
The request parameter controls how Spider fetches each page:
| Mode | When to use |
|---|---|
smart (default) | Automatically picks HTTP or Chrome based on page requirements |
http | Static pages, sitemaps, APIs. Fastest and cheapest |
browser | SPAs, 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:
| Format | Output | Best for |
|---|---|---|
raw | Original HTML | Parsing with your own tools |
markdown | Clean markdown | LLM ingestion, RAG pipelines |
text | Plain text | Search indexing, NLP tasks |
bytes | Raw bytes | Binary 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:
- Python SDK:
pip install spider_client - JavaScript SDK:
npm install @spider-cloud/spider-client - Rust SDK:
cargo add spider-client
Spider also works as a document loader in LangChain, LlamaIndex, CrewAI and other AI frameworks.
Getting set up
- Register or sign in.
- Purchase credits. Pay-as-you-go at $1 per 10,000 credits.
- Create an API key on the API keys page.
- Start making requests.
Track your usage on the usage page.