Quickstart

Create an API key, send one request and read the page back. There is nothing to install: the API is one HTTPS endpoint.

  1. 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.

  2. Store it, never print it

    Keep the key on the server. A page that runs in a browser calls your backend, never the API.

    Shell
    export CRAWLAPI_API_KEY="ck_..."
  3. Send one URL

    One endpoint, three fields: url, format and timeout. format is markdown unless you ask for json.

    curl -sS https://api.crawlapi.dev/v1/scrape \
      -H "Authorization: Bearer $CRAWLAPI_API_KEY" \
      -H 'content-type: application/json' \
      --data '{"url": "https://example.com"}'

    The request is always POST /v1/scrape with a JSON body; any other method answers 405.

  4. Read the response

    A success carries the page and what it cost.

    1 credit
    {
      "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
      }
    }
    Field Holds
    success true on a success, including a sign-in wall
    request_id also in x-request-id; quote it to support
    data.markdown the page’s text, when format is markdown
    data.json the page’s structured data, when format is json
    data.metadata title, description, language, status, final_url, truncated, login_required
    data.links every absolute URL on the page
    usage credits charged and remaining balance
  5. Handle a failure

    A failed request answers success: false and costs nothing. Branch on error.code, and on retryable to decide whether the same request can succeed later; error.doc_url links 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.

esc
↑↓navigate↵openescclose
Dashboard
Get API key