/scraperapi:scraperapi-asyncfrom ScraperAPI
Reference for ScraperAPI's Async Jobs REST API: submit background scraping jobs, poll or use webhooks for results, and handle batch jobs. Useful when scraping many URLs or needing non-blocking requests.
Ships in ScraperAPI. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The Async API submits scraping jobs in the background and retries them for up to 24 hours to maximize success. Results are retrieved by polling a status URL or received automatically via webhook.
api.scraperapi.com) — simpler and returns inline.Use Async when: scraping 20+ URLs, the target site is slow or flaky, you want webhook delivery, or you need to scrape PDFs/images.
| Action | Method | URL |
|---|---|---|
| Submit single job | POST | https://async.scraperapi.com/jobs |
| Submit batch (up to 50k) | POST | https://async.scraperapi.com/batchjobs |
| Check / retrieve job | GET | https://async.scraperapi.com/jobs/<jobId> |
| Cancel job | DELETE | https://async.scraperapi.com/jobs/<jobId> |
Auth: apiKey in the JSON request body (note: apiKey camelCase, unlike the Standard API's api_key).
import requests, time
API_KEY = "YOUR_API_KEY"
# Submit
r = requests.post(
"https://async.scraperapi.com/jobs",
json={
"apiKey": API_KEY,
"url": "https://example.com/product/123",
"apiParams": {
"render": True,
"country_code": "us",
}
}
)
job = r.json()
# {"id": "...", "status": "running", "statusUrl": "...", "url": "..."}
# Poll
def poll(status_url, interval=5, max_wait=120):
deadline = time.time() + max_wait
while time.time() < deadline:
data = requests.get(status_url).json()
if data["status"] == "finished":
return data["response"]["body"]
if data["status"] == "failed":
raise RuntimeError(f"Job failed: {data.get('failReason')}")
time.sleep(interval)
raise TimeoutError("Job did not finish in time")
html = poll(job["statusUrl"])
Finished job response shape:
{
"id": "...",
"status": "finished",
"statusUrl": "...",
"url": "https://example.com/product/123",
"response": {
"headers": { "content-type": "text/html", "sa-final-url": "...", "sa-statuscode": "200" },
"body": "<!doctype html>...",
"statusCode": 200
}
}
jobs = requests.post(
"https://async.scraperapi.com/batchjobs",
json={
"apiKey": API_KEY,
"urls": [
"https://example.com/page/1",
"https://example.com/page/2",
# ... up to 50,000
],
"apiParams": {"country_code": "us"}
}
).json()
# Returns a list of {id, status, statusUrl, url} — one per submitted URL
results = [poll(job["statusUrl"]) for job in jobs]
For workloads over 50,000 URLs, split into multiple batch requests. Use webhooks (below) instead of polling when batches are large — polling 10,000 status URLs serially is slow.
Use webhooks to receive results without polling. ScraperAPI POSTs the completed job payload to your URL when the scrape finishes.
requests.post(
"https://async.scraperapi.com/jobs",
json={
"apiKey": API_KEY,
"url": "https://example.com/",
"callback": {
"type": "webhook",
"url": "https://yourapp.com/scraperapi/callback"
}
}
)
Webhook mechanics:
"expectUnsuccessReport": true to also receive failed job payloads.Failed job callback payload:
{
"id": "...",
"attempts": 50,
"status": "failed",
"failReason": "failed_due_to_timeout",
"url": "https://example.com/"
}
{
"apiKey": "YOUR_KEY",
"url": "https://example.com",
"urls": ["url1", "url2"],
"method": "GET",
"headers": { "Accept-Language": "en-US" },
"body": "foo=bar",
"callback": { "type": "webhook", "url": "https://..." },
"expectUnsuccessReport": false,
"timeoutSec": 600,
"meta": { "jobLabel": "batch-42" },
"apiParams": {
"autoparse": false,
"country_code": "us",
"keep_headers": false,
"device_type": "desktop",
"follow_redirect": true,
"premium": false,
"ultra_premium": false,
"render": false,
"wait_for_selector": ".content",
"screenshot": false,
"retry_404": false,
"output_format": "html",
"max_cost": 10
}
}
| Parameter | Type | Purpose |
|---|---|---|
expectUnsuccessReport | boolean | Receive webhook payload for failed jobs too |
timeoutSec | integer | Override default job timeout (seconds) |
meta | object | Custom metadata — echoed back in every response/callback for correlation |
meta is especially useful for tracking which batch or workflow a job belongs to:
{ "meta": { "batchId": "run-2024-06", "sourceFile": "urls.csv" } }
requests.post(
"https://async.scraperapi.com/jobs",
json={
"apiKey": API_KEY,
"url": "https://api.example.com/search",
"method": "POST",
"headers": {"content-type": "application/x-www-form-urlencoded"},
"body": "query=scraperapi&page=1",
}
)
When the target URL returns binary content, the response body is Base64-encoded in
response.base64EncodedBody.
import base64
r = requests.post(
"https://async.scraperapi.com/jobs",
json={"apiKey": API_KEY, "url": "https://example.com/report.pdf"}
)
job = r.json()
# ... wait or poll ...
result = requests.get(job["statusUrl"]).json()
pdf_bytes = base64.b64decode(result["response"]["base64EncodedBody"])
with open("report.pdf", "wb") as f:
f.write(pdf_bytes)
Job results are stored for up to 72 hours (24 hours guaranteed) after the job finishes. After that, the data is deleted — resubmit the job if you need it again.
Retrieve results before the retention window closes. For long pipelines, prefer webhooks so results are pushed to your system immediately upon completion.
| Status | Meaning | Action |
|---|---|---|
Job finished, statusCode: 200 | Success | Use response.body |
Job finished, statusCode: 500 | Scrape failed after retries (not charged), often anti-bot | Resubmit with premium: true, then ultra_premium: true, in apiParams |
Job failed, failReason: failed_due_to_timeout | Timed out after 24h retries | Check if target is reachable; try render: false |
| HTTP 401 on submission | Bad API key | Check your API key |
| HTTP 403 on submission | Credits exhausted for this billing cycle | Upgrade or enable overages at https://dashboard.scraperapi.com/billing; do not retry |
| HTTP 429 on submission | Too many concurrent submissions | Back off and re-submit in batches |
Use max_cost in apiParams to cap per-request credit spend — requests that would exceed the
cap return a 403 rather than consuming more credits than expected.
The Async API uses the same credit costs as the Standard API:
| Request type | Credits |
|---|---|
| Standard | 1 |
render: true | 10 |
premium: true | 10 |
premium: true + render: true | 25 |
ultra_premium: true | 30 |
ultra_premium: true + render: true | 75 |
| Failed jobs | 0 |
Those are the costs on a normal site. Some sites cost more per request, before any parameters:
| Site | Credits |
|---|---|
| Amazon, Walmart, eBay | 5 |
| Google, Bing (all subdomains) | 25 |
| 30 | |
| Sites behind Cloudflare, DataDome, PerimeterX or Akamai | 10 |
You're charged for 200 and 404 responses, and for requests you cancel before ScraperAPI's 70s
of retries finish. Each response's sa-credit-cost header shows what it cost; preview a cost
without spending credits with GET https://api.scraperapi.com/account/urlcost?api_key=...&url=...
(it accepts the same parameters). Source: https://docs.scraperapi.com/getting-started/quick-start/credits-and-requests-costs
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub scraperapi/scraperapi-skills --plugin scraperapi20 skills in this plugin
/scraperapi-agent-onboardingEntry point for agents and developers new to ScraperAPI. Read first when integrating ScraperAPI into an agent or app, setting up the MCP server for Claude Code or other LLM tools, choosing the right ScraperAPI product, or getting an API key. Trigger on: "how do I use ScraperAPI", "set up ScraperAPI", "connect ScraperAPI to Claude", "which ScraperAPI product should I use", "get web data for my agent", "add web scraping to my project", "ScraperAPI getting started". After reading, route to the narrower skill that owns the chosen path. If the user already named a language or SDK, n8n, Zapier, or the sapi CLI, use that skill directly instead.
Note: Transmits user-supplied queries, URLs, and content to ScraperAPI.
/scraperapi-cliReference for the official ScraperAPI command-line tool (`sapi`, package `scraperapi-cli`). Use this skill whenever the user wants to scrape, run async jobs, fetch structured data or check credits from a terminal or shell script. Trigger on: "scrape this URL from the terminal", "use sapi to fetch X", "ScraperAPI CLI", "ScraperAPI from bash", "sapi scrape", "sapi jobs", "pipe ScraperAPI into jq", "scrape from a Makefile / cron / CI", "check my ScraperAPI credits from the command line", "scrape 10000 URLs from a file". Covers install, auth, commands, JSON and piping behaviour, cost checks and shell recipes. Not for writing scraper code: for a new scraper script use scraperapi-scraper-builder, and for code that calls ScraperAPI use the language's SDK skill.
Note: Transmits user-supplied queries, URLs, and content to ScraperAPI.
Other plugins' skills for the same job