-
Create a key
Sign in at app.crawlapi.dev/keys and create one. It starts with
ck_and is shown once; a lost key is revoked and replaced. -
Store it, never print it
Keep the key on the server. A page that runs in a browser calls your backend, never the API.
Shellexport CRAWLAPI_API_KEY="ck_..." -
Send one URL
One endpoint, three fields:
url,formatandtimeout.formatismarkdownunless you ask forjson.curl -sS https://api.crawlapi.dev/v1/scrape \ -H "Authorization: Bearer $CRAWLAPI_API_KEY" \ -H 'content-type: application/json' \ --data '{"url": "https://example.com"}'import os, httpx body = httpx.post( "https://api.crawlapi.dev/v1/scrape", headers={"Authorization": f"Bearer {os.environ['CRAWLAPI_API_KEY']}"}, json={"url": "https://example.com"}, timeout=60.0, ).json() print(body["data"]["markdown"])const response = await fetch('https://api.crawlapi.dev/v1/scrape', { method: 'POST', headers: { Authorization: 'Bearer ' + process.env.CRAWLAPI_API_KEY, 'content-type': 'application/json', }, body: JSON.stringify({ url: 'https://example.com' }), }); const body = await response.json(); console.log(body.data.markdown);The request is always
POST /v1/scrapewith a JSON body; any other method answers405. -
Read the response
A success carries the page and what it cost.
{ "success": true, "request_id": "req_1dc0a514d6ee71c4524b", "data": { "metadata": { "title": "Example Domain", "description": "", "language": "en", "status": 200, "final_url": "https://example.com/" }, "links": [], "markdown": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes." }, "usage": { "credits": 1, "remaining": 9999 } }{ "success": false, "request_id": "req_fe9963033461e4fcc81c", "error": { "code": "NOT_FOUND", "message": "The site says this page does not exist (HTTP 404).", "retryable": false, "doc_url": "https://docs.crawlapi.dev/errors#NOT_FOUND", "target_status": 404 } }Field Holds successtrueon a success, including a sign-in wallrequest_idalso in x-request-id; quote it to supportdata.markdownthe page’s text, when formatismarkdowndata.jsonthe page’s structured data, when formatisjsondata.metadatatitle, description, language, status, final_url,truncated,login_requireddata.linksevery absolute URL on the page usagecreditscharged andremainingbalance -
Handle a failure
A failed request answers
success: falseand costs nothing. Branch onerror.code, and onretryableto decide whether the same request can succeed later;error.doc_urllinks to the code’s entry, with what to do.Failures cost 0 credits Challenge pages, 404s and empty shells come back as a code, never as a success. See Errors and retries.
Quickstart
Create an API key, send one request and read the page back. There is nothing to install: the API is one HTTPS endpoint.