Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- This is the hosted service built on the open-source crawl4ai library. The legacy v1 API (sessions, scan, site, enrich, context) was shut down on 2026-11-06.
- Every call costs credits (1 credit = $0.001; a cached result costs half). Response headers x-c4-cost and x-c4-balance give the charge and the exact balance; GET /v1/prices is the live price table.
- Free plan: 10 requests a minute, 2 at a time, 1,000 credits a month; over the pace limit is 429, out of credit is 402 no_credit, over the month’s plan allowance 402 plan_cap.
- Failed fetches (403 blocked or login-wall, 502 no-answer or origin-error, 503 busy, 500) are not charged.
- Batches (/scrape/batch, /scrape/jobs), recipe jobs, /price and the billing top-up (charges a saved card) are not in this entry.
Endpoints
Scrape a page
- A read over POST.
- Most pages answer in 1-2 s; a page that needs a real browser takes 10-60 s, up to 90 s. Use a 120 s client timeout.
- The answer says which engine served it and the steps tried (ladder).
Extract structured data
- A read over POST. Give an instruction, a schema, or both.
- Returns {ok, url, data, usage.total_tokens, ms}.
Search the web
- source gg or gs is a live web result; index is from Crawl4AI’s own index, added when the web returns fewer than 10.
Get Google results as data
- Beta. 1 credit per Google page fetched live (num=100 is up to 10 credits); a cached page costs half.
- position is the organic rank; position_absolute counts every numbered item on the page, as rank trackers do.
Answer a question
- Experimental: the shape may change.
- 1 credit for an answer found directly (a Google AI overview or AI mode), 3 when Crawl4AI’s model wrote it, nothing when answered is false.
- When the question asks for JSON, answer.text is a JSON string: parse it.
List recipes
- Free. Read a recipe’s inputs and output_about here before running it; never guess a recipe name.
- Run one with a raw POST /recipes/{name} whose JSON body is the recipe’s inputs as top-level fields (e.g. {“product”:“B0BSHF7WHW”,“limit”:20}); it costs usage.units credits (1 per call plus 1 per page) and can take up to 300 s. Inputs marked secret take the user’s own login cookies: never fill them unasked.
Get credit balance
- Trails the per-call x-c4-balance header by about a minute.