# Web scraping guide: how it works, cost, legality | Spider

What web scraping is, how it works, the methods, what it costs and what robots.txt asks for, with Python code and runs we measured on public pages.

Canonical: https://spider.cloud/web-scraping/

## Web scraping, measured.

Web scraping is the use of a program to collect information from web pages. The program requests a page by its URL, the same way a browser does, reads the HTML the server sends back and keeps the parts you want, such as text, prices or links, in a file, a database or a spreadsheet.

[26 of 29](#wsg-fetch) pages read the same without a browser

On 2026-11-16 we fetched 29 documentation, news and product pages both ways. On 26 of them a plain HTTP request returned at least 90% of the words a browser did.

- Plain HTTP

  1.5 s median

- Browser

  10 s median

- Lowest page

  77% of the words

Written for developers who put web pages into their code or an agent. The figures above come from one run, written up in [how web scraping works](#wsg-fetch). Try one URL in the [web scraper](/web-scraper/) first.

[Open the web scraper](https://spider.cloud/web-scraper/)

One URL, no key

Published November 16, 2026. Updated November 18, 2026.

Page 1 url HTML 486,606 bytes Markdown 11,673 bytes

- Page 1 url
- HTML 486,606 bytes
- Markdown 11,673 bytes

* 60 pages tested

  37x fewer tokens

  [as markdown than as raw HTML](#wsg-output)

* 25 pages of each kind

  from $0.27 per 1,000

  [documentation pages on pay as you go, more on heavier sites](#wsg-cost)

* 100 domains asked

  67 of 100

  [served a robots.txt, and what they asked](#wsg-robots)

You can try it before you read on. The [web scraper](/web-scraper/) takes a URL and fetches that one page without a key.

## What is web scraping?

Web scraping is a program reading web pages so a person does not have to. It requests a page by its URL, takes the HTML the server sends back and keeps what it needs: the article text, a price, a table, the links. The result goes to a file, a database or a model's context instead of a screen.

Every scraper does the same three jobs. It fetches the page, in a browser when the page builds itself with JavaScript. It extracts what you asked for, either the whole page as markdown or text, or named fields picked out by CSS selector or by a schema. Then it hands the result on, and on a large job it also works out which URL to fetch next.

People scrape to track prices and stock, to collect research data, to keep a search index or an archive current, and to give language models current pages to read or train on. When a site publishes an official API for the data you want, use it. Scraping covers the sites that publish none.

Crawling is the part that finds pages. A crawler starts from one URL and follows links, and a scraper reads each page it is given. Most jobs need both, and [Web scraping vs web crawling: when to crawl and when to scrape](/blog/web-scraping-vs-web-crawling/) times the two on the same site.

## What web scraping is used for

Each of these five uses links to the page that prints its request.

- Training data for a model.

  On 2026-11-06 one search call and one crawl call took 11 seconds and $0.052 together, and two short scripts turned the output into 396 training records. Both are in [Build a fine-tuning dataset from the web in two API calls](/blog/build-fine-tuning-dataset-from-the-web/).

- Pages for a retrieval index.

  A crawl returns a documentation site as markdown, and a script splits, embeds and stores each page. Crawl again when the source changes. The script is on [the retrieval page](/use-cases/rag/).

- Price and stock tracking.

  A scheduled job sends product URLs with a CSS selector each for price, stock and SKU, then compares runs. The request is on [the price monitoring page](/use-cases/price-monitoring/).

- Market research.

  A search call finds the news on a topic, and a crawl reads a competitor's pricing page and returns it as markdown. Both calls are on [the market research page](/use-cases/market-research/).

- Website archives.

  A scheduled crawl stores each page as raw HTML with its status and headers, so the copies show what changed. The crawl is on [the website archiving page](/use-cases/website-archiving/).

The [use cases page](/use-cases/) lists the others.

## How web scraping works

A scraper starts where a browser starts. It sends a GET for a URL, and the server answers with a status code, headers and HTML. When the server has already written the article or the product description into that HTML, the only work left is to convert it.

Fig. 2 2026-11-16

29 public pages, each fetched by plain HTTP and again in a browser.

Median cost and time over the 29 pages.

### The 29-page run

We checked how often that holds. On 2026-11-16 we fetched 29 public pages twice through the scrape endpoint. They were 10 documentation pages, 10 news articles and 9 store product pages. The first request was a plain HTTP GET that runs no JavaScript. The second loaded the page in a browser, ran its scripts and read the result. On 26 of the 29 the plain fetch returned at least 90% of the words the browser did, and the lowest page was at 77%. On those 26 the server had already written the text into the HTML.

### JavaScript pages

Other pages send a nearly empty document and a script that builds the content after it loads. We picked 10 pages we expected to work that way, and on 8 of them the plain fetch returned under half of the browser's words. One is a practice page whose ten quotes sit inside a script tag. Its plain fetch came back with 8 words and its rendered fetch with 240. We chose those 10 by hand, so they say nothing about how common such pages are.

### Cost of a browser

Rendering has a price. Across the 29 pages the plain fetch had a median cost of $0.36 per 1,000 requests on the pay as you go meter and a median wall time of 1.5 seconds. The rendered fetch came to $1.40 and 10.0 seconds, because a browser also downloads the scripts and data calls a page asks for.

curl

```
curl -s https://api.spider.cloud/scrape \
  -H "Authorization: Bearer $SPIDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://quotes.toscrape.com/js/",
       "request": "http",
       "return_format": "markdown"}'
```

The plain fetch of the practice page. Change "http" to "browser" for the rendered one.

The 39 pages and the rule that picked them are in [How web scraping works: what a plain fetch gets and misses](/blog/how-web-scraping-works/).

## When a plain fetch returns more than a browser

We put a caniuse.com page on the list of 10, sure that it needed a browser. The plain fetch returned 477 words, and the browser support table is among them. The rendered fetch returned 15 words after 77 seconds, and all 15 are the page title. We were wrong about what the first response holds.

Words returned by each fetch of the same page, 2026-11-16.

### More such pages

It was not the only page to go that way. On 7 of the 29 documentation, news and product pages the plain fetch returned more words than the rendered one, and the widest gap was a store product page at 1,158 words against 772.

### Choosing a mode

A word count says how much came back. It does not say whether what came back is the page. So send your own URL both ways and read the output before you trust either mode. If you leave `request` out, it defaults to `smart`, which tries the plain fetch first and moves to a browser when the page needs one. We sent none of these pages in `smart` mode, so the run says nothing about it.

## How to scrape a website, step by step

The steps are the same whether you write the scraper yourself or call an API. Each one below names the Spider request field that does it.

1. Pick the URLs and read the site's robots.txt. For one page you already have the URL. For a whole site, start from its sitemap or let a crawler follow the links. On Spider, `respect_robots` defaults to true.
2. Fetch each page the cheapest way that works. Try a plain HTTP request first and render in a browser when the content is missing. The `request` field takes `http`, `browser` or `smart`, the default, which decides page by page.
3. Convert the page or pull out fields. To read it, set `return_format` to `markdown` or `text`. For fields, pass `css_extraction_map` with a CSS selector for each one.
4. Check what came back. Read the `status` of every page and the content of a few. A 200 with almost no text usually means the page needed a browser. A 403 or a 429 is the site's own answer, and after a 429 you wait for Retry-After before you send again.
5. Store the result with the URL and the time you fetched it, so the next run can tell fresh pages from stale ones.

The curl command for each step, and what it returned on 2026-11-17, is in [How to scrape a website, step by step](/blog/how-to-scrape-a-website/).

## Web scraping with Python

You need Python 3, the `requests` package and a key in `SPIDER_API_KEY`. This script asks for the practice page from above as markdown. It sends `smart`, which tries the plain fetch first and moves to a browser when the page needs one.

The second script asks for named fields instead of the whole page. Each field has a name and a list of CSS selectors, and the values come back under `css_extracted`.

The Python client, `pip install spider-client`, sends the same requests as methods. Every parameter is in the [Scrape API reference](/docs/api/scrape/), and the [web scraping API page](/api/scrape/) lists the output formats.

A scraper that imports nothing outside the standard library returned 25 of 25 documentation pages in each of four runs on 2026-11-16 and 2026-11-17. The script is in [Web scraping with Python using only the standard library](/blog/web-scraping-with-python/).

markdown.py

```
import os
import requests

resp = requests.post(
    "https://api.spider.cloud/scrape",
    headers={"Authorization": f"Bearer {os.environ['SPIDER_API_KEY']}"},
    json={
        "url": "https://quotes.toscrape.com/js/",
        "request": "smart",
        "return_format": "markdown",
    },
    timeout=120,
)
resp.raise_for_status()

for page in resp.json():
    print(page["status"], page["url"])
    print(page["content"][:500])
```

One page as markdown. The response is a JSON array, one object per page.

fields.py

```
import os
import requests

resp = requests.post(
    "https://api.spider.cloud/scrape",
    headers={"Authorization": f"Bearer {os.environ['SPIDER_API_KEY']}"},
    json={
        "url": "https://quotes.toscrape.com/",
        "request": "http",
        "css_extraction_map": {
            "/": [
                {"name": "quote", "selectors": [".quote .text"]},
                {"name": "author", "selectors": [".quote .author"]},
            ]
        },
    },
    timeout=120,
)
resp.raise_for_status()

print(resp.json()[0]["css_extracted"])
```

Two fields by CSS selector. The "/" key applies the fields to every page.

## Web scraping methods and when each one fits

There are five ways to get data off a page. Most jobs mix two of them: a fetch method and an extraction method.

1. A plain HTTP fetch.

   One GET, no JavaScript. It is the fastest and cheapest request, and in the run above it got the text on 26 of 29 documentation, news and store product pages.

2. A headless browser.

   The browser loads the page, runs its scripts and hands back the result. Use it for pages that build their content after they load. On those 29 pages it cost $1.40 per 1,000 against $0.36 for the plain fetch, and took 10.0 seconds against 1.5.

3. The JSON a page ships for itself.

   Some pages carry their data as JSON in a script tag, for their own scripts to read. That JSON already has field names. With return_json_data set, the scrape endpoint returns it.

4. CSS selectors.

   You name a field and point a selector at it. It is exact and cheap, and it breaks when the site changes its markup.

5. Extraction with a schema or a prompt.

   A model reads the page and fills in the fields you describe. It does not lean on the markup the way a selector does, and it adds model time to every page.

On Spider, extraction with a schema or a prompt needs a key.

## Types of web scrapers and how to pick one

Web scrapers come in four types, and what separates them is how much of the work you keep. With an extension you keep almost none of it. With a library you keep all of it.

types of web scrapers

| Type                          | Who it suits                                                              | What you maintain                                                                                | Where it breaks                                                                                                    |
| ----------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| Browser extension             | Someone who wants one table or list out of the page they have open.       | Nothing beyond the extension.                                                                    | It works a page at a time in your own browser, so it stops when you close the tab, and you start each run by hand. |
| No-code desktop or cloud tool | An analyst who repeats the same job and does not write code.              | A recipe of clicks and selectors for each site.                                                  | The recipe points at the markup. A redesign breaks it, and the repair waits on you.                                |
| Library you run yourself      | A developer who wants to control every request.                           | The code, the parser, the machines, a browser when pages need one, and the retry and rate logic. | At volume. The work moves from parsing pages to running browsers and answering 429s.                               |
| Hosted API                    | A team that wants pages back as markdown or fields and no servers to run. | The list of URLs, when the requests run and where the results are stored.                        | You pay by the page or by requests at once, and you work inside the formats and limits of the service.             |

The library row covers an HTTP client with an HTML parser, a library that drives a headless browser, and an open source crawler that follows links for you. Scrapers already written for one named site are in the [scraper directory](/scrapers/).

### No-code scraping

For a small table from one site, an extension gets you a spreadsheet without a program. It breaks when the markup changes. The [web scraper](/web-scraper/) takes one URL and shows the markdown and JSON that came back.

### Hosted API

Spider is the fourth type. One request fetches, renders and converts, and the [web scraping API page](/api/scrape/) shows what it returns. On pay as you go it costs from $0.27 per 1,000 documentation pages in the run of 2026-11-06, and more on heavier sites.

### How to choose

Test with your own URLs, and ask five questions.

- Does it save the browser for the pages that need one?
- Does it return a format your next step can read?
- Does the bill follow what it fetched?
- Does it read robots.txt by default?
- What does it do when a site answers 429?

### Free to start

The open source spider crawler is Rust under the MIT license, in [its repository](https://github.com/spider-rs/spider) and on the [open source page](/open-source/). The hosted API also answers requests that carry no key. Keyless access is /scrape only and needs no account. Send Authorization: Bearer free. It is rate limited. On a 429, honor Retry-After. Get a key for anything sustained. Without a key, every route returns 402 with an x402 payment challenge, /scrape included, except /unlimited/\*, which returns 401. With Bearer free, every route other than /scrape returns 402. The free routes, each with its command, are in [the free web scraper post](/blog/free-web-scraper/).

## How websites detect and block web scraping

A site sees every request you send. It sees the address the request came from, how fast the requests arrive, the headers, and whether the client ran the scripts on the page. When it does not want a scraper, it answers in one of four ways.

- Rate limits.

  The site counts the requests one client sends in a window of time. Past its limit it answers 429 Too Many Requests, often with a Retry-After header that gives a number of seconds or a time to wait until. Wait that long, then send fewer requests at once.

- IP blocks.

  The site refuses an address or a range of addresses, most often after too many requests from it. You see a 403 or a dropped connection. A lower request rate often prevents them. A proxy is a server that sends the request for you, so the site sees the address of the proxy. Its plain use is to read a page the way a visitor in another country sees it.

- CAPTCHAs.

  A CAPTCHA is a challenge the site serves in place of the page when it wants proof that a person is there. Your scraper gets a short page with none of the text you asked for, sometimes under a 200. So read the content of what came back and not only the status. A challenge on the first request usually means the site does not want automated readers on that page, and an official API or a data export is the better place to look.

- Fingerprinting.

  The site compares what a client says it is with how it behaves. A script can send the User-Agent header of a browser, but it runs no JavaScript and loads no images, so the claim and the behavior disagree. That disagreement is what the site reads.

This section gives no block rate, because none of our runs was built to measure one. On Spider each page in a response has a `status` field that carries the site's own answer, such as 403 or 429, even when the API call returns 200, so a refusal is visible as a refusal. What a proxy is for and what one costs is in [the post on proxies for web scraping](/blog/proxies-for-web-scraping/).

## Markdown output and the tokens it saves

Counted in tokens, the raw HTML of 60 documentation pages was about 37 times the size of the same pages as markdown. One crawl call returned them as markdown on 2026-11-06, and we fetched the same 60 URLs again as raw HTML.

Fig. 3 2026-11-06

Tokens in the same 60 pages, o200k_base encoding, 2026-11-06.

- The JSON response

  The response is JSON with one object per page, and the page is in its `content` field. With `return_format` set to `markdown`, the converter keeps headings, links and text and drops script and style elements. On a documentation page that is most of the bytes. The median page in this run was 486,606 bytes of HTML and 11,673 bytes of markdown. Both requests are in [Build a fine-tuning dataset from the web in two API calls](/blog/build-fine-tuning-dataset-from-the-web/).

- Ratio by page

  The ratio depends on the page. A day earlier, on 2026-11-05, ten public pages of different kinds shrank 15x at the median. A front page that is already mostly text shrank 2.9x and a documentation page 47x. If a model reads the result, those are the tokens it bills you for. The ten pages are in [What a web page costs in tokens](/blog/what-a-web-page-costs-in-tokens/).

## What web scraping costs

Cost follows the kind of page. Per 1,000 pages, documentation came to $0.27, articles to $0.33, store product pages to $1.38 and reference articles to $1.48, so a reference article ran five times a documentation page.

Fig. 4 2026-11-06

Cost per 1,000 pages on pay as you go, 25 pages of each kind.

### How we measured

We scraped 25 pages of each kind on 2026-11-06 with the default settings and markdown output, and read the charge from the `costs` field of each response. It was the first day of a daily run reported through 2026-11-17, so these are one day's figures. The rule that picked each set of 25 is in [Web scraping at scale: cost per 1,000 pages by kind of site](/blog/true-cost-of-web-scraping-at-scale/).

### Why cost varies

The spread is page weight. Pay as you go has two meters, from $1 per GB of bandwidth and $0.0001 per minute a request runs, and time was under 2% of the charge in that run. A long reference article carries more HTML than a short documentation page, so it costs more to fetch. Within one kind the lightest and heaviest page were far apart too. For documentation they were $0.07 and $0.89 per 1,000.

### Smart mode cost

The default did not cost more than plain HTTP on those pages. Each set went out in `http` mode and again in `smart`, and the cost per 1,000 pages matched within a cent. Forcing a browser on every page is a different matter, as the 29 pages above show.

### How billing works

An attempt bills only the bandwidth it used and the time it ran. A blocked page usually costs a fraction of a cent. The other plan, Unlimited, does not bill by the page. It is a flat monthly price for a number of requests at once, starting at $40 a month for 2 requests at once in http mode. Both are on the [pricing page](/pricing/).

## Is web scraping legal?

No single yes or no covers it. The answer turns on where you are, what the data is and what you do with it. These are the rulings and statutes most often cited, each linked to its text. This is not legal advice.

- [Computer Fraud and Abuse Act](https://www.law.cornell.edu/uscode/text/18/1030)

  The US statute, 18 U.S.C. § 1030, covers access without authorization or access that "exceeds authorized access".

- [Van Buren v. United States](https://www.supremecourt.gov/opinions/20pdf/19-783_k53l.pdf), 2021

  The Supreme Court read that phrase narrowly. It covers entering parts of a system that are off limits to you, not an improper motive for taking information you may reach.

- [hiQ Labs v. LinkedIn](https://cdn.ca9.uscourts.gov/datastore/opinions/2022/04/18/17-16783.pdf), 2019 and 2022

  The Ninth Circuit twice found serious questions about whether the Act reaches profiles anyone can see without signing in. Both rulings came at the preliminary injunction stage. In [its order of November 4, 2022](https://storage.courtlistener.com/recap/gov.uscourts.cand.312704/gov.uscourts.cand.312704.404.0.pdf) the district court found that hiQ had breached LinkedIn's user agreement.

- [Feist v. Rural Telephone](https://supreme.justia.com/cases/federal/us/499/340/), 1991

  Facts are not protected by copyright, though an original selection or arrangement of them can be.

- [EU Database Directive](https://eur-lex.europa.eu/eli/dir/1996/9/oj), 1996

  The maker of a database gets a right of its own when building it took a substantial investment. In [Ryanair v. PR Aviation](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:62014CJ0030) (2015) the Court of Justice held that without that right or copyright, an owner may still limit use by contract, such as a site's terms.

- [Directive (EU) 2019/790](https://eur-lex.europa.eu/eli/dir/2019/790/oj), Article 4

  Allows text and data mining of lawfully accessible works unless the rights holder has reserved that use, for example by machine-readable means.

- [GDPR](https://eur-lex.europa.eu/eli/reg/2016/679/oj)

  Applies to personal data, and its definition does not turn on whether the information was published.

Fig. 5 2026-11-16

What the robots.txt of 100 top-ranked domains said on one day.

A robots.txt is where a site writes down what it asks of crawlers. On 2026-11-16 we asked 100 top-ranked domains for theirs, and 67 served one. In 13 of the 67, the rules for any crawler the file does not name hold `Disallow: /`. Of the 67, 29 name at least one AI crawler, and 48 point to a sitemap.

[RFC 9309](https://www.rfc-editor.org/rfc/rfc9309.html), the standard for the file, says its rules "are not a form of access authorization." On Spider the `respect_robots` option defaults to true. How the 100 domains were picked is in [Is web scraping legal? What 67 top sites ask for in robots.txt](/blog/is-web-scraping-legal-robots-txt-survey/).

## Web scraping vs web crawling vs an API

Scraping reads a page, crawling finds pages, and an API is the site handing you its data directly. On Spider the first two are separate endpoints.

### Web scraping

You have the URL. A program fetches that page and keeps the parts you want. What comes back is what the page shows a visitor.

### Web crawling

You have one starting URL and want the pages behind it. A crawler follows the links and hands each page it finds to a scraper. On 2026-11-16 one crawl call returned 74 pages of a documentation site in 5.1 seconds, and a scrape of each page returned the same markdown on all 74.

### An official API

The site publishes an endpoint that returns its data as JSON, with documented fields, limits and terms. Its fields stay put when the page markup changes. If one covers the data you need, use it. Scraping is for the sites that publish none and for the fields an API leaves out.

A scraping API is not the third of these. It is a scraper you call over HTTP, and it reads the pages of a site, not the database behind them. The 74-page run, with both calls and their times, is in [the crawl against scrape post](/blog/web-scraping-vs-web-crawling/).

## Scrape one page, crawl a site or search first

Which request to send depends on what you already have.

- With a URL

  Send it to `/scrape`.

- With a site and no list of its pages

  Use `/crawl`. You give a starting URL and a limit, and the crawler follows the links.

- With only a question

  Start at `/search` and choose your sources from the results.

Fig. 6 2026-11-06

One search call and one crawl call, run as one job.

### One job, timed

We ran the last two as one job on 2026-11-06. A search call returned ten results with their page content in 4.5 seconds for $0.0041. Then a crawl call returned 60 documentation pages as markdown in 6.5 seconds for $0.048.

### Scrape call timing

Fetching the same 60 pages with one scrape call each, six at a time, took 16.3 seconds. Those scrape calls asked for raw HTML, so the pair differs in format as well as in call count. The 16.3 seconds is no measure of crawl against scrape, which [a run on one documentation site](/blog/web-scraping-vs-web-crawling/) timed on 2026-11-16 with both arms asking for markdown. The parameters for each route are in the [Crawl API reference](/docs/api/crawl/) and the [Search API reference](/docs/api/search/).

## Web scraping best practices

Eight habits. Two carry a figure from the runs on this page.

1. Look for an official API or a data export before you scrape.
2. Read the site's robots.txt and its terms before the first request. On Spider, `respect_robots` stays on unless you turn it off.
3. Send a plain HTTP request first, and use a browser only for the pages that come back without their text. Over our 29 pages the rendered fetch took a median 10.0 seconds against 1.5.
4. Cap how many requests you send one site at a time. After a 429, wait as long as Retry-After says before the next one.
5. Read the status and the content of what came back. A 200 can hold a challenge page or an empty shell.
6. Ask for markdown or named fields when a model or a script reads the result. The same 60 pages were about 37 times the tokens as raw HTML.
7. Store each page with its URL and the time you fetched it, and fetch again only what has gone stale.
8. Leave out personal data you do not need. In the EU the GDPR covers it even when the page is public.

## Ten posts with the method behind each number

- [How web scraping works: what a plain fetch gets and misses ](/blog/how-web-scraping-works/)39 pages, each fetched by plain HTTP and again in a browser on 2026-11-16.
- [How to scrape a website, step by step ](/blog/how-to-scrape-a-website/)What came back at each of the six steps, all sent on 2026-11-17.
- [Web scraping with Python using only the standard library ](/blog/web-scraping-with-python/)25 of 25 pages in each of four runs on 2026-11-16 and 2026-11-17.
- [Is web scraping legal? What 67 top sites ask for in robots.txt ](/blog/is-web-scraping-legal-robots-txt-survey/)The robots.txt of 100 top-ranked domains, requested on 2026-11-16 and read with two parsers.
- [What a web page costs in tokens ](/blog/what-a-web-page-costs-in-tokens/)Ten public pages in four output formats, counted with a tokenizer on 2026-11-05.
- [Web scraping to markdown: a whole docs site into files ](/blog/web-scraping-to-markdown/)A 63-page docs site in one crawl call on 2026-11-17, written to files.
- [Web scraping for AI agents: search, scrape or crawl ](/blog/web-scraping-for-ai-agents/)Tokens, time and cost for one scrape, one search and one crawl on 2026-11-17.
- [Build a fine-tuning dataset from the web in two API calls ](/blog/build-fine-tuning-dataset-from-the-web/)One search call and one crawl call from 2026-11-06, with both scripts.
- [Web scraping at scale: cost per 1,000 pages by kind of site ](/blog/true-cost-of-web-scraping-at-scale/)Twelve days of cost per 1,000 pages from 2026-11-06 to 2026-11-17, and 453 pages from five crawls in 12.2 s.
- [Web scraping vs web crawling: when to crawl and when to scrape ](/blog/web-scraping-vs-web-crawling/)One crawl call timed against one scrape per URL on the same 74 pages, 2026-11-16.

We ran the measurements dated 2026-11-05 and 2026-11-06. The measured results above come from these ten posts, and each post dates its own run. The [benchmarks page](/benchmarks/) lists our benchmark runs, each with its method. The [learning center](/learn/) has a short page for each question, and a course to read in order.

## Web scraping questions and answers

What is web scraping?

Web scraping is a program reading web pages for you. It requests a page by its URL, takes the HTML the server sends back and keeps the parts it needs, as markdown, as text or as named fields, for a file, a database or a language model.

What is web scraping used for?

Any job where a program needs what a page says. Five have their own page: training data for a model, a retrieval index, price and stock tracking, market research and website archives.

Do you need to know how to code to scrape a website?

Not to read one page: the web scraper at /web-scraper/ takes a URL and needs no code. To repeat a job on a schedule, send it from a script; the Python section has two.

Does web scraping need a headless browser?

Only for pages that build their content with JavaScript. In our run of 2026-11-16 a plain HTTP fetch returned at least 90% of a browser's words on 26 of 29 documentation, news and store product pages. On 10 pages we picked because we expected them to need a browser, it returned under half on 8.

How long does it take to scrape a page?

In the run of 2026-11-16 the plain fetch had a median wall time of 1.5 seconds and the rendered fetch 10.0 seconds, over 29 pages, measured at the client with four requests at once. The API's own timer put the median plain fetch at 884 milliseconds.

How much does it cost to scrape 1,000 pages?

On Spider's pay as you go meter it depends on the weight of the page. On 2026-11-06, with 25 pages of each kind, 1,000 pages came to $0.27 for documentation, $0.33 for articles, $1.38 for store product pages and $1.48 for reference articles. The Unlimited plan bills by requests at once and not by the page. It starts at $40 a month for 2 requests at once in http mode.

Is web scraping legal?

No single yes or no covers it. The answer turns on where you are, what the data is and what you do with it. In the US the Supreme Court read the Computer Fraud and Abuse Act narrowly in Van Buren v. United States (2021), and the Ninth Circuit, in hiQ Labs v. LinkedIn, found serious questions about whether the Act reaches pages anyone can see without signing in. A district court still found that hiQ had breached the site's user agreement. In the EU, database rights, site terms, the text and data mining opt-out in Directive 2019/790 and the GDPR can each apply. The legal section of this guide links each ruling and statute. Sites also write down what they ask for. On 2026-11-16, 67 of 100 top-ranked domains served a robots.txt, and 13 of the 67 hold Disallow: / for crawlers they do not name.

How do I scrape a website with Python?

Either fetch the page yourself and parse the HTML, or send the URL to a scraping API. The script in this guide uses the requests package to send the URL to the Spider /scrape endpoint with return_format set to markdown. It then prints the status, the URL and the content of each page in the JSON that comes back.

Is there a free web scraper?

The spider crawler is open source under the MIT license, so you can run it on your own machines. The hosted API also answers requests that carry no key. Keyless access is /scrape only and needs no account. Send Authorization: Bearer free. It is rate limited. On a 429, honor Retry-After. Get a key for anything sustained.

Why does a site block a scraper?

The site chose not to answer. Each page's status field carries the site's own answer, such as 403 or 429, even when the API returns 200. After a 429, wait for Retry-After. A blocked page usually costs a fraction of a cent.

What is the difference between web scraping, web crawling and an API?

Scraping reads a page whose address you already have. Crawling starts from one address, follows links to find the pages and scrapes each one. An API is the site returning its own data as JSON, and when a site publishes one for the data you need, use that. On 2026-11-06 one crawl call returned 60 documentation pages as markdown in 6.5 seconds for $0.048.

Is web scraping still used?

Yes. Price tracking, search indexes, archives and research data all depend on it, and language models added a use, because a model needs current pages to read. On 2026-11-06 one search call and one crawl call took 11 seconds together, and two short scripts turned their output into 396 training records.

What is an example of web scraping?

A price tracker. A script fetches a product page each morning, reads the price with a CSS selector and saves it with the date. The fields script in this guide has the same shape. It sends one request with two selectors to a practice page and reads each quote and its author from css_extracted.

Is web scraping detectable?

Yes. A site sees the address each request comes from, how fast the requests arrive, the headers, and whether the client ran the scripts on the page. A script that says it is a browser and behaves like a script is easy to tell from one. Assume the site can see you, read its robots.txt first and keep your request rate low.

Can a website block web scraping?

Yes. It can ask in robots.txt, answer 429 when requests arrive too fast, refuse an address with a 403 or serve a CAPTCHA in place of the page. Of the 67 robots.txt files we read on 2026-11-16, 13 hold Disallow: / for crawlers they do not name. When a site says no, look for an official API.

Can ChatGPT scrape websites?

Not by itself. A language model writes text and fetches nothing. A chat app reads a web page only when a browsing or scraping tool is connected to it, and that tool does the fetch. Spider has a hosted MCP server for that job. The hosted server registers 27 tools. ChatGPT lists the seven core tools.

Will AI replace web scraping?

No. A model reads a page only after something has fetched it, so a model does not remove the fetch. What a model changes is extraction, since it can fill in the fields you describe without a selector for each one. It also makes the size of the output matter. In our run of 2026-11-06, 60 documentation pages took about 37 times fewer tokens as markdown than as raw HTML.

## Paste a URL and read what one scrape returns

The tool page takes a URL, sends one request and shows you the markdown and the JSON that came back.

[Open the web scraper](https://spider.cloud/web-scraper/)

Scrape 1 url

Scrape 1 url
