AI web crawler API

# AI web crawler: any web page to clean data for your LLM.

An AI web crawler fetches web pages and returns them in a form a language model can read: clean Markdown, or JSON with the fields you name. Crawl4AI Cloud is the hosted API of the open-source Crawl4AI crawler. You send one HTTP request to `https://api.crawl4ai.com`. It picks a plain fetch or a real browser, removes menus and scripts, and returns the page. A failed call costs nothing.

Last checked 23 November 2026 · prices from [GET /v1/prices](https://api.crawl4ai.com/v1/prices)

Do it now with your agent

## One prompt, and your agent can read the web

Copy this, paste it into your coding agent (Claude Code, Cursor, Codex), add your API key, run it.

```text
Set up Crawl4AI Cloud as the web crawler for this project.

CRAWL4AI CLOUD
- Read the API reference for agents first: https://crawl4ai.com/llms.txt
- Base URL: https://api.crawl4ai.com
- Header on every call: Authorization: Bearer $CRAWL4AI_KEY
- My API key: YOUR_CRAWL4AI_API_KEY
  (no key yet: get a free key at https://crawl4ai.com/signin/)
- Put the key in the environment variable CRAWL4AI_KEY. Never write it into a file in the repository.
- If you are an MCP client, add the tools instead of HTTP:
  claude mcp add --transport http crawl4ai https://api.crawl4ai.com/mcp --header "Authorization: Bearer $CRAWL4AI_KEY"

STEPS
1. Check the key: GET /v1/billing/balance. Show me the balance.
2. Read one page: POST /scrape {"url": "https://example.com", "format": "md"}.
   Show me the first 20 lines of "markdown", and the "engine" and "ms" fields.
3. Pull fields: POST /extract {"url": "https://news.ycombinator.com",
   "instruction": "the top 5 stories", "schema": {"type": "array", "items": {"type": "object",
   "properties": {"title": {"type": "string"}, "url": {"type": "string"}}}}}. Show me "data".
4. Search: GET /search?q=open+source+web+crawler. Show me the first 3 titles and URLs.
5. Write a small helper module (crawl4ai_client) with scrape(url), extract(url, instruction, schema)
   and search(q). Set the HTTP timeout to 120 seconds. On 503 "busy", wait 5 seconds and try again,
   at most 3 times. On 403 or 502, return the reason; do not retry.

Failed calls are not charged. Show me the credits each step cost (the x-c4-cost header).
```

## What is an AI web crawler?

A classic crawler downloads HTML and follows links. An AI web crawler does the same, then makes the page ready for a model. It removes the menus, scripts, styles and cookie banners. It keeps the headings, lists, tables and links. It returns Markdown, which uses fewer tokens than HTML. It can also read the page with a language model and return only the fields you ask for, as JSON.

Many pages now build their content with JavaScript. A plain fetch gets an empty shell. An AI web crawler must run a real browser for those pages, and skip the browser for the rest, because a browser is slow and costs more.

Crawl4AI Cloud does each of these steps behind one API. The sections below show each call with a real request. Agents can read the whole API from one file: [crawl4ai.com/llms.txt](https://crawl4ai.com/llms.txt).

## Read one page as Markdown: /scrape

Send a URL. The service picks the cheapest engine that works for that site: our archive, a plain fetch, then a browser. Most pages return in 1 to 2 seconds. A page that needs a real browser usually takes 10 to 60 seconds, so set your HTTP client timeout to 120 seconds.

```bash
curl https://api.crawl4ai.com/scrape \
  -H "Authorization: Bearer $CRAWL4AI_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://docs.crawl4ai.com/core/quickstart/","format":"md"}'
```

The answer carries `markdown`, a `content_hash` of the content, the `engine` that served the page and the `ms` it took. Add `"parse":{"links":true,"tables":true}` to also get the links and tables as data. See [the /scrape docs](https://crawl4ai.com/docs/scrape/).

## Pull the fields you need: /extract

Give a URL (or your own text) and say what you want, in plain English, as a JSON schema, or both. A language model reads the page and returns typed data that matches the schema.

```bash
curl https://api.crawl4ai.com/extract \
  -H "Authorization: Bearer $CRAWL4AI_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://news.ycombinator.com",
       "instruction":"the top stories on the front page",
       "schema":{"type":"array","items":{"type":"object","properties":{
         "title":{"type":"string"},"points":{"type":"integer"},"url":{"type":"string"}},
         "required":["title","points"]}}}'
```

The answer is `{"ok":true,"url":"...","data":[...],"usage":{"total_tokens":N},"ms":...}`. You pay for the page and the model's tokens; the answer shows the token count. See [the /extract docs](https://crawl4ai.com/docs/extract/).

## Search the web: /search and /serp

`GET /search` returns ranked results with title, URL and snippet. Add `deep=1` and it also reads the top 10 result pages and puts each page's text in its result. A search costs 1 credit. With `deep=1`, each page whose text comes back adds 0.1 credit (up to 1 more credit for 10 pages), and your balance must cover the search plus 10 pages before it starts.

```bash
curl "https://api.crawl4ai.com/search?q=open+source+web+crawler&deep=1" \
  -H "Authorization: Bearer $CRAWL4AI_KEY"
```

`GET /serp` (beta) returns Google's results page as data: true ranks, every block on the page, and the place the page was set to. It is for rank tracking and SEO tools. It costs 1 credit per Google page fetched live.

```bash
curl "https://api.crawl4ai.com/serp?q=web+crawler+api&country=us&num=20" \
  -H "Authorization: Bearer $CRAWL4AI_KEY"
```

## Ask a question, get an answer with sources: /answer

`GET /answer` (experimental) returns a direct answer and the pages it used. Ask for the shape you want in the question, or send a JSON schema. When there is no answer, `answered` is false and the call is free.

```bash
curl -G "https://api.crawl4ai.com/answer" \
  --data-urlencode 'q=Who maintains the Crawl4AI open-source library? Answer with JSON only: {"maintainer": string, "source_url": string}' \
  -H "Authorization: Bearer $CRAWL4AI_KEY"
```

An answer found directly costs 1 credit. An answer our model wrote from the pages costs 3. See [the /answer docs](https://crawl4ai.com/docs/answer/).

## Crawl a whole site: /scan and /site

`POST /scan` lists the URLs of a site from its sitemaps and its home page links, in one call, without crawling it. Use it to plan a crawl.

```bash
curl https://api.crawl4ai.com/scan \
  -H "Authorization: Bearer $CRAWL4AI_KEY" -H "Content-Type: application/json" \
  -d '{"domain":"docs.crawl4ai.com","max_urls":500,"include":"/core"}'
```

`POST /site` crawls a site level by level from a start URL and returns every page as Markdown. It runs as a job: you submit it, check its status, then read the rows. Up to 5 levels and 500 pages.

```bash
curl https://api.crawl4ai.com/site \
  -H "Authorization: Bearer $CRAWL4AI_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://docs.crawl4ai.com/","depth":2,"max_pages":50,"include":"/core"}'
```

Then `GET /site/jobs/{id}` until `status` is `done`, and `GET /site/jobs/{id}/results` for the pages. Each page is billed like a `/scrape` of that page. See [the /site docs](https://crawl4ai.com/docs/site/).

## Use a ready-made scraper: recipes

A recipe is a tested scraper for one site and one task. You send its inputs and get rows back, with the same named columns every time. There are recipes for Amazon, eBay, Walmart, Zillow, Booking, Airbnb, Yelp, YouTube, GitHub, LinkedIn, Yahoo Finance and more. Check the list before you write your own scraper for one of these sites.

```bash
curl https://api.crawl4ai.com/recipes/youtube-video \
  -H "Authorization: Bearer $CRAWL4AI_KEY" -H "Content-Type: application/json" \
  -d '{"video":"dQw4w9WgXcQ"}'
```

`GET /recipes` (free) lists every recipe with its inputs and columns. Browse them on [the recipes page](https://crawl4ai.com/recipes/).

## Know when a page changes: Watch

Watch (in beta) checks a page for you and tells you when it changes in the way you describe. Each change comes back as typed facts (what changed, from what, to what) with links to both versions of the page.

```bash
curl https://api.crawl4ai.com/monitors \
  -H "Authorization: Bearer $CRAWL4AI_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://competitor.com/pricing",
       "watch":"a plan gets more expensive, or a plan is removed",
       "every":"auto",
       "notify":{"webhook":"https://you.example/hook","secret":"s3cr3t"}}'
```

A check costs 1 credit (2 credits with a fixed interval under 1 hour). A confirmed change that matched costs 3. See [the Watch docs](https://crawl4ai.com/docs/watch/).

## Use it from your agent: MCP

In Claude Code, Cursor, Codex or any MCP client, add the hosted MCP server once. The agent then has `scrape`, `extract`, `search`, `answer`, `batch` and the recipe tools, with no install.

```bash
claude mcp add --transport http crawl4ai https://api.crawl4ai.com/mcp \
  --header "Authorization: Bearer $CRAWL4AI_KEY"
```

Setup for other clients is in [the MCP docs](https://crawl4ai.com/docs/mcp/).

## What does it cost?

You pay for the effort each call needed. A failed call costs nothing. One credit is $0.001 at list price.

| Call | Credits |
|---|---|
| /scrape, a page already in our archive | 0.05 |
| /scrape, a plain fetch | 0.1 |
| /scrape, a real browser | 0.5 |
| /scrape, a hard site (the site fought back) | 2 |
| /search | 1 |
| /serp, per Google page fetched live | 1 |
| /answer | 1, or 3 when our model wrote it |
| Watch, per check (fixed interval under 1 hour) · per matched change | 1 (2) · 3 |
| A failed call (blocked, no answer, timeout) | 0 |

From GET /v1/prices, read 23 November 2026. /extract adds the model's tokens to the page. /scan and /site add each page they read, priced like /scrape.

The free plan gives 1,000 credits every month, with no card. Paid plans: Starter $10 a month with 10,000 credits, Builder $99 with 125,000, Scale $499 with 750,000. See [pricing](https://crawl4ai.com/pricing/) and [the credits docs](https://crawl4ai.com/docs/credits/).

## Should I run the open-source crawler or use the API?

Crawl4AI Cloud runs the same engine as the open-source [Crawl4AI library](https://github.com/unclecode/crawl4ai). The library gives the same Markdown on your own machine, for free. You then run the browsers, buy the proxies and handle the sites that block you. The API does that part and charges only for calls that worked.

For a few sites with no blocks, the library is often enough. For many sites, pages that need a browser, or sites that block plain requests, compare the numbers on [build vs buy](https://crawl4ai.com/build-vs-buy/). To see how the API compares with Firecrawl, Apify, Tavily and others, read [the comparisons](https://crawl4ai.com/compare/).

## Questions

### What is an AI web crawler?

A crawler that fetches web pages and gives them back in a form a language model can use: clean Markdown, or JSON fields you name. It drops menus, scripts and cookie banners, keeps headings, lists, tables and links, and uses a real browser only when a page needs one.

### Is Crawl4AI Cloud the same as the open-source Crawl4AI?

It runs the same engine, written by the same team. The open-source library runs on your own machine for free; you then run the browsers and proxies. Crawl4AI Cloud is the hosted API: you send an HTTP request and we run that part.

### Can I get JSON instead of Markdown?

Yes. `POST /extract` reads a page and returns the fields you describe, in plain English, as a JSON schema, or both. For many popular sites a recipe returns fixed columns with no schema to write.

### Does it read pages that need JavaScript?

Yes. `/scrape` tries a plain fetch first and moves to a browser only when the page needs one. The `engine` field of the answer says which one served the page. A browser page costs 0.5 credit instead of 0.1.

### Do I pay for pages that fail?

No. A blocked page, a login wall, a site that does not answer, a timeout and our own errors are not charged.

### Do you train models on the pages I fetch?

No. The pages you fetch and the instructions you send are used only to answer your request. We do not sell customer data. See the [security page](https://crawl4ai.com/security/).

Next: [web crawling API](https://crawl4ai.com/web-crawling-api/) · [compare](https://crawl4ai.com/compare/) · [build vs buy](https://crawl4ai.com/build-vs-buy/) · [web scraping for RAG](https://crawl4ai.com/use-cases/rag/) · [API docs](https://crawl4ai.com/docs/)
