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-hereThe Authorization: Bearer ak-your-key-here header is also accepted. Get your key from the Dashboard.
Base URL:
https://api.anakin.io/v1Submit 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"}'import requests
response = requests.post(
"https://api.anakin.io/v1/url-scraper",
headers={"X-API-Key": "ak-your-key-here"},
json={"url": "https://example.com"}
)
data = response.json()
print(data["jobId"]) # e.g. "job_abc123xyz"const response = await fetch("https://api.anakin.io/v1/url-scraper", {
method: "POST",
headers: {
"X-API-Key": "ak-your-key-here",
"Content-Type": "application/json"
},
body: JSON.stringify({ url: "https://example.com" })
});
const data = await response.json();
console.log(data.jobId); // e.g. "job_abc123xyz"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"import time
job_id = data["jobId"]
while True:
result = requests.get(
f"https://api.anakin.io/v1/url-scraper/{job_id}",
headers={"X-API-Key": "ak-your-key-here"}
)
job = result.json()
if job["status"] == "completed":
print(job["markdown"])
break
elif job["status"] == "failed":
print(f"Error: {job.get('error')}")
break
time.sleep(3)const jobId = data.jobId;
while (true) {
const res = await fetch(
`https://api.anakin.io/v1/url-scraper/${jobId}`,
{ headers: { "X-API-Key": "ak-your-key-here" } }
);
const job = await res.json();
if (job.status === "completed") {
console.log(job.markdown);
break;
}
if (job.status === "failed") {
console.error(job.error);
break;
}
await new Promise(r => setTimeout(r, 3000));
}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}'response = requests.post(
"https://api.anakin.io/v1/url-scraper",
headers={"X-API-Key": "ak-your-key-here"},
json={
"url": "https://news.ycombinator.com",
"generateJson": True
}
)const response = await fetch("https://api.anakin.io/v1/url-scraper", {
method: "POST",
headers: {
"X-API-Key": "ak-your-key-here",
"Content-Type": "application/json"
},
body: JSON.stringify({
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"}'response = requests.post(
"https://api.anakin.io/v1/search",
headers={"X-API-Key": "ak-your-key-here"},
json={"prompt": "best web scraping libraries 2025"}
)
print(response.json())const response = await fetch("https://api.anakin.io/v1/search", {
method: "POST",
headers: {
"X-API-Key": "ak-your-key-here",
"Content-Type": "application/json"
},
body: JSON.stringify({ prompt: "best web scraping libraries 2025" })
});
console.log(await response.json());