Is Web Scraping Legal? A Practical Guide for 2026

Is web scraping legal? What hiQ, Meta v. Bright Data, robots.txt, terms of service, GDPR and India's DPDP Act mean for your scraper, plus a risk table.

Summarize this post with AI

A 23-minute read, or the key points in about 30 seconds, in the assistant you already use.

Opens in a new tab with the prompt filled in. Nothing passes through this site.

In 2022, a court handed hiQ Labs a famous win for scraping public LinkedIn profiles. Eight months later, hiQ agreed to a $500,000 judgment and a permanent ban on scraping LinkedIn.

Same company. Same data. Two very different headlines.

That's the real answer to "is web scraping legal?" Scraping itself isn't banned in the US, the EU, the UK or India. But four separate bodies of law can still bite, and "the data was public" only answers one of them.

I've compared scraping tools like Firecrawl and Apify on this blog. For this guide, I read the rulings, the regulator guidance and the standards themselves.

Some links here are affiliate links. They don't change your price.

Editorial cover showing a web page being scraped by a small robot while a balance scale weighs the risk
Scraping isn't one legal question. It's four, and public data only answers the first.

In most places, using software to read and copy publicly visible web pages is not illegal in itself. No major jurisdiction I looked at has a law that says "scraping is banned."

The risk comes from what surrounds the scraper.

How you got in. What you agreed to. What you copied. And whose data it was.

Most people get this wrong in one specific way. They treat "public" as a green light for everything. It's a green light for one question, the access question, and mostly in the US. It says little about contracts, copyright or privacy law.

So the useful question isn't "is scraping legal?" It's "which of the four layers does my project touch?"

Which laws actually apply when you scrape a website?

Think of a scraping project as passing through four checkpoints. Each one is a different area of law, with different courts and different penalties.

Diagram of the four legal layers that apply to web scraping: access, contract, copyright and personal data
Each layer is checked separately. Passing one says nothing about the next.
  • Access: did you get past a gate you weren't allowed through? In the US, that's the Computer Fraud and Abuse Act (CFAA).
  • Contract: did you accept terms of service that forbid automated collection, and then break them?
  • Copyright and database rights: are you copying creative content, or a substantial part of a protected database?
  • Personal data: does what you collect identify real people? Then GDPR, the UK GDPR or India's DPDP Act may apply.

A price tracker reading product pages touches mostly the first three layers. A lead-gen tool pulling names and emails touches all four, and the fourth is where regulators are most active right now.

Keep this model in mind. Every section below is one of these layers.

On the access layer, the US courts have moved in scrapers' favour. On the contract layer, the picture is mixed.

Start with Van Buren v. United States, decided by the Supreme Court on 3 June 2021. The Court read the CFAA's "exceeds authorized access" clause narrowly.

It asks whether you entered parts of a computer that were off-limits to you, not whether you misused information you were allowed to see. The Court called this a "gates-up-or-down" inquiry.

Diagram of three access gates for web scraping: an open public page, a login wall and a blocked gate
Public pages are the open gate. Logins and blocks are where scraping risk climbs fast.

Then came hiQ Labs v. LinkedIn. On 18 April 2022, the Ninth Circuit said hiQ had raised a serious question about whether "without authorization" even applies to pages that need no login, even after LinkedIn told hiQ to stop. That was a ruling on a preliminary injunction, not a final verdict.

Here's the catch. The case didn't end there.

In November 2022, the district court found hiQ had breached LinkedIn's User Agreement, including through fake accounts. In December 2022, the parties settled with a $500,000 consent judgment and a permanent injunction against hiQ scraping LinkedIn. The CFAA argument helped hiQ. The contract claim is what finished it.

The second big case points the other way on contracts. In Meta v. Bright Data, decided on 23 January 2024, Judge Edward Chen granted Bright Data summary judgment on Meta's breach of contract claims. He read Facebook's and Instagram's terms as not covering logged-off scraping of publicly viewable data.

Put those two together and a pattern shows up. Logged-off scraping of public pages has fared well in US courts. Fake accounts and logged-in scraping, where you accepted terms, have not.

My take: if your scraper needs an account to work, you've moved from the safest lane to the riskiest one.

Do a website's terms of service make scraping illegal?

Breaking terms of service usually isn't a crime. It can still be a breach of contract, and that's what courts enforce.

The key question is whether you agreed to the terms at all. If you sign up, tick a box or log in, you've almost certainly accepted them. If you only visit a public page, whether "browsewrap" terms bind you is less certain, and the Meta ruling shows courts read ambiguous terms against the site that wrote them.

Europe adds a twist. In Ryanair v PR Aviation (15 January 2015), the Court of Justice of the EU looked at a flight data site that Ryanair's terms said couldn't be screen-scraped. The court held that when a database isn't protected by copyright or the special database right, the EU Database Directive doesn't stop the owner from restricting use by contract.

In plain English: a weakly protected database can end up with stronger contract protection, because the owner can lean on its terms instead.

What I would actually do: read the terms before you build, not after the cease-and-desist letter. If they ban automated access and you need an account, look for an official API first. My beginner's guide to APIs explains why an API is the sanctioned door into most platforms.

Does ignoring robots.txt make scraping illegal?

Not on its own, in most places. But ignoring it is getting harder to defend.

robots.txt is a plain text file where a site lists which paths it asks crawlers to avoid. The IETF standardised it as RFC 9309 in September 2022. The RFC is blunt: the rules are requests that crawlers are asked to honour, and they are "not a form of access authorization."

So why does it still matter? Three reasons.

  • Evidence of intent. Ignoring a clear "Disallow" makes it hard to argue you were acting in good faith if a dispute starts.
  • Privacy regulators use it. France's data protection authority, the CNIL, published guidance on 19 June 2025 saying anyone relying on legitimate interest to scrape for AI training must exclude sites that clearly object through robots.txt or CAPTCHA.
  • Copyright opt-outs. The EU's DSM Copyright Directive, Article 4, allows text and data mining unless the rightholder has reserved it "in an appropriate manner, such as machine-readable means." The EU AI Act, Article 53, requires general-purpose AI model providers to identify and respect those reservations, with obligations applying from 2 August 2025.

Respecting robots.txt costs you a few pages. Ignoring it can cost you your best defence. That trade is easy.

What about personal data and GDPR?

This is the layer where public data gives you the least protection, and where the biggest fines have landed.

Under GDPR, any processing of personal data needs a lawful basis under Article 6. For scrapers, the only realistic one is usually legitimate interests, Article 6(1)(f). That needs a real purpose, real necessity, and a balancing test against the people whose data you take.

Then Article 14 applies. If you collect personal data without getting it from the person directly, you generally must tell them who you are and why, within a reasonable period and at the latest within one month. There is an exemption for impossible or disproportionate effort, but it still requires other measures, such as publishing the information.

Regulators have been clear about where they stand.

  • The 2024 joint statement. In October 2024, 17 data protection authorities, including Canada's, issued a concluding joint statement on data scraping. It repeats that publicly accessible personal data is still covered by privacy law, and that a platform's permission to scrape can't by itself make the scraping lawful.
  • The Dutch DPA. Its May 2024 guidance says scraping by private organisations and individuals is almost never allowed, except when it's very targeted.
  • The UK ICO. Its December 2024 response on generative AI says legitimate interests is in practice the only lawful basis for training on scraped personal data, and it still has to pass all three tests.
  • The CJEU. In October 2024 (case C-621/22), the EU's top court held that a commercial interest can count as a legitimate interest, as long as it's lawful and the processing is strictly necessary. That softens the Dutch DPA's stricter reading, but it doesn't remove the balancing test.

The cost of getting this wrong is not theoretical. In September 2024, the Dutch DPA fined Clearview AI €30.5 million for building a facial recognition database from scraped photos.

Skip this kind of project if you can't explain, in one sentence, why you need each personal field you collect. If a field doesn't serve the purpose, don't scrape it.

India has no law that bans scraping as such. The newer question is personal data.

The Digital Personal Data Protection Act, 2023 carves out one thing that matters to scrapers. Under Section 3(c)(ii), the Act doesn't apply to personal data that the person themselves made publicly available, or that someone published under a legal obligation.

That carve-out is narrower than it sounds. Data someone else posted about a person usually doesn't fit it, unless they were legally required to publish it. And it does nothing for data you collect from non-public sources.

Timing matters too. The DPDP Rules were notified in November 2025, and most obligations start 18 months later, in May 2027. Other Indian laws, like copyright and contract law, still apply in the meantime. If you collect data about people in the EU or UK, GDPR or the UK GDPR can apply on top.

How risky is my scraping project? A decision table

Here's the table I use to sort a project before writing a single line of code. It isn't a legal test. It's a way to see which layers you're touching and how much homework each one needs.

Data you collectHow you access itLayers touchedRelative risk
Product prices, specs, stockPublic pages, logged out, polite rateContract, maybe database rightsLower
Facts from news or blogsPublic pages, logged outCopyright if you republish textLower to medium
Full articles, images, videoAnyCopyright, TDM opt-outsMedium to high
A large slice of one site's databasePublic pages, high volumeDatabase rights, contractMedium to high
Names, emails, profiles of peoplePublic pages, logged outPersonal data law, contractHigh
Anything behind a loginYour account or fake accountsContract, access law, maybe privacyHigh
Anything after a block or CAPTCHABypassing technical measuresAccess law, contract, privacyHighest

Two patterns stand out. Risk rises as data gets more personal, and it rises again as access gets less public. A logged-out price tracker and a logged-in profile harvester are not the same project, even if they use the same code.

Flowchart of a pre-scrape check for web scraping: public access, terms, robots.txt and personal data before you proceed
Run the checks in order. A stop at any step means talk to a lawyer or find another route.

What should I check before I scrape a site?

This is the checklist I run before any scraping job. It won't make a project legal. It tells me when to stop and ask someone who can give real legal advice.

  • Can I see the data without logging in? If not, look for an official API or a licence.
  • Did I accept terms that ban automated access? Read them, and save a dated copy.
  • What does robots.txt say for my paths and my user agent? Respect it.
  • Is there personal data in the pages? List every personal field and why I need it. Drop the rest.
  • Am I copying creative content, or extracting facts? Facts are safer than republishing someone's work.
  • Am I taking a large share of one site's database? That's where EU database rights live.
  • Will I bypass a block, a CAPTCHA or a rate limit? That's the clearest stop sign on this list.
  • Whose data is it, and where do they live? Privacy laws like GDPR can reach you even if your server sits elsewhere.
  • Am I sending a reasonable request rate? Hammering a server creates evidence nobody wants.

If you hit two or more of the risky answers, that's the point to pay for a legal review. A short consult costs far less than defending a lawsuit.

Where do proxies and scraping tools fit in?

Tools don't change the legal answer. They change how easy it is to stay inside it, or to step outside it.

Take proxies. A residential proxy routes your requests through real household IPs, which is useful for checking localised prices or ads.

But using rotation to get past a site's deliberate block moves you into the highest-risk row of the table above. If you do buy proxies, check how the provider sources its IPs; I covered sourcing and consent in my residential proxy provider comparison.

Managed scrapers help in quieter ways. Firecrawl turns pages into clean markdown for AI apps, and my Firecrawl API examples show how to scope a crawl to only the URLs you need. Apify runs ready-made scrapers called Actors on a schedule, so you can control volume and timing. My Apify pricing breakdown explains what that costs.

Neither tool makes a project lawful. Both make it easier to collect less, more slowly, which is what every regulator above keeps asking for.

Frequently asked questions

Is web scraping legal if the data is public?▾
Often, for the access question, especially in the US after hiQ v. LinkedIn. But public data can still be covered by a site's terms, by copyright or database rights, and by privacy laws like GDPR. Public answers one question, not all four.
Can I get sued for scraping a website?▾
Yes. Most scraping disputes are civil cases, usually breach of contract, copyright or database claims, rather than criminal ones. hiQ agreed to a $500,000 consent judgment in LinkedIn's favour in December 2022, after the court found it had breached LinkedIn's user agreement.
Is it illegal to ignore robots.txt?▾
In most places, ignoring robots.txt is not illegal on its own; RFC 9309 says it isn't access authorization. But regulators like the CNIL expect AI scrapers to respect it, EU copyright law treats machine-readable opt-outs as meaningful, and ignoring it weakens your position in any dispute.
Is scraping LinkedIn or Instagram legal?▾
It depends on how. Courts have been more accepting of logged-off scraping of public pages, as in Meta v. Bright Data in 2024. Using accounts, especially fake ones, has gone badly for scrapers, as hiQ found. Profiles are also personal data, so privacy law applies either way.
Is web scraping for AI training legal?▾
It's the most contested area right now. In the EU, rightholders can opt out of text and data mining with machine-readable signals, and AI model providers must respect those opt-outs. If personal data is involved, regulators like the ICO and CNIL expect a legitimate interest assessment and strong safeguards.
Do I need a lawyer to scrape a website?▾
Not for every small, logged-out, non-personal job. For anything involving personal data, logins, large-scale database copying or bypassing blocks, a lawyer who knows your jurisdiction is worth it. This guide is general information, not legal advice.

Scraping isn't the risky part. Logins, personal data and ignored opt-outs are.

If your project sits in the lower rows of the table, the next decision is the tool. Pick one that makes it easy to collect less.

Share