DATA · 8 MIN READ
Is web scraping legal? What US case law says (and a note on Mexico)
Scraping publicly available data is generally not a federal crime in the US: after the Supreme Court's Van Buren decision, the Ninth Circuit held in hiQ v. LinkedIn that accessing public pages likely is not "without authorization" under the CFAA. But scraping can still breach a site's terms of use, copyright or privacy laws, which is how hiQ ultimately lost. This is not legal advice.
The short answer
Web scraping is a technique, and using it is not illegal in itself. Whether a specific scraping project is lawful depends on what you collect, how you access it and what you do with the data. In the US, the main questions are the Computer Fraud and Abuse Act (CFAA), contract law through a website's terms of use, copyright, and privacy rules for personal data.
The rough rule that comes out of recent case law: scraping pages that anyone can see without logging in is unlikely to violate the CFAA, but it can still create civil liability, especially if you agreed to terms that prohibit it, used fake accounts, or collected personal data.
I am a developer, not a lawyer. This guide explains the landscape so you can ask better questions; for a real project with legal risk, talk to an attorney in the relevant jurisdiction.
The CFAA and the Van Buren decision
The CFAA, codified at 18 U.S.C. § 1030, punishes accessing a computer "without authorization" or "exceeding authorized access." For years, companies argued that scraping after a cease-and-desist letter, or against a site's terms, was unauthorized access under this law.
In Van Buren v. United States (2021), the Supreme Court narrowed the "exceeds authorized access" clause. It held that the clause covers people who access parts of a computer system, such as files or databases, that are off-limits to them, not people who misuse information they are otherwise entitled to access. The approach is often described as a "gates-up-or-down" inquiry: the question is whether you passed a gate you were not allowed through, not why you looked.
hiQ Labs v. LinkedIn: what it decided and what it did not
hiQ Labs scraped public LinkedIn profiles to build analytics products. LinkedIn sent a cease-and-desist letter claiming further scraping would violate the CFAA, and hiQ sued to keep its access.
After Van Buren, the Ninth Circuit reconsidered the case and, in April 2022, affirmed a preliminary injunction in hiQ's favor. Its reasoning: public websites have no gate to lift or lower, so accessing publicly available profiles likely is not access "without authorization" under the CFAA.
That is a strong signal, but it was a preliminary-injunction ruling, not a final judgment on the merits, and it binds courts only within the Ninth Circuit. And the story did not end there. Later in 2022, the district court found hiQ had breached LinkedIn's user agreement, including through fake accounts used to access the platform. In December 2022, the parties agreed to a consent judgment with a $500,000 judgment against hiQ and a permanent injunction requiring hiQ to stop scraping and delete the data.
The practical lesson: the CFAA is a weaker weapon against scraping public data than it used to be, but contract and tort claims are very much alive.
What changed in 2024–2026: Bright Data, X and the AI scraping suits
Two 2024 decisions in the Northern District of California pushed in the same direction as hiQ. In Meta v. Bright Data, the court granted summary judgment to Bright Data in January 2024, reading Meta's terms as binding only users who are logged in; it said the terms do not bar logged-off scraping of public data. Meta then dropped its remaining claims. In May 2024, the court dismissed X Corp.'s suit against Bright Data, holding that X had not stated a claim based on access to its public site and that state-law claims over copying public posts were preempted by the Copyright Act.
The newer fights are about scraping for AI, and they use different legal tools. Reddit sued Anthropic in 2025 over the use of Reddit content, relying on contract and unfair-competition claims. Reddit also sued Perplexity, SerpApi and other data providers, alleging they collected Reddit posts by getting around Google's anti-scraping protections. In July 2026, Judge Paul Engelmayer in New York let Reddit's core claim under the DMCA's anti-circumvention provisions proceed while dismissing some other claims. These are early rulings on whether the claims can go forward, not final decisions.
The pattern for anyone building a scraper: courts keep accepting that logged-out access to public pages is not, by itself, unlawful. The risk has moved to how you get the data (bypassing technical protection measures, using accounts that accepted the terms) and what you do with it (copying expressive content, training models, reselling it).
Where scraping gets risky
Most scraping disputes involve one or more of these situations:
- Logging in to scrape. Accessing data behind a login, especially with fake or shared accounts, moves you closer to the CFAA's gates and clearly into contract territory.
- Bypassing technical barriers. Circumventing CAPTCHAs, IP blocks or paywalls weakens any argument that you were authorized.
- Accepting terms that prohibit scraping. If you agreed to a site's terms (for example, by creating an account), breaching them can create liability.
- Copying expressive content. Facts are generally not protected by copyright, but articles, photos and creative descriptions are. Republishing them is a different matter from analyzing them.
- Collecting personal data. Names, emails, phone numbers or profiles trigger privacy laws such as the CCPA in California, the GDPR in Europe or Mexico's data protection law.
- Overloading servers. Aggressive crawling that degrades a site can support trespass-type claims, and it is simply bad practice.
What about robots.txt?
robots.txt is a file where a site tells crawlers which paths it prefers they avoid. RFC 9309, which standardized the Robots Exclusion Protocol, explicitly states that its rules are not a form of access authorization. In other words, robots.txt is a request, not a lock.
Ignoring it is not automatically illegal, but respecting it is the professional default. It shows good faith, reduces the chance of being blocked and is often the first thing a court or a site owner will ask about.
Is it legal to scrape Amazon?
Amazon product pages are public, so the CFAA reasoning above usually does not make scraping them a federal crime. The bigger issue is contract: Amazon's Conditions of Use say the license to use the site does not include data mining, robots or similar data gathering and extraction tools, nor collecting product listings, descriptions or prices. If you have an account and accept those terms, scraping exposes you to breach-of-contract claims, account suspension and IP blocks, and Amazon actively blocks automated traffic.
If you need Amazon data for a real business, start with the official routes: sellers get their own catalog, orders and pricing through Amazon's seller APIs, and affiliates get product data through Amazon's affiliate program tools. Third-party data providers that license Amazon data are another option. Copying product photos or reviews to republish them adds copyright risk on top of the contract issue.
Screen scraping, data scraping and web scraping: is there a legal difference?
The terms overlap. Web scraping usually means downloading web pages and extracting data from their HTML. Data scraping is the broader term for pulling data out of any output meant for people. Screen scraping originally meant reading what an application shows on screen, and today it often refers to apps that log in to a user's bank or service account with the user's own credentials to read their data.
The legal analysis follows the same questions for all of them: is the data public or behind a login, did you have authorization, what do the terms say and is any personal data involved. Screen scraping behind a login is the riskiest of the three, because it uses credentials and accesses non-public data, which is why banks and regulators increasingly push it toward official APIs.
A note on Mexico
Because I am based in Mexico, clients often ask about Mexican law too. Mexico has no statute that prohibits web scraping in general. The relevant limits come from the federal law on the protection of personal data held by private parties (LFPDPPP), whose current version was published in March 2025, copyright law and the federal criminal code's provisions on unauthorized access to protected systems.
The practical rules are the same as in the US: collect public, non-personal data; do not break access controls; respect terms and robots.txt; and do not republish protected content as your own.
Best practices for a responsible scraping project
These are the rules I apply before writing a single line of a scraper:
- Check for an official API or data export first; if one exists, use it.
- Read the site's terms of use and robots.txt, and document the decision.
- Collect only public data you actually need, and avoid personal data unless you have a lawful basis and a plan to protect it.
- Never log in with fake accounts or bypass CAPTCHAs, paywalls or blocks.
- Rate-limit requests and identify your crawler; scrape during off-peak hours.
- Store facts and analysis, not copies of articles or photos, unless you have permission.
- Get legal advice when the data is sensitive, the volume is large or the target has objected.
Alternatives to scraping
Scraping is often the second-best option. Before building a scraper, check whether the data is available through an official API, a public dataset, a paid data provider or a partnership with the site owner. APIs are more stable, they come with clear terms, and they do not break every time the site redesigns its pages.
When no alternative exists and the data is public, a carefully built scraper is a reasonable tool. When an alternative exists, the extra cost is usually worth the legal clarity and the lower maintenance.
How I approach scraping work
I build data extraction pipelines in Python, including NLP Pipeline, a personal project that extracts, normalizes and translates web content in batches. For client work I start with a feasibility review of each source: whether the data is public, what the terms and robots.txt allow, and whether an official API would be better. Sources that prohibit extraction are discarded.