TL;DR
- A web scraping API takes a URL over HTTP and returns the page's content as HTML, Markdown, JSON or a screenshot. The provider runs the proxies, browsers, retries and parsing that sit between your request and the target site.
- Most of what you pay for is getting the page at all. Sites judge every request by its IP address, the network that IP belongs to, its TLS and HTTP fingerprint, and whether a real browser executed the page. A scraping API manages each of those layers so your code does not have to.
- Proxies come in four main kinds. Datacenter IPs are fast and cheap but easy to flag, ISP proxies are datacenter-hosted IPs registered to consumer internet providers, residential proxies route through real home connections, and mobile proxies route through carrier networks that many users share.
- When you compare providers, test them on your own URLs. Measure success rate, cost per successful page (including rendering and proxy multipliers), latency, and whether the output is clean enough to use without more parsing.
What Is a Web Scraping API?
A web scraping API is a hosted service that fetches web pages on your behalf. You send it a target URL and a few options, it retrieves the page from its own infrastructure, and it returns the result in the format you asked for. Your application never opens a socket to the target site, never launches a browser, and never sees the CAPTCHA that a blocked request would have hit.
The term gets confused with three nearby ideas, and the differences matter when you pick a tool.
A scraping library such as BeautifulSoup, Cheerio or Scrapy runs inside your program, on your machines, from your IP address. It is free per page, but you write and maintain the fetching, parsing and blocking logic yourself. Our guide to what a web scraper is covers that side of the market.
A site's official API returns data the site has chosen to publish, in a documented schema, usually behind a key and a rate limit. When a site offers one that covers your data, it is almost always the more stable option. A scraping API is for the far larger set of pages that have no official API, or whose API leaves out what you need.
A proxy API or unblocker forwards your request through a pool of IPs and hands back the raw response. It solves the "where does this request come from" problem but leaves rendering and parsing to you. Many scraping APIs began as proxy networks and added browsers and extraction on top.
What Happens During a Single Request
From the outside a scraping API looks like one HTTP call, but a well-built one makes several decisions for each URL. Walking through them shows where the difficulty lies.
- Validation and cache. The service checks that the URL is well formed and public, and it may return a recent cached copy if you allow one. Cached responses are faster and are often cheaper or free.
- Choosing a fetch strategy. Many pages return their full content in the first HTML response, so a plain HTTP request is enough. Others are single-page apps that ship an empty
<div id="root">and build everything in JavaScript, which requires a real browser. Good services try the cheap path first and escalate when the response looks incomplete. - Choosing an exit IP. The request leaves through a proxy chosen for the target's location and defenses, which could be a datacenter IP for a cooperative documentation site or a residential IP in a specific country for a geo-restricted storefront.
- Looking like a real client. The TLS handshake, HTTP/2 settings, header order and, in a browser, dozens of JavaScript-visible properties all have to agree with each other and with the claimed user agent.
- Rendering and waiting. In browser mode the service waits until the content you want exists. That might mean waiting for network activity to settle, for a specific selector to appear, or for a scroll to load more items.
- Detecting blocks. A blocked request often comes back as
200 OKwith a challenge page, a login wall or an empty template. The service has to inspect the content, not just the status code, and treat those responses as failures. - Retrying with escalation. After a detected block, the service retries with a different IP, a stronger proxy type, a browser instead of plain HTTP, or a different fingerprint.
- Converting the output. Finally the HTML becomes what you requested, whether that is cleaned Markdown, a JSON object that matches your schema, a list of links, or a screenshot.
Every one of those steps is something you would otherwise build, monitor and keep current as sites change. The sections below explain the layers that cause the most trouble.
Proxies: Where Your Request Appears to Come From
A proxy is a server that forwards your request so the target site sees the proxy's IP address instead of yours. Scraping needs proxies for two reasons. Sites rate-limit and block by IP, so traffic spread across many addresses lasts longer than traffic from one, and many sites show different content or prices depending on the visitor's country, so you need an IP in the right place.
How sites judge an IP address
To understand why proxy types differ, you need to know how a site decides whether an IP looks trustworthy.
Every public IP address belongs to an autonomous system (AS), a network operated by one organization and identified by an ASN. Amazon Web Services announces most of its addresses under AS16509, a residential broadband provider announces its customers' addresses under its own ASNs, and a mobile carrier does the same for phones. Commercial IP intelligence databases label each range by connection type (hosting, business, residential or cellular), geography and abuse history.
Anti-bot systems use those labels as a strong first signal. Very few genuine shoppers browse a retail site from an AWS server, so traffic from a hosting ASN starts with low trust before any other check runs. An IP that recently sent thousands of requests to the same site, or appears on a spam blocklist, starts lower still.
The four main proxy types
| Proxy type | Where the IP comes from | Speed and stability | Typical billing | Block resistance | Good fit |
|---|---|---|---|---|---|
| Datacenter | Cloud and hosting providers, under hosting ASNs | Fastest and most stable | Per IP or cheap per GB | Lowest, because the ASN reveals a server | Documentation, government sites, APIs, lightly protected pages |
| ISP (static residential) | Addresses registered to consumer ISPs but hosted in data centers | Fast, with the same IP for long sessions | Per IP per month | Medium to high | Logged-in sessions, account workflows, sites that check ASN type but not behavior |
| Residential | Real home connections, through users who opted into a bandwidth-sharing network | Slower and less predictable, since devices go offline | Per GB of traffic | High | Retail, travel, search results and other heavily defended sites |
| Mobile | 4G and 5G carrier connections | Slowest and most expensive | Per GB, at a premium | Highest | The hardest targets and mobile-only content |
Datacenter proxies are IPs rented from hosting providers. They are cheap, low-latency and almost never drop a connection, which makes them the right default for sites that do not fight scrapers. Their weakness is that the ASN gives them away immediately.
ISP proxies are a hybrid. The provider leases address ranges that are registered to a consumer internet service provider, so IP databases label them residential, while the traffic actually runs from servers in a data center. You get datacenter speed and a stable IP that can hold a session for hours, with a much better first impression than a cloud IP. They are less convincing than true residential traffic at scale, because a block of ISP addresses that behaves identically is still a pattern.
Residential proxies route your request through a real household connection. Providers usually build these networks through apps or SDKs that ask users to share idle bandwidth, so how the network gets its users matters. Ask a provider how its peers consented, because a network built on unclear consent is an ethical and legal risk you inherit. Residential IPs carry the most realistic reputation, but speeds vary, devices disconnect mid-session, and you pay per gigabyte, which makes image-heavy pages expensive unless the scraper blocks unnecessary assets.
Mobile proxies route through cellular carriers. Carriers put many subscribers behind a small number of public IPv4 addresses using carrier-grade NAT, so one mobile IP may represent thousands of real people at once. Blocking it would block all of them, which is why sites treat mobile IPs gently. That property makes mobile proxies the strongest and most expensive option, and also the slowest.
Rotation, sticky sessions and geotargeting
How you use an IP matters as much as which kind it is.
Rotation sends each request, or each small batch of requests, through a different IP so that no single address accumulates suspicious volume. It suits stateless work like fetching thousands of independent product pages.
Sticky sessions keep the same IP for a set time or for a sequence of requests. Anything stateful needs this: a site that issues a session cookie on the first page and checks that later pages come from the same IP will flag a scraper whose address changes between requests. Logins, multi-step forms and paginated results that depend on a server-side cursor all need stickiness.
Geotargeting selects an IP in a specific country, and on some networks a specific city or carrier. Prices, currencies, product availability, search results and even whether a page loads at all can depend on visitor location, so the right IP location is part of getting the right data.
Our deeper guide on rotating proxies in web scraping covers pool sizing, health checks and rotation strategies if you plan to run proxies yourself.
Headless Browsers: When Plain HTTP Is Not Enough
A plain HTTP request returns whatever the server sends in its first response. For a server-rendered blog post, that response contains the article. For a React, Vue or Angular single-page app, it often contains a nearly empty shell plus JavaScript bundles that fetch data and build the page in the browser. If you parse that first response, you get no content, and frequently no error either.
A headless browser is a real browser engine, usually Chromium, running without a visible window and controlled by code through tools like Playwright or Puppeteer. It downloads the page, executes the JavaScript, makes the follow-up API calls, and produces the same DOM a human would see. It can also click "Load more," scroll an infinite feed, dismiss a cookie banner, or fill in a search box before extraction.
Browsers solve the rendering problem at a real cost. A Chromium instance commonly uses hundreds of megabytes of memory, a rendered page takes seconds rather than the fraction of a second a plain fetch takes, and browsers crash, leak memory and need regular upgrades. Running a fleet of them reliably means managing pools, timeouts, concurrency limits and zombie processes.
The waiting strategy is where many scrapers fail quietly. Extracting as soon as the load event fires often captures a page before its data arrives. Better strategies wait for network activity to settle, wait for a specific CSS selector that only exists once the content has rendered, or combine both with a timeout. Our explainer on how scraping APIs handle JavaScript-rendered content goes further into rendering decisions, and our guide to scraping "Load more" buttons and infinite scroll covers interaction.
A scraping API makes this decision for you. A good one renders when the page needs it and skips the browser when it does not, and its pricing page should tell you whether rendered pages cost more.
Fingerprints: How Sites Recognize Automated Clients
Even with a clean residential IP, a request can be flagged before the server sends a single byte of HTML. That happens because the client's own behavior identifies it. Fingerprinting works at several layers, and a convincing client has to be consistent across all of them.
TLS fingerprints
Every HTTPS connection starts with a TLS handshake. In its first message, the ClientHello, the client lists the TLS versions, cipher suites, extensions and elliptic curves it supports, in a particular order. Different clients send different lists. Python's requests, Go's net/http, curl, Chrome, Safari and Firefox each produce a recognizable shape.
Methods like JA3, published by Salesforce researchers in 2017, hash those fields into a short fingerprint. When Chrome began randomizing the order of its TLS extensions in early 2023, partly to discourage this kind of tracking, the newer JA4 method (released by FoxIO later that year) sorted the fields before hashing so the fingerprint stayed stable. Anti-bot vendors compare the TLS fingerprint against the user agent header. A request that claims to be Chrome in its User-Agent but completes a handshake that looks like Python is caught immediately, which is why changing the user agent string alone rarely helps.
HTTP/2 fingerprints and headers
Browsers also differ in how they speak HTTP/2: the values in their initial SETTINGS frame, their window sizes, the order of pseudo-headers like :method and :path, and how they prioritize streams. On top of that come ordinary headers. Real browsers send Accept, Accept-Language, Accept-Encoding, sec-ch-ua client hints and Sec-Fetch-* headers, in an order specific to the browser and version. A request with missing headers, headers in the wrong order, or client hints that do not match the user agent stands out.
Browser fingerprints
Once JavaScript runs, a site can ask the browser about itself. Automation frameworks leave traces: navigator.webdriver is true in an unmodified automated browser, older headless Chrome put HeadlessChrome in its user agent, and headless environments often report no plugins, unusual screen sizes, or a software GPU renderer through WebGL. Canvas and audio fingerprinting draw invisible graphics or generate audio and hash the output, which varies with hardware and drivers.
The most common giveaway is inconsistency rather than any single property. A browser whose timezone is America/New_York connecting from a German IP, whose Accept-Language says en-US while its geolocation says Brazil, or whose screen resolution does not match any real device, is suspicious even if each value looks normal on its own. Our article on browser fingerprinting breaks these signals down in more detail.
Behavior over time
The last layer is behavior. Real visitors arrive from search engines or links, load images and stylesheets, move the mouse, pause to read, and visit a handful of pages. Scrapers tend to request hundreds of pages at a perfectly even interval, skip every asset, and never move a cursor. Rate limits catch the crude cases with 429 Too Many Requests responses, often with a Retry-After header, while bot-management products build risk scores from the subtler patterns.
Anti-Bot Systems and CAPTCHAs
Commercial bot-management products such as Cloudflare Bot Management, Akamai Bot Manager, DataDome and HUMAN (formerly PerimeterX) combine all of the signals above into a score for each request, then decide whether to let it through, slow it down, challenge it or block it.
Challenges come in a few forms. A JavaScript challenge runs code in the browser that collects fingerprint data and proves a real engine is present, often without the visitor noticing. Managed challenges such as Cloudflare Turnstile decide whether to show an interactive check based on the risk score. A visual CAPTCHA asks the visitor to pick images or solve a puzzle, which is the most visible and the most expensive to get past. Our guide to CAPTCHA solvers explains how solving services work and why they are a last resort.
Blocks are frequently soft. Instead of a 403, the site may return 200 OK with a challenge page, a page with prices removed, or a page that looks normal but contains decoy data. A scraper that trusts status codes will happily store those pages. Detecting them means checking for challenge markers, missing fields and suspiciously short content, which is one of the less visible jobs a scraping API does. If your scraper returns pages that look fine but contain nothing useful, our guide to debugging empty scraper results walks through the common causes, and our guide to HTTP errors in scraping covers the explicit failures.
The practical lesson is that getting past anti-bot systems depends far more on prevention than on solving challenges. A request with a reputable IP, a consistent fingerprint and reasonable pacing rarely sees a CAPTCHA at all, while a request that triggers one has usually failed several earlier checks.
Output Formats: What You Get Back
Fetching the page is half of the job. The other half is turning it into something your code can use.
- Raw HTML is the server's original response. It is useful when you have your own parser or need exact markup, but for JavaScript-built pages it may be missing the content.
- Rendered HTML is the DOM after the browser has run the page's scripts, which is what you want to parse with CSS selectors or XPath.
- Markdown keeps headings, lists, tables and links while dropping scripts, styles and layout markup. For language models it is the most useful format, because raw HTML spends most of its tokens on markup the model does not need. Options that keep only the main content and drop navigation, footers and cookie banners reduce the token count further, as our guide to extracting the main text of a page for an LLM shows.
- Structured JSON returns specific fields, such as price, title and availability, in a schema you define. Some APIs extract it with rules you supply, others with prebuilt parsers for common page types, and others by passing the page to a language model with your JSON Schema.
- Screenshots capture the page visually, for archiving, visual monitoring or vision models.
The format determines how much code you still have to write after the API call. An API that returns only raw HTML leaves you maintaining selectors for every site, while one that returns clean Markdown or schema-shaped JSON moves that work to the provider.
Building It Yourself vs Using a Scraping API
You can assemble every layer above from open-source tools and proxy vendors. The list of components is the real cost:
- A proxy pool with several proxy types, health checks, rotation, sticky sessions and per-country routing
- An HTTP client that can match browser TLS and HTTP/2 fingerprints
- A fleet of headless browsers with pooling, crash recovery, memory limits and regular upgrades
- Block detection that reads content, not just status codes
- Retry logic that escalates from cheap to expensive strategies
- Parsers or extraction logic for each site, plus monitoring that notices when a layout change breaks them
- Queues, concurrency limits, caching and storage
Building in-house makes sense when you scrape a small number of cooperative sites, need unusual control over every request, or have scale large enough to justify a dedicated team. A scraping API makes sense when you need many different sites, face real anti-bot defenses, or would rather spend engineering time on what you do with the data. Our build vs buy analysis for web scraping infrastructure puts numbers on that decision.
How to Evaluate a Web Scraping API
Vendor success rates are measured on vendor-chosen URLs. The only numbers that matter are the ones you measure on the pages you actually need, so build a test set of a few hundred real URLs, including your hardest targets, and run every candidate against it.
Success rate on your URLs. Count a response as successful only if it contains the content you need, not just a 200. Spot-check results by hand, since soft blocks and empty templates inflate naive success rates.
Cost per successful page. Many APIs charge multiples of their base price for JavaScript rendering, residential or "premium" proxies, or specific domains. Work out what your actual mix costs, and check whether failed requests are billed.
Latency. Look at median and slow-tail latency (p95) separately. An API that is fast on average but takes 30 seconds on one page in twenty will stall an interactive agent.
Output quality. Compare the Markdown or JSON each provider returns for the same page. Missing sections, leftover navigation and broken tables all become cleanup work for you or noise for your model.
Controls. Check for geotargeting, browser actions, custom headers, session or login support, concurrency limits, and batch endpoints for large URL lists.
Data handling. If you scrape anything sensitive, ask how long the provider retains requests and responses, and whether it offers zero data retention.
Independent benchmarks help narrow the field before you run your own tests. Our roundup of the best web scraping APIs compares providers on features and pricing, and the glossary entry on what to compare when choosing a web scraping API is a shorter checklist.
Is Using a Web Scraping API Legal?
A scraping API changes who runs the infrastructure, not the legal questions around the data, so the same principles apply as for any scraper. This is general information, not legal advice.
Scraping publicly accessible pages is common and widely practiced, and in hiQ Labs v. LinkedIn the U.S. Ninth Circuit held that accessing public data likely does not violate the Computer Fraud and Abuse Act. The same case later turned on LinkedIn's user agreement, which shows that contract terms can still apply. Risk rises when you get past a login you are not authorized to use, ignore a site's terms after agreeing to them, collect personal data covered by laws such as GDPR or CCPA, copy copyrighted content for republication, or send enough traffic to degrade a site.
Good practice is straightforward. Prefer public data, read the robots.txt file (standardized as RFC 9309) and the site's terms, keep request rates reasonable, avoid collecting personal data you do not need, and ask counsel about anything commercial or sensitive.
Example: Scraping a Page with Context.dev
Context.dev is a web scraping and search API built for AI products and agents. Its scrape endpoint handles proxies, JavaScript rendering and retries, and it returns Markdown, HTML, screenshots, links or schema-shaped JSON. A base scrape costs 1 credit per successful page with rendering and proxies included.
The quickest test needs no account. Put any URL after r.context.dev/ and you get the page back as Markdown:
curl https://r.context.dev/https://www.bls.gov/ooh/computer-and-information-technology/software-developers.htmWith a free API key you can add options such as country targeting and structured extraction. This request fetches the same page from a U.S. IP and returns only the fields defined in the schema:
curl https://api.context.dev/v1/web/scrape \
-H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.bls.gov/ooh/computer-and-information-technology/software-developers.htm",
"formats": { "json": true },
"jsonParams": {
"schema": {
"type": "object",
"properties": {
"occupation": { "type": "string" },
"medianPay": { "type": "string" },
"jobOutlook": { "type": "string" },
"entryLevelEducation": { "type": "string" }
}
}
},
"sharedParams": { "country": "US" }
}'When we ran it, the extracted object came back as:
{
"occupation": "Software Developers, Quality Assurance Analysts, and Testers",
"medianPay": "$134,040 per year",
"jobOutlook": "10% (Much faster than average)",
"entryLevelEducation": "Bachelor's degree"
}JSON extraction adds 4 credits to the base scrape, so this request cost 5 credits. Our credits guide lists every operation's cost, and the scrape documentation covers the other formats and options. The same infrastructure finished first of 10 APIs on Scrapingbench, and the keyless launch post explains how to add it to an agent through MCP without a key.
Frequently Asked Questions
What is the difference between web scraping and a web scraping API?
Web scraping is the act of extracting data from web pages. A web scraping API is a hosted service that does the fetching, rendering and unblocking for you, so your code sends a URL and receives content instead of managing proxies and browsers itself.
Do I need residential proxies?
Only for sites that block datacenter traffic. Documentation, government pages, news sites and most blogs work fine from datacenter IPs. Retail, travel, ticketing and search engines usually need residential or ISP proxies. Most scraping APIs choose the proxy type for each request, so you do not have to decide in advance.
What is the difference between ISP and residential proxies?
Both use IPs registered to consumer internet providers. ISP proxies run from servers in data centers, so they are fast and keep the same IP for long sessions. Residential proxies run through real home devices, so they look more authentic but are slower and less stable.
Why does my scraper get blocked even with a Chrome user agent?
The user agent is one header among many signals. Sites also check your IP's network type, your TLS and HTTP/2 fingerprints, your other headers and, in a browser, JavaScript-visible properties. If those signals say "Python script" while the user agent says "Chrome," the mismatch itself gets you blocked.
Can a web scraping API scrape JavaScript-heavy sites?
Yes, if it runs a headless browser. Most modern scraping APIs render JavaScript when a page needs it. Check whether rendering costs extra, since some providers charge several times the base price for it.
Can a web scraping API log in to a site?
Some can, using saved browser profiles or session cookies you provide. Only do this with accounts you own or are authorized to use, and check the site's terms first.