AI web scraping is usually legal when you collect publicly available, non-personal facts from logged-out pages without bypassing technical controls. It gets risky at three specific points: how you access the site, whether the payload contains personal data or copyrighted expression, and what your model or product does downstream. This is engineering guidance, not legal advice.
What AI web scraping is, and why the legal question splits in three
Web scraping is automated retrieval of pages followed by parsing: an HTTP client fetches HTML (or a headless browser renders it), a parser extracts fields, and a pipeline stores rows. Nothing about that mechanism is unlawful — it is what search engines, price comparison sites and archive projects have done for decades.
AI changed two variables, not the mechanism. First, volume: crawlers gathering training and retrieval data hit sites far harder than a price checker does. The Wikimedia Foundation reported a roughly 50% increase in multimedia bandwidth since January 2024, driven largely by scraper bots pulling content for AI. Second, downstream use: a dataset that trains a model which answers the questions people used to visit the source for looks like substitution, and substitution is where courts and regulators get interested.
So stop asking "is web scraping illegal" as a single question. Score every pipeline on three independent layers — access, payload, use — because they are governed by different bodies of law and a clean pass on one buys you nothing on the others.
Is AI web scraping legal in the US?
In the United States the access layer is dominated by the Computer Fraud and Abuse Act, which penalises accessing a computer "without authorization". The reference point is hiQ Labs v. LinkedIn, where the Ninth Circuit held in 2022 that scraping public profile data likely does not violate the CFAA. Read that ruling narrowly: it says a public, logged-out fetch is probably not hacking. It says nothing about copyright, privacy, contract or server burden.
The other US pressure points:
- Contract. Creating an account and clicking "I agree" forms a contract. Breaching an anti-automation clause is not a crime, but it is a breach — and it supplies the intent narrative in an access claim.
- DMCA section 1201. Engineering around a technological protection measure — solving a CAPTCHA to reach gated content, replaying tokens, defeating a paywall — is a separate legal theory from the CFAA.
- Copyright and fair use. Facts are not copyrightable; expression is. Prices, SKUs, dates and coordinates are low risk. Articles, reviews, code and images are not. In February 2025 a Delaware court granted Thomson Reuters summary judgment on fair use over Westlaw headnotes used to build a competing legal research tool, and the US Copyright Office's May 2025 pre-publication report on generative AI training signals that unlicensed copying to produce outputs competing with the source is unlikely to be excused.
- State privacy law. California's CPRA broadened the "publicly available" carve-out for data a person made public themselves, but Illinois BIPA has no such comfort: the Clearview AI settlement, valued by the court at about $51.75 million, came from scraping faces without consent.
For a US-only breakdown with more case detail, see our companion piece on whether web scraping is legal in the US.
Is web scraping legal in Europe?
The EU flips the emphasis. Access law barely features; data protection and copyright do all the work.
Under the GDPR, every piece of personal data is in scope regardless of whether it was public. "I found it on a public profile" is not a lawful basis — you still need one, plus transparency obligations that are awkward for a scraper that never meets the data subject. Regulators have acted on exactly this pattern: a Polish authority fined a company for scraping publicly available personal data from an official business register, and although a court later overturned the fine on other grounds, the prohibition on that scraping was upheld.
On the content side, the Digital Single Market Directive gives research organisations a broad text-and-data-mining exception (Article 3) and everyone else a narrower one (Article 4) that rights holders can switch off with a machine-readable reservation. That single clause is why robots.txt and emerging TDM opt-out signals carry more legal weight in Europe than in the US: ignoring a machine-readable reservation can remove the exception you were relying on. The Database Directive's sui generis right adds a further layer if you copy a substantial part of a structured collection.
The UK sits close to the EU model via the Data Protection Act, the Copyright, Designs and Patents Act and the Computer Misuse Act.
The three-layer test, scored before you deploy
| Layer | Question | Lower risk | Higher risk | Governing law |
|---|---|---|---|---|
| Access | How did you reach the bytes? | Logged-out public page, throttled, honest user agent, robots respected | Credentialed session, paywall or CAPTCHA circumvention, ignoring blocks | CFAA, contract, DMCA 1201, Computer Misuse Act |
| Payload | What is in the response? | Prices, stock, specs, coordinates, public company facts | Names, emails, biometrics, full articles, reviews, images | GDPR, CCPA/CPRA, BIPA, copyright, Database Directive |
| Use | What does the product do with it? | Internal analytics, benchmarking, monitoring, citation with links | Verbatim republication, raw resale, training a model that substitutes the source | Fair use, DSM Articles 3-4, unfair competition |
| Burden | What did you cost the target? | Conservative concurrency, caching, incremental refresh | Millions of concurrent requests, degraded origin performance | Trespass to chattels (eBay v. Bidder's Edge, 2000) |
A single failure moves the whole pipeline up a risk band. Lead-generation scrapes are the classic case where a clean access layer meets a hostile payload layer — we covered that pattern in whether lead generation is legal, rule by rule.
Is web scraping for commercial use legal, and is it ethical?
Commercial use is not the dividing line — most defensible scraping is commercial. Substitution is the line. A transformative product that sends users back to the source, or that derives statistics no one could read off the page, sits very differently from a mirror of someone else's catalogue or a model that regurgitates their prose.
Ethics tracks the same axis and is cheaper to implement than litigation. Four commitments cover most of it: do not degrade the origin; do not collect personal data you cannot justify keeping; identify yourself honestly rather than impersonating Googlebot; honour opt-outs even where they are not binding in your jurisdiction. Threads on Reddit about whether AI web scraping is legal usually converge on "public data is fine" — which is the right answer for the access layer and an incomplete one for the other two.
Why 2022-era answers no longer hold
If your compliance position was written around 2022, it was almost certainly built on hiQ: public equals permitted. That was the high-water mark for access-based analysis. Since then the action has moved. Copyright suits target training corpora rather than fetching. Privacy regulators focus on public personal data. The EU gave machine-readable opt-outs legal effect. Site operators shifted from Terms of Service pages to bot management, and AI-specific crawler directives appeared in robots.txt across large publishers. Nothing overturned hiQ; the question simply moved one layer downstream, and answers that only address access are now half an answer.
Building a compliance-first pipeline
Legal posture is mostly an engineering artefact. These steps are cheap at design time and expensive to retrofit after a cease-and-desist:
- Write down the fields you need, then delete every other field from the parser. Over-collection is the single biggest self-inflicted risk.
- Classify each field as fact, expression or personal data, and store that classification with the schema.
- Keep an explicit target allowlist. No pipeline should discover and fetch arbitrary domains without a policy check.
- Snapshot
robots.txtand the Terms of Service on the day you start, and re-check on a schedule. - Stay logged out. If a task genuinely requires authentication, treat it as a licensing conversation, not an engineering problem.
- Throttle conservatively, add backoff, and cache aggressively so a re-run costs the origin nothing.
- Filter emails, phone numbers and other identifiers at ingestion, before anything reaches a database.
- Log the URL, timestamp, response status and cost of every fetch, plus a retention and deletion schedule.
That last point is where a metered API earns its keep: the response is your audit record. Every call to our web scraping API returns the same envelope, so provenance and spend land in the same row.
curl https://api.quanticdata.io/v1/scrape \
-H "Authorization: Bearer $QD_API_KEY" \
-d '{ "url": "https://example.com/product/42" }'
{ "success": true,
"data": { "markdown": "# Example Domain\n…" },
"usage": { "cost_usd": 0.0002 },
"retries": [ { "attempt": 1, "outcome": "ok" } ] }
import requests, datetime, csv
ALLOWED = {"example.com", "docs.example.com"}
HEAD = {"Authorization": f"Bearer {KEY}"}
def fetch(url, log):
host = url.split("/")[2]
if host not in ALLOWED: # policy gate, not a try/except
return None
r = requests.post("https://api.quanticdata.io/v1/scrape",
headers=HEAD, json={"url": url}, timeout=120).json()
log.writerow([url, datetime.datetime.utcnow().isoformat(),
r["success"], r.get("usage", {}).get("cost_usd", 0)])
return r["data"]["markdown"] if r["success"] else None
Discovery deserves the same discipline. Finding sources through a SERP API keeps a record of how a URL entered your set, and a bounded crawl and map job with a page cap is easier to defend than an open-ended spider that wanders into a login wall.
Agents, MCP and the audit problem they create
Agent workflows break the old assumption that you know in advance which URLs you will fetch. An agent decides at runtime, which means your compliance boundary has to live in the tool layer rather than in a config file a human reviewed. Three controls carry most of the weight: allowlisted domains enforced by the tool, a hard page or step budget per task, and an envelope per call that records what was fetched, what it cost and how many retries it took. Our web scraping MCP server exposes search, scrape, map, crawl, batch and audit as discrete tools precisely so each action is logged and priced individually instead of disappearing inside an opaque browsing loop.
The same test applies when the pipeline is described in plain language rather than written by hand. Our AI web scraping service turns a prompt into a dataset by searching, mapping and scraping — and the three layers do not care that the plan was generated: you still own the access method, the payload and the downstream use.
Honest cost math
Compliance costs less than evasion. Scraping 50,000 public product pages costs about $10 at $0.0002 per page, or roughly $50 if every page needs JavaScript rendering at $0.001. A thousand discovery searches is about $0.50. Because billing is pay per success, a page you correctly declined to force — because it sat behind a login or returned a block — costs nothing, and async crawl jobs auto-refund the unfetched share. That removes the perverse incentive to hammer a resistant target just to justify a prepaid quota, and it means the money you save on bypass engineering can go into scoping and legal review, where it actually reduces risk.
This article is technical guidance from engineers, not legal advice. Scraping outcomes turn on jurisdiction, contract and facts specific to your project — get a qualified lawyer to review anything involving personal data, authenticated access or model training.
Sources & further reading
- How crawlers impact the operations of the Wikimedia projects
- US Copyright Office — Copyright and Artificial Intelligence
- hiQ Labs, Inc. v. LinkedIn Corp., Ninth Circuit (2022)
- Directive (EU) 2019/790 on copyright in the Digital Single Market
- IAPP — Polish court overturns DPA's first GDPR fine
- Imperva — Is Web Scraping Illegal? Depends on Who You Ask