An AI agent reads the web with three calls. It scrapes a URL it already has, searches when it has only a question, and crawls when a task covers a whole site. Each call fills a different amount of the agent’s context, so we sent all three on November 17, 2026 and counted the tokens.
One scrape returned a documentation page as 2,632 tokens of markdown in 1.4 seconds, for $0.00017. One search returned 3 results with their pages in 2.7 seconds, and one crawl returned 63 pages in 3.5 seconds for $0.0138. Cost varies by site. Every page in every answer had status 200. The crawl’s 295,408 tokens belong in storage, outside the prompt.
| Agent step | Call | Tokens returned | Time | Cost |
|---|---|---|---|---|
| A URL the agent already has | /scrape, one page | 2,632 | 1.4 s | $0.00017 |
| A question, no URL yet | /search with fetch_page_content, 3 results | 10,687 | 2.7 s | $0.0019 |
| A whole site, pages unknown | /crawl, 63 pages | 295,408 | 3.5 s | $0.0138 |
One call per row, all on November 17, 2026. Every call asked for markdown with the cache off. The scrape and the crawl were plain HTTP fetches of one documentation site. Tokens are the content fields counted with the o200k_base encoding. Time is the wall time of the call at the client. Cost is the sum of the costs.total_cost fields on the pay as you go meter. The requests printed below leave the cache at its default. The Unlimited plan prices scrape and crawl by requests at once and not by page, from $40 a month for 2 in http mode. Search runs on the pay as you go meter.
The web scraping guide covers what happens inside each fetch.
Ask for markdown before anything else
On ten public pages we fetched on November 5, 2026, the median page was 72,093 tokens as raw HTML and 4,384 as markdown. Page by page, markdown held 15 times fewer tokens at the median, and the ratio ran from 2.9 to 47.
So every request below sets return_format: "markdown". HTML is for an agent that needs a selector or a form field.
When the agent already has the URL
When the user pastes a link, or a search result names the page that matters, the agent needs one page and nothing around it:
curl -s https://api.spider.cloud/scrape \
-H "Authorization: Bearer $SPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://sqlmodel.tiangolo.com/tutorial/connect/create-connected-tables/",
"request": "http", "return_format": "markdown"}'This call returned the page in 1.4 seconds as 2,632 tokens of markdown, for $0.00017. It is the smallest and cheapest answer in the table, which is why an agent should scrape a URL it already has instead of searching for it again.
request: "http" skips JavaScript, which suits documentation and articles. For a page that only renders in a browser, set request: "browser", as step two of the how-to shows. An agent that has to click or type on the page needs its own session in a browser for AI agents.
When the agent has only a question
With fetch_page_content set, one call to the web search API returns the results and their pages together:
curl -s https://api.spider.cloud/search \
-H "Authorization: Bearer $SPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"search": "kubernetes pod disruption budget explained", "search_limit": 3,
"fetch_page_content": true, "return_format": "markdown"}'We sent this query three times, with search_limit at 3, 5 and 10. Each returned exactly the number of results it asked for, every one with status 200 and its page as markdown in the content field.
search_limit | Results with status 200 | Tokens | Time | Cost |
|---|---|---|---|---|
| 3 | 3 | 10,687 | 2.7 s | $0.0019 |
| 5 | 5 | 32,691 | 8.1 s | $0.0032 |
| 10 | 10 | 35,650 | 5.6 s | $0.0039 |
The same day, one call per row, with the query above.
The token totals did not grow in step with the limit. Five results came to 32,691 tokens, about three times the 10,687 of three, because one of the five was a long page of 17,915 tokens. The set of ten did not include that long page, and its largest result was 5,464 tokens. Across the three calls a single result ran from 907 tokens to 17,915.
So the length of each page set the context more than the number of results did. Two rules follow for an agent with a small window. Start at search_limit 3 and ask for more only when the first pages do not answer. And cap the tokens you keep from any one result in your own code, since one long page can outweigh the rest of the answer.
When the task covers a whole site
A task like “answer questions about this library’s docs” covers pages the agent cannot list. This crawl started at the SQLModel homepage and followed its links, up to a limit of 200:
curl -s https://api.spider.cloud/crawl \
-H "Authorization: Bearer $SPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://sqlmodel.tiangolo.com/", "limit": 200, "return_format": "markdown",
"request": "http"}'One call returned 63 pages of the SQLModel documentation in 3.5 seconds for $0.0138. Divided by the 63 pages, that is about $0.00022 a page, a figure we computed. As context it is the largest answer in the table by far. The 63 pages came to 295,408 tokens, with a median page of 3,233 and a largest page of 39,452.
Keep that out of the prompt. Store each page’s content under its url, in files or a chunked index, and let the agent search that store and read the few pages a question needs. Each read then adds one stored page to the context, 3,233 tokens at the median on this site. The crawl returned 63 pages under a limit of 200, so the limit never cut it short. Another post times a crawl against a scrape per URL on one site.
The same calls through MCP
An agent in Claude Code, Codex or another MCP client can make these calls without any HTTP code. The hosted MCP server exposes them as spider_search, spider_scrape and spider_crawl. In Claude Code it is one command:
claude mcp add --transport http spider https://mcp.spider.cloud/mcpThe hosted server registers 27 tools. ChatGPT lists the seven core tools. Give a model that holds all three tools one rule. Search when it has a question, scrape when it has a URL, and crawl a whole site into storage.
Count the tokens on your own pages
Every row is one call on one day, and the scrape and the crawl ran on one documentation site that needs no browser. Run the three requests on the pages your agent will read and count the tokens yourself. To give your agent these calls, create an API key. To read one page the way the agent would get it, open the web scraper and run its URL.
Frequently asked questions
How many tokens does a web search add to an agent's context?
On November 17, 2026 three search calls that also fetched their results as markdown returned 10,687 tokens for 3 results, 32,691 for 5 and 35,650 for 10. The length of the pages set the total more than the number of results did, and a single long page in the set of 5 was 17,915 tokens. Start at 3 results and cap the tokens you keep from each page.
Should an agent search first or scrape first?
Search first when the agent has a question and no URL. Scrape first when it already has the URL, from the user or from an earlier step. On November 17, 2026 one scrape call returned a documentation page as 2,632 tokens of markdown in 1.4 seconds for $0.00017.
When does an agent need a crawl?
When the task covers a whole site and the agent does not know its pages. One crawl call returned 63 pages of a documentation site in 3.5 seconds on November 17, 2026. As markdown they came to 295,408 tokens, so a crawl result belongs in files or an index the agent searches, not in the prompt.
Can an agent use these calls through MCP?
Yes. The hosted Spider MCP server exposes search, scrape and crawl as the spider_search, spider_scrape and spider_crawl tools, among the 27 it registers.
Sources
- Measured run, 2026-11-17, 10:30 to 10:36 UTC: three search calls with fetch_page_content, one scrape call and one crawl call through the Spider API, tokens counted with tiktoken 0.14.0, o200k_base encoding
- Measured run, 2026-11-05: tokens in ten pages as raw HTML and as markdown, o200k_base encoding
- Spider OpenAPI file, the search, scrape and crawl routes and the fetch_page_content, search_limit, limit, request and return_format parameters
- Spider pricing page, the Unlimited plan's price by requests at once
- Spider MCP server documentation, the hosted endpoint and its tools