POST /v1/scrape/url·1 – 40 credits (+5 with AI extraction)·Utilities
A general-purpose fetcher with automatic escalation. We pick the cheapest method that works for each target and escalate through tougher anti-bot handling as needed, so you see one response and one tier-aware bill, not three retries.
The hard part
Generic scrapers make you pick a tier up front (datacenter or residential, render JS or not) and bill the same whether the page came back or not. Pick wrong and you're either burning credits on soft targets or staring at blocked pages on hard ones. We pick the right level per site and only charge for what actually succeeded.
Web scraping API: what you get
render=auto|direct|browser|stealth: pick how much firepower you want.
force_proxy=true routes through residential proxies for soft-blocked targets.
Returns cleaned title/description/text and the original status_code, proxy_used, and elapsed_ms.
include_html=true returns the raw page source alongside the cleaned text. Same call, no extra credits.
return_markdown=true adds a markdown field, clean for LLM input. No extra credits.
extract_rules={"price":".price","links":{"selector":"a","attr":"href","all":true}} returns a typed extracted object. No extra credits.
wait_for_selector, wait_ms, block_ads, device=mobile, custom viewport: all available, all free.
country=us routes through an in-country residential exit (billed at the residential tier).
Pages we can't deliver (timeout, block, upstream error) don't bill. A delivered 404 'not found' bills 1 credit.
Web scraping API use cases
Feed pages to an LLM
return_markdown: true returns clean Markdown, and max_chars with offset or focus keeps long pages inside your context window.
Price and product monitoring
structured.product carries the declared name, price, currency and rating, and extract_rules pulls any field by CSS selector.
JavaScript-heavy sites
render: "browser" runs the page in a headless browser, with wait_for_selector and wait_ms for late content.
Geo-specific content
country fetches through a residential exit in that country and reports it in exit_country.
Web scraping API quickstart: Python, Node and curl
Install the SDK with pip install scrapenest (PyPI) or npm install scrapenest (npm), or send the raw HTTP call with your key in the Authorization: Bearer header. No key yet? Sign up free, verify your email, then create a key in your dashboard.
import os
from scrapenest import Client
client = Client(os.environ["SCRAPENEST_API_KEY"], timeout=120)
page = client.scrape_url("https://www.zillow.com/homes/Austin-TX", render="auto")
if page.success:
print(page.status_code, page.method, page.credits_charged, "credits")
print((page.text or "")[:500])
else:
print(page.error_code, page.error)
{
"success": true,
"url": "https://www.zillow.com/homes/Austin-TX",
"final_url": "https://www.zillow.com/homes/Austin-TX/",
"status_code": 200,
"method": "stealth",
"proxy_used": "residential",
"elapsed_ms": 13790,
"title": "Austin TX Real Estate | Zillow",
"description": "1,284 homes for sale in Austin, TX. See pricing and listing details.",
"text": "1,284 homes for sale in Austin, TX …",
"text_total_chars": 18240,
"cache_hit": false,
"escalated": false,
"credits_charged": 40
}
Fields with no value are left out of the JSON rather than sent as null, so read optional fields defensively. proxy_used is the exception: it is always present, null included.
Web scraping API pricing
Tiered by what it takes to render the page. A simple HTML fetch is the floor; a full JS render with anti-bot handling is the ceiling. You only pay the tier that actually succeeded. Adding ai_query for AI extraction adds 5 credits when the extraction runs on a delivered page.
Plans and pay-as-you-go rates are on the pricing page.
Web scraping API limits
timeout_seconds: 1 to 120, default about 100. Auto-escalation needs at least 20 s left on the budget.
max_chars: 200 to 2,000,000. focus: up to 500 characters.
extract_rules: up to 50 rules. cookies: up to 50. headers: up to 30.
wait_ms: up to 10,000. wait_for_timeout_ms: 100 to 30,000. Viewport: 320 to 3840 wide, 240 to 2160 tall.
session_id keeps the same residential exit for about 10 minutes and turns caching off for the request.
Cache: 15 minutes by default, set with cache_ttl_seconds (0 to 86400).
Web scraping API error codes
HTTP
Code
Meaning
200 (in body)
anti_bot_block
The target's anti-bot refused the fetch, after one stealth retry unless auto_escalate is false. Not billed.
200 (in body)
timeout
The fetch ran past timeout_seconds. Not billed.
200 (in body)
not_found
The target returned 404 or 410. Bills the 1-credit floor.
200 (in body)
empty_response
The page had no usable content. Not billed.
200 (in body)
rate_limited
The target answered 429 without a challenge. Not billed.
200 (in body)
connection_failed
The host doesn't resolve, or render: "direct" couldn't connect. Not billed.
400
unsafe_url
The URL is malformed or points at a private host.
422
country_unavailable
No residential exit is available for country right now. Not billed.
429
render_capacity
Every browser-render slot is busy. Retry after 15 s. Not billed.
503
upstream_failed
The fetch service couldn't run the request. Not billed.
Every endpoint can also return 401 unauthorized (missing or wrong key), 402 insufficient_credits (balance used up), 403 email_not_verified (an email signup must verify its address before its key works) and 429 rate_limited or concurrency_limit_exceeded. All errors share one JSON envelope; see the error reference.
questions
Web scraping API FAQ
Can it scrape JavaScript-rendered pages?
Yes. render: "auto" (the default) picks a plain fetch or a headless browser per site, and render: "browser" forces a full render. Add wait_for_selector or wait_ms for content that loads late.
What happens when a site blocks the request?
With auto_escalate on (the default), a refused auto or browser fetch is retried once in stealth mode, and you pay the stealth rate only if that retry succeeds. A request that stays blocked returns success: false with error_code: "anti_bot_block" and costs nothing.
How much does a scrape cost?
It depends on the tier that delivered the page: 1 credit for a plain fetch, 5 with a browser render, 10 through a residential proxy, and 40 for a residential browser render or stealth. ai_query extraction adds 5, a cache hit bills 1, and a delivered 404 bills 1.
Can I get Markdown or the raw HTML?
Yes, at no extra cost. return_markdown: true adds a markdown field and include_html: true adds the raw html. markdown_mode: "main" (the default) keeps only the main content.
How do I read a very long page?
Set max_chars. The response reports text_total_chars and a next_offset you send back as offset to read the next window. With focus, you get the passages that best match your terms instead of only the beginning.