/scraperapi:scraperapi-scraper-builderfrom ScraperAPI
Generates production-ready Python or Node.js scrapers using ScraperAPI. Probes target sites, decides structured endpoint vs. raw HTML, JS rendering, proxy tier, and sync vs. async batch, then outputs a complete script with retries, error handling, pagination, and credit estimates.
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.
Read when SKILL.md points to them.
Build production-quality scrapers using ScraperAPI. Work through four phases: gather requirements, probe the target site, make architecture decisions, then generate a complete runnable script.
Before writing code, collect the following. Pull from the user's prompt; ask only what is missing.
| Info | Default if not specified |
|---|---|
| Target URL or website | Required — ask if missing |
| Data fields to extract | Ask if vague ("product info" → which fields exactly?) |
| Volume | Infer: single URL / paginated / bulk list of URLs |
| Language | Ask if not clear from context; Python is a reasonable default |
| Output format | stdout JSON |
| Geo-targeting needed? | Infer from site type; confirm for e-commerce pricing |
Before making any architecture decisions, fetch 1–2 sample pages from the target site using ScraperAPI to observe actual behavior. This replaces guesswork with evidence and costs 1–2 requests at the site's rate (1 credit on a normal site, 5 on Amazon, 25 on Google, 10 behind Cloudflare and similar).
Fetch at most two pages:
Always start with a standard request (no render, no premium) — the cheapest probe:
GET https://api.scraperapi.com/?api_key=YOUR_API_KEY&url=<target_url>
1. Response status
| Status | Meaning |
|---|---|
| 200 | Proceed to content analysis |
200 + body has "Just a moment", cf-ray, or "Cloudflare" | Cloudflare challenge page got through |
| 200 + body has "DataDome", "PerimeterX", or "Akamai" | Bot manager detected |
| 500 | ScraperAPI retried for 70s and still failed (not charged); anti-bot protection likely, premium proxies likely needed |
| 403 | Account is out of credits; says nothing about the site. Stop and tell the user |
| 429 | Rate limited; note for architecture phase |
2. Content completeness (for 200 responses)
Signals that render=true will be needed:
<div id="root"></div>, <div id="app"></div>, <div id="__next"></div> with no children<script> tags: _next, __nuxt__, react, vue, angular<script> and <div> tags with little visible textIf the target data is visibly present in the raw HTML → standard rendering is sufficient, do not enable render.
3. Pagination structure
Look for the site's pagination scheme in <a> hrefs and link tags:
<a rel="next"> or <link rel="next"> → follow-the-next-link pattern?page=N, ?p=N, /page/N/ in hrefs → page-number pagination?start=N or ?offset=N → offset-based paginationdata-infinite-scroll or "Load more" button → JS-driven infinite scroll (requires render=true)Note the exact URL pattern — this feeds directly into the pagination loop in Phase 4.
4. Data structure (when target fields are visible)
<li class="product-item">, <div class="listing-card">)<script type="application/ld+json"> (JSON-LD) or data-* attributes — these are often cleaner to parse than raw HTML5. Internal API endpoints (bonus)
Scan inline <script> blocks for fetch( or axios.get( calls pointing to internal paths (e.g., /api/products, /_next/data/). If found, scraping that JSON endpoint is usually simpler and more stable than parsing HTML.
Summarize findings as a table before proceeding. Every row maps to a specific decision in Phase 3.
| Signal | Observed |
|-------------------------|---------------------------------------|
| HTTP status (standard) | 200 / 500 / ... |
| Anti-bot protection | None / Cloudflare / DataDome / ... |
| JS rendering needed | Yes / No / Uncertain |
| Pagination pattern | ?page=N / rel=next / load-more / ... |
| Target data visible | Yes / No (skeleton HTML) |
| Data container selector | e.g. div.product-card |
| Structured data (LD+J) | Present / Not found |
| Internal API detected | Yes (<path>) / No |
Use the Site Profile from Phase 2 as primary evidence for each decision. Work through all six decisions in order, citing specific observations from the profile. Summarize all decisions as a table (see end of this section) before writing any code.
Check if the target site is one of the supported verticals. If yes, use it — structured endpoints return clean JSON with no HTML parsing, and they handle rendering and anti-bot automatically. Skip Decisions 2 and 3.
Supported endpoints and their required parameter (verify against docs):
| Endpoint path | Required |
|---|---|
amazon/product, amazon/offers | asin |
amazon/search | query |
walmart/product, walmart/review | product_id (walmart/review also needs tld, country_code) |
walmart/search | query |
walmart/category | category |
ebay/product | product_id |
ebay/search/v2 | query |
google/search, google/news, google/jobs, google/shopping | query |
google/mapssearch | query, latitude, longitude |
redfin/forsale, redfin/forrent, redfin/search, redfin/agent | url |
There is no structured endpoint for other sites (LinkedIn, Indeed, Amazon reviews, etc.) — scrape those as HTML.
Endpoint pattern: GET https://api.scraperapi.com/structured/<path>?api_key=...&<required_param>=...
Enable render=true only when the Site Profile confirms that target data was absent in the standard response. Cost: 10 credits/req instead of 1.
render=truerender=truerender=true and compareDo not enable render=true speculatively — the Phase 2 probe is the evidence.
Use the Site Profile's "Anti-bot protection" row as the starting point. Escalate gradually — never start at the highest tier.
premium=true (10 credits)premium=true still returns 500 or a block page → escalate to ultra_premium=true (30 credits)ultra_premium=true and premium=true are mutually exclusive — never set both.
| Volume | Approach |
|---|---|
| 1–10 URLs | Sync loop, no special handling |
| 10–100 URLs | Sync with 1 req/sec rate limiting |
| >100 URLs | Async Jobs API (POST https://async.scraperapi.com/batchjobs) |
For async batches, the script submits all URLs, then polls until all jobs complete. See references/code-templates.md for the async pattern.
Add session_number=<int> when:
Pick any integer as the session ID. Requests with the same session_number are routed through the same proxy IP.
Add country_code (ISO-3166, e.g., us, gb, de) when:
Before generating code, print this table:
| Parameter | Value | Reason |
|----------------|------------|-----------------------------------|
| url | ... | target |
| render | true/false | (why) |
| premium | true/false | (why) |
| ultra_premium | true/false | (why) |
| country_code | us / – | (why) |
| session_number | N / – | (why) |
| volume mode | sync/async | (why) |
Ask for language if not already known (default: Python). Generate a complete, runnable script — not pseudocode or snippets. See references/code-templates.md for the base templates to adapt.
Use the Site Profile from Phase 2 to pre-fill the parsing logic: if a data container selector was identified (e.g., div.product-card), write it directly into the extract() function rather than leaving a TODO. If JSON-LD was found, parse <script type="application/ld+json"> instead of navigating the HTML tree. If an internal API path was found, target that endpoint instead of the page HTML.
argparse CLI with --url, --pages, --output, --max-credits, plus flags for all ScraperAPI params decided in Phase 3YOUR_API_KEY placeholder, with a guard that exits if it was not replaced (see the templates)scrape() function with exponential backoff retry (5 attempts)extract() function pre-filled with selectors from the Site Profile (or a TODO if none were identified)--output fileSame flags and behavior as above. Use node-fetch@2 + commander. Match the user's existing module format (ESM vs. CommonJS) if known, otherwise default to CommonJS.
# Requirements: pip install requests (Python)
# Requirements: npm install node-fetch@2 commander (Node.js)
# Usage: python scraper.py --url "https://example.com" --pages 5
| Configuration | Credits per request |
|---|---|
| Standard | 1 |
render=true | 10 |
premium=true | 10 |
premium=true + render=true | 25 |
ultra_premium=true | 30 |
ultra_premium=true + render=true | 75 |
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
Print a cost estimate before executing: # Estimated: 50 pages × 10 credits = ~500 credits. On sites that cost more than 1 credit, base the estimate on the probe's sa-credit-cost header (or /account/urlcost) rather than the table, since the table alone undercounts there.
The generated script must include a --max-credits flag that aborts if the estimate exceeds the budget.
| Status | Action |
|---|---|
| 200 | Parse and return |
| 401 | Abort — invalid API key, do not retry |
| 403 | Abort: credits exhausted for this billing cycle. Upgrade or enable overages at https://dashboard.scraperapi.com/billing; do not retry |
| 404 | Skip this URL — page does not exist |
| 429 | Exponential backoff and retry; switch to async for large batches |
| 500/503 | Failed after ScraperAPI's own 70s of retries (not charged). Exponential backoff, max 5 attempts; if it persists, escalate to premium=true, then ultra_premium=true |
Before presenting the script:
YOUR_API_KEY placeholder, never a real key--max-credits guard is present and enforced before the first requestultra_premium and premium are not both setWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
web-scraping, scraperapi, scraper-generation, data-extraction
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-asyncReference for ScraperAPI's Async Jobs REST API: submit scraping jobs in the background and get results by polling or webhook, including batch jobs. Consult when the user is scraping many URLs, needs non-blocking requests, or wants webhook delivery. Use when user asks: "how do I scrape 1000 URLs with ScraperAPI", "ScraperAPI async jobs", "batch scraping with ScraperAPI", "submit a scraping job and poll for results", "ScraperAPI webhook callback", "ScraperAPI batchjobs endpoint". Covers single and batch jobs, webhook callbacks, apiParams, async-only parameters, binary responses, retention, and error handling. It is language-agnostic: for SDK client code, use the language's SDK skill; to crawl a whole site by following links, use scraperapi-crawler.
Note: Transmits user-supplied queries, URLs, and content to ScraperAPI.
Other plugins' skills for the same job