AI Web Scraper API

Complete documentation for the AI Web Scraper API. Scrape any URL as HTML, Markdown or JSON with anti-bot unlocking and AI extraction.

Web Scraping API

Overview

The AI Web Scraper API fetches any URL you give it and returns the content as HTML, Markdown or structured JSON. Every request runs through one of two fetch paths: a plain HTTP fetch with a real-browser TLS fingerprint, or a headless browser that renders JavaScript and solves anti-bot challenges. Two exit pools are available (datacenter and static-residential ISP), and three AI endpoints sit on top of the fetcher for extraction, rule generation and summarization.

Every endpoint accepts both GET and POST with identical parameters: send them as query-string parameters or as a JSON body, same handler, same billing, same errors.

Authentication

All requests require a valid RapidAPI key. Include the following headers with every request:

HeaderValue
X-RapidAPI-KeyYOUR_API_KEY
X-RapidAPI-Hostai-web-scraper-api1.p.rapidapi.com

You can obtain an API key by subscribing to the AI Web Scraper API on RapidAPI .

Base URL

1
https://ai-web-scraper-api1.p.rapidapi.com

Endpoints

EndpointMethodPathDescription
Scrape a URLPOST/scrapeFetch any URL and return its content as HTML, Markdown or text, plus cookies, headers, redirect chain and optional CSS/XPath extraction
Unlock a SitePOST/unlockOpen a URL in a headless browser, clear anti-bot challenges and return the resulting cookies and User-Agent for cheap HTTP replay
AI ExtractPOST/ai-extractFetch a URL and extract the fields you describe with a schema or prompt, no selectors needed
Generate Extraction RulesPOST/ai-generate-extraction-rulesTurn 1-3 sample URLs into a reusable extract_rules object you can run on /scrape at fetch price
AI SummarizePOST/ai-summarizeFetch a URL and return a summary as text or Markdown, with length, language and custom instructions

The three render modes

The render_js parameter controls which fetch path a request uses:

render_jsWhat happensCredits
falsePlain HTTP fetch with a browser-grade TLS and header fingerprint1
auto (default)HTTP first. If the response classifies as blocked, or the HTTP attempt errors, the request escalates to headless-browser rendering. Only the winning attempt is billed, never the sum1 or 5
trueHeadless-browser rendering only5

The response field data.render_used ("http" or "browser") always tells you which path produced the answer.

Sessions

Every response carries a data.session_id. Send it back as session_id on your next request and it goes out through the same exit IP. Omit it and each request gets a fresh random exit.

Cookies and the User-Agent travel with the session: pass the cookies and user_agent values a response returned and they are replayed exactly. This is what makes the unlock-then-scrape pattern work. Anti-bot clearance cookies are bound to the IP that earned them, so calling /unlock once and then replaying its session bundle on /scrape with render_js=false and the same session_id lets you keep scraping a protected site over plain HTTP at 1 credit per request.

Credits & Billing

Each request costs credits depending on the fetch path and the exit pool (proxy_type):

Outcomeproxy_type=datacenter (default)proxy_type=isp
/scrape served over HTTP15
/scrape served by the headless browser520
/unlock (always browser price)520
Target blocked the request (blocked: true)00
/ai-extractfetch credits + 5 extractionfetch credits + 5 extraction
/ai-generate-extraction-rulesfetch credits + 15 generationfetch credits + 15 generation
/ai-summarizefetch credits + 5 summaryfetch credits + 5 summary

AI surcharges are billed only when output is actually produced: a blocked target or a failed extraction never adds the extra credits. A request the target blocked costs 0 credits.

On RapidAPI plans these credits appear as three metered objects: Requests, Requests JS (browser renders) and AI extraction or summarize. Using proxy_type=isp consumes the same meters at its higher credit rate. See the RapidAPI listing for plan prices and quotas.

Rate Limits

Rate limits depend on your RapidAPI subscription plan. Check your plan details on the RapidAPI listing for specific limits.

Ready to get started?

Get your API key and start making requests in minutes.

Get Your API Key