Quick Start: API

Scrape your first page with the REST API using cURL, Python, or JavaScript

Use the AnakinScraper REST API to scrape pages, extract data, and search the web from any language.


Authentication

Every request requires your API key in the X-API-Key header:

X-API-Key: ak-your-key-here

The Authorization: Bearer ak-your-key-here header is also accepted. Get your key from the Dashboard.

Base URL:

https://api.anakin.io/v1

Submit a scrape request

curl -X POST https://api.anakin.io/v1/url-scraper \
  -H "X-API-Key: ak-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Response:

202 Accepted
{
  "jobId": "job_abc123xyz",
  "status": "pending"
}

The job is processed asynchronously. Use the jobId to poll for results.


Poll for results

Jobs typically complete in 3–15 seconds. Poll every 3 seconds until the status is completed or failed.

# Repeat every 3 seconds until status is "completed"
curl https://api.anakin.io/v1/url-scraper/job_abc123xyz \
  -H "X-API-Key: ak-your-key-here"

Completed response:

200 OK
{
  "id": "job_abc123xyz",
  "status": "completed",
  "url": "https://example.com",
  "html": "<html>...</html>",
  "cleanedHtml": "<div>...</div>",
  "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...",
  "cached": false,
  "durationMs": 4200
}

You get back html, cleanedHtml, and markdown — use whichever format fits your pipeline. See Polling Jobs for advanced patterns and intervals.


Go further

Extract structured JSON with AI

Add generateJson: true to have AI extract structured data from any page:

curl -X POST https://api.anakin.io/v1/url-scraper \
  -H "X-API-Key: ak-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://news.ycombinator.com", "generateJson": true}'

The completed response includes a generatedJson field:

{
  "generatedJson": {
    "articles": [
      {
        "title": "Show HN: I built a web scraping API",
        "url": "https://example.com/article",
        "points": 142,
        "author": "user123",
        "comments": 58
      }
    ]
  }
}

Scrape JavaScript-heavy sites

Add useBrowser: true for SPAs and dynamically-loaded pages:

curl -X POST https://api.anakin.io/v1/url-scraper \
  -H "X-API-Key: ak-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/spa", "useBrowser": true}'

Only use browser mode when needed — standard scraping is faster.

Search the web with AI

The Search API is synchronous — results come back immediately, no polling:

curl -X POST https://api.anakin.io/v1/search \
  -H "X-API-Key: ak-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "best web scraping libraries 2025"}'

Next steps