Dev tools
Is Web Scraping Legal? Rules, Cases and Safe Practice
Is web scraping legal? Mostly yes for public data, but contracts, logins, copyright and privacy law set limits. See key cases and a safety checklist.
Is web scraping legal? Collecting publicly available data from websites is generally not illegal in the United States, and several court rulings have favoured scrapers of public pages. But "generally legal" hides the details: whether it is allowed in a specific case depends on what data you take, how you get it (logged out or logged in, politely or by hammering the server), what the site's terms say, whether the content is copyrighted or personal data and which country's law applies. This guide explains the rules and the real court cases, then gives a checklist for staying on the safe side.
This is general information, not legal advice. Laws change, courts disagree and your facts matter. If you're building a product or collecting data at scale, talk to a lawyer who knows data and technology law. What follows covers the main web scraping legal issues in the US and EU, walks through two worked examples and ends with a practical checklist.
Is Web Scraping Legal? The Short Answer
The honest answer is "it depends, but you can predict most of the risk". Scraping is a method, not a legal category, and the same script can be fine or unlawful depending on five questions:
| Question | Lower risk | Higher risk |
|---|---|---|
| Is the data public? | Visible to anyone, no login | Behind a login, paywall or technical barrier |
| What kind of data? | Facts, prices, listings, public records | Personal data, copyrighted text, images, creative work |
| How do you access it? | A normal request rate, a clear user agent | Fake accounts, bypassing blocks, overloading servers |
| What do the rules say? | Terms you never accepted, robots.txt followed | Terms you agreed to, explicit prohibitions ignored |
| What do you do with it? | Analysis, research, price comparison | Republishing copyrighted content, targeting individuals, building face databases |
Most disputes come from the right-hand column. If everything you do sits in the left-hand column, the risk is low, although never zero.
The Legal Frameworks That Apply
Scraping can touch several different areas of law at once. The ones that come up most:
| Area | What it covers | Typical claim against scrapers |
|---|---|---|
| Computer access law (US: the CFAA) | Unauthorised access to computers | "You accessed our system without authorisation" |
| Contract law | Website terms of use | "You broke our terms by scraping" |
| Copyright | Original expression, not bare facts | "You copied our protected content" |
| Trespass to chattels | Interfering with someone's servers | "Your bots slowed or harmed our systems" |
| Data protection (GDPR and state laws) | Personal data | "You processed people's data without a lawful basis" |
| Database rights (EU) | Substantial investment in a database | "You extracted a substantial part of our database" |
A single scraping project can raise all six. The cases below show how courts have treated each.
Is Web Scraping Legal in the US?
In the US the main questions are computer access, contract and copyright.
The Computer Fraud and Abuse Act (CFAA)
The CFAA is the federal anti-hacking law, and it was the first weapon sites reached for. In hiQ Labs v. LinkedIn, hiQ scraped public LinkedIn profiles to sell analytics about employee attrition, and LinkedIn tried to block it. The Ninth Circuit held in 2019 that the CFAA's "without authorization" concept likely did not apply to public data that anyone can see. The Supreme Court then sent the case back for reconsideration in light of its June 2021 decision in Van Buren v. United States, which held that someone "exceeds authorized access" only if they obtain information from areas of a computer that are off limits to them, a "gates-up-or-down" inquiry, and not merely by using access they already had for an improper purpose. The Court left open whether the inquiry depends only on technical barriers or also on contracts and policies. The Ninth Circuit again sided with hiQ on the CFAA question in 2022.
The lesson for scrapers: public pages with no login are the strongest ground, and a login or other technical gate changes the analysis.
Contract: Terms of Service
Even where the CFAA doesn't apply, a site can sue for breach of its terms. Whether it works depends on whether the terms bind you. Two 2024 decisions in the Northern District of California are useful:
- Meta v. Bright Data (January 2024). The court granted summary judgment to Bright Data on Meta's breach-of-contract claim. Meta's terms governed a person's "use" of Facebook and Instagram, and Bright Data's logged-off scraping of public data was not "use" in that sense.
- X Corp. v. Bright Data (May 2024). The court dismissed X's claims, reasoning that enforcing X's terms against scraping of publicly available content would conflict with the federal Copyright Act and be preempted. It also dismissed X's trespass and related access claims.
Both are district court rulings, not nationwide law, and appeals, later orders and different judges can change the picture, so check the current status before relying on them. And the flip side is the final outcome in hiQ: in November 2022 the court granted LinkedIn summary judgment on its breach-of-contract claim, finding that hiQ had violated LinkedIn's user agreement through its scraping and its use of fake accounts, and in December 2022 the parties entered a consent judgment with a $500,000 payment and an order to stop scraping and destroy the data and code. The lesson: terms you actually agreed to, for example by logging in or creating accounts, can be enforced.
Copyright and Facts
Copyright protects original expression, not facts. In Feist v. Rural Telephone (1991) the Supreme Court held that a telephone directory's white pages, which listed names, towns and numbers in alphabetical order, lacked the minimal creativity needed for copyright, and rejected the "sweat of the brow" idea that effort alone earns protection. So raw facts, such as prices, scores, addresses and listings, are not copyrightable, while a compilation can be protected for its original selection and arrangement. Photos, articles, reviews and other creative content are protected, and copying and republishing them is risky even if scraping them was not.
Trespass to Chattels
The older idea of trespass to chattels (interfering with someone's property) was used in eBay v. Bidder's Edge (2000), where a court enjoined an aggregator whose automated queries burdened eBay's servers. The practical rule is simple: if your scraper slows a site or causes harm, you hand them a claim. Rate limiting yourself is both polite and protective.
Is Web Scraping Legal in the EU and UK?
In Europe the two biggest issues are personal data and database rights.
Personal data. The GDPR applies to personal data whether or not it is public. If you scrape names, profile information, photos or anything that identifies a person, you need a lawful basis (for example legitimate interests, after a balancing test), you must respect principles like data minimisation and purpose limitation, and you generally have to inform the individuals, with limited exceptions. "It was public" is not a defence. The clearest example is the Dutch Data Protection Authority's 2024 fine of €30.5 million on Clearview AI for building a database of billions of face images scraped from the internet without consent, which the authority called an illegal database.
Database rights. The EU's Database Directive gives makers of databases a special right against extraction or re-use of a substantial part of the contents, if they made a substantial investment in obtaining, verifying or presenting them. This can apply even where copyright does not.
Contracts. In Ryanair v PR Aviation (CJEU, January 2015) the Court held that the Directive's limits on contractual restrictions do not apply to a database protected by neither copyright nor the database right, which leaves its owner free to set conditions by contract, subject to national law. So terms against scraping may be enforceable in EU countries even for data that has no other protection.
Text and data mining. The EU Copyright Directive (2019) includes an exception that allows text and data mining of lawfully accessible works, but rights holders can reserve their rights in an appropriate way, such as machine-readable means. Scraping to train AI models sits in this evolving area, and courts in several countries are still deciding how the rules apply.
The UK follows a broadly similar approach to the EU on personal data, through the UK GDPR. Other countries, such as India, Canada, Singapore and Australia, have their own laws and I don't cover them in detail here, so check local advice if you operate there.
Is Web Scraping Legal for Personal Use?
Is web scraping legal for personal use? Often the legal risk is lower, but "personal" doesn't make it automatically safe. A personal project that collects public prices, weather data or your own public posts for private analysis rarely draws attention, and nobody has an interest in suing over it. But the same rules still apply in principle: scraping behind a login can breach terms you agreed to, personal data is still regulated in the EU even when you collect it for a hobby (though the GDPR has an exemption for purely personal or household activity, which a scraping project often won't meet if it goes beyond private use) and overloading a small site can cause real harm.
The practical test is the same as for businesses: public data, low request rate, no login tricks, no republishing of copyrighted content and no targeting of individuals. Check the site's terms and robots.txt, and consider using the official API instead, which removes most of the doubt. For how to scrape politely and technically correctly, see our guide to web scraping with Python.
Web Scraping Legal Issues by Type of Data
The data you collect often matters more than the technique. This table shows the usual risk by data type, assuming public pages and a polite scraper:
| Data type | Main legal concern | Typical risk |
|---|---|---|
| Prices, scores, stock levels, timetables | Terms of service, server load | Low |
| Public records and government data | Licence or reuse conditions; US federal government works are not under copyright, but other countries differ | Low to medium |
| Business listings and addresses | Database rights in the EU, terms of service | Medium |
| Reviews, articles, descriptions | Copyright in the text | Medium to high if republished |
| Photos and videos | Copyright, sometimes personality and privacy rights | High if reused |
| User posts and profiles | Personal data law, terms of service, platform rules | Medium to high |
| Anything behind a login or paywall | Contract, computer access law | High |
| Face images and other biometric data | Strict privacy law; the Clearview AI fine shows the scale | Very high |
Two habits reduce most of the risk: collect the least personal data that does the job, and store the facts you need rather than a copy of the page.
What About robots.txt?
robots.txt is a file that tells crawlers which paths they may fetch. The Robots Exclusion Protocol, published as RFC 9309, says that these rules "are not a form of access authorization" and that the protocol is not a substitute for real content security. So robots.txt is a request, not a law: ignoring it does not by itself make scraping illegal.
It still matters in practice. It shows the site owner's wishes, so ignoring it weakens your position in a dispute and may breach terms that reference it. A well-behaved crawler fetches and respects it, treats a cached copy as valid for no more than about 24 hours and handles the 500 kibibyte parsing limit the RFC sets as a minimum. The simple rule is to follow robots.txt and any published API terms, and to treat the owner's objection as a reason to stop and ask.
Scraping to Train AI Models: Still Unsettled
Scraping the web to build AI training sets is the most contested use today, and the law is not settled. In 2025, a US federal court in Bartz v. Anthropic held that training a model on books was fair use but that keeping a library of pirated copies was not, and the company later agreed to pay $1.5 billion to authors and publishers. In Kadrey v. Meta the court granted summary judgment to Meta on training, but on a narrow record, and cautioned that a better-evidenced case could come out differently. In Thomson Reuters v. Ross, a court rejected a fair-use defence for a non-generative legal research tool, and the appeal outcome should be checked on the court's docket. The pattern so far is that how the data was obtained, and whether the output competes with the original, matters a great deal. Our AI copyright guide covers the wider picture. If you scrape for training data, treat rights holders' opt-outs and robots.txt rules seriously, and get legal advice.
Key Court Cases at a Glance
| Case | Year | Court | What it matters for |
|---|---|---|---|
| eBay v. Bidder's Edge | 2000 | N.D. Cal. | Heavy automated crawling can be trespass to chattels |
| Feist v. Rural Telephone | 1991 | US Supreme Court | Facts are not copyrightable; compilations need originality |
| Ryanair v PR Aviation | 2015 | CJEU | Contract can restrict scraping of unprotected databases in the EU |
| Van Buren v. United States | 2021 | US Supreme Court | CFAA "exceeds authorized access" is a gates-up-or-down test |
| hiQ Labs v. LinkedIn | 2019, 2022 | 9th Cir., N.D. Cal. | Public-data scraping and the CFAA; later loss on contract and fake accounts |
| Meta v. Bright Data | 2024 | N.D. Cal. | Logged-off scraping not covered by terms governing "use" |
| X Corp. v. Bright Data | 2024 | N.D. Cal. | Copyright Act preempted contract claims against scraping public content |
| Dutch DPA v. Clearview AI | 2024 | Dutch regulator | GDPR fine for scraping faces without consent (€30.5 million) |
Worked Examples
Example 1: Scraping Public Prices for a Comparison Site
You want to collect product names and prices from a retailer's public pages to compare them with other shops.
| Question | Answer | Effect |
|---|---|---|
| Public, no login? | Yes | Lower risk |
| What data? | Prices and product names: facts | Low copyright risk; don't copy photos or descriptions |
| Access method | One request per second, clear user agent, robots.txt respected | Low trespass risk |
| Terms | Prohibit scraping, but you never accepted them | Contract claim is weaker, though not impossible |
| Use | Show prices with links back | Low risk |
| Personal data? | None | No GDPR issue |
Verdict: relatively low risk. The remaining exposure is the site's terms and anti-bot measures, and an official feed or API would be better where available. If the retailer sends a cease-and-desist letter, take it seriously and get advice instead of ignoring it.
Example 2: Building a Sales List from Social Profiles
You want to collect names, job titles and email addresses of EU-based professionals from a social network that requires login.
| Question | Answer | Effect |
|---|---|---|
| Public, no login? | No: you'd need an account | Higher risk |
| What data? | Personal data | GDPR applies |
| Access method | Fake or shared accounts, bypassing limits | Very high risk, as in hiQ |
| Terms | Accepted when you sign up | Breach of contract claim likely |
| Use | Cold outreach | Needs a lawful basis and a duty to inform people |
| Result | Several legal frameworks at once | High risk |
Verdict: high risk. Use official APIs, data providers with a clear legal basis or opt-in lists instead.
What to Do If You Receive a Cease-and-Desist Letter
A cease-and-desist letter is a demand, not a court order, but it changes your position: you now have clear notice that the owner objects, and continuing can look deliberate. A sensible response:
- Don't ignore it, and don't panic. Read it for the specific claims (terms, copyright, access) and any deadline.
- Pause scraping that site while you assess. Continuing after notice weakens your position.
- Preserve records. Keep logs, code and data, and don't delete things, since deleting after a threat can look bad.
- Get advice from a lawyer who handles technology and data law, especially if you have a commercial product.
- Respond in writing, politely and through your lawyer where possible, and consider whether an official API, a licence or removing the disputed data resolves it.
- Check what you've already done with the data, such as copies you've shared or models you've trained, since that affects the remedy.
Many disputes end with an agreement to stop or to license the data. Few go to trial, which is why predicting your risk in advance is worth the effort.
Safe Web Scraping Checklist
- [ ] Prefer the official API or a data licence if one exists.
- [ ] Scrape only public pages, with no login, no fake accounts and no bypassing of blocks.
- [ ] Read the terms of service and robots.txt and follow them.
- [ ] Throttle requests and scrape off-peak so you don't harm the site; see API rate limiting for how sites defend themselves.
- [ ] Use an honest user agent with contact details.
- [ ] Collect facts, not creative content, and don't republish copyrighted text, images or reviews.
- [ ] Avoid personal data; if you need it, identify a lawful basis, minimise what you keep and be ready to inform and delete.
- [ ] Keep records of what you collected, when and why.
- [ ] Check how any data you use for AI training interacts with rights holders' reservations, an unsettled area (see the AI training section above).
- [ ] If the owner objects, stop and talk before continuing, and get legal advice for commercial projects.
Common Mistakes
- Assuming "public" means "free to use". Public availability helps on computer access law but doesn't remove copyright, contract or privacy obligations.
- Scraping behind a login. Logging in usually means you accepted terms, and fake accounts have been the decisive fact in cases like hiQ.
- Ignoring personal data rules. Names, photos and emails are personal data in the EU even when public.
- Hammering the server. A scraper that slows a site invites a trespass or abuse claim and a block.
- Ignoring a cease-and-desist. Even if you think you're right, a letter is the point at which to get advice.
- Treating one case as universal law. The big rulings are mostly from US federal trial and appeals courts, and facts differed. Other courts and countries may decide differently.
- Copying creative content. Prices are facts; product descriptions, photos and articles are not.
- Believing a proxy makes you anonymous or lawful. Hiding your address doesn't change what the law says about your conduct.
FAQ
Is web scraping legal?
Often yes, especially for public, factual data collected politely. US courts have been relatively favourable to scraping of public pages, but contract terms, logins, copyright, privacy law and your conduct can make it unlawful. It depends on the data, the method and the country.
Is web scraping legal in the US?
Scraping public data does not by itself violate the CFAA, according to the hiQ and Van Buren line of cases, but you can still face claims over terms of service, copyright or harm to servers. Scraping behind a login or with fake accounts is much riskier.
Is web scraping legal in the EU?
It can be, but the GDPR applies to any personal data you scrape even if it's public, and database rights and contract terms can restrict extraction. The Clearview AI fine of €30.5 million shows how seriously regulators treat mass scraping of personal data.
Is scraping Amazon or Wikipedia legal?
There is no special law for either site; the same factors apply. Retail sites usually prohibit scraping in their terms and use anti-bot defences. Wikipedia's text is licensed for reuse with attribution under Creative Commons terms, and it provides dumps and APIs, so scraping pages isn't necessary.
Does robots.txt make scraping illegal?
No. The Robots Exclusion Protocol says its rules are not a form of access authorisation. But ignoring robots.txt can weaken your position in a dispute and may breach terms of service, so follow it.