Guide
Is web scraping legal? What the courts and regulators say
Updated by the Handles API team
The short answer
Whether scraping is lawful has no yes or no answer, because several different laws apply at once. In the US, the Ninth Circuit said in hiQ v. LinkedIn that the computer crime law does not reach public websites, yet hiQ still lost on contract and paid a settlement.
In Europe the central question is different: whether you are collecting personal data and on what legal basis. This guide covers the four questions that decide most cases, the US decisions, the European rules, and what platforms write in their terms. For how scraping methods compare technically, see social media scraping.
The four questions that decide it
Four separate legal questions apply to any scraping project, and passing one does not answer the others.
1. Computer access law (CFAA)
The Computer Fraud and Abuse Act is the main US federal computer crime law, and its question is whether you accessed a computer without authorization. In Van Buren v. United States, the Supreme Court read it as a "gates-up-or-down inquiry".
2. Contract and terms of service
A site's terms are a contract, and breaking them can create a civil claim even where no crime is involved. hiQ's fate in 2022 is the standard example, covered below.
3. Copyright and database rights
Posts, photos and videos can be protected by copyright, so what you copy and how you reuse it matters. The EU also protects databases with a separate database right.
4. Personal data and GDPR
If the data relates to an identifiable person, privacy law applies whether or not the data is public. That is the question developers most often skip, and the one regulators are most active on.
US court cases
The US cases that matter most for scraping run from 2019 to 2024, and the hiQ timeline shows why a court win on one question does not settle the rest.
| Date | Case | What happened |
|---|---|---|
| 2019 | hiQ Labs v. LinkedIn | The Ninth Circuit first ruled in a preliminary injunction fight over hiQ's scraping of public LinkedIn profiles, in hiQ's favor. |
| 3 June 2021 | Van Buren v. United States, No. 19-783 | The Supreme Court ruled 6-3 and described CFAA liability as a gates-up-or-down inquiry. It did not directly rule on what "without authorization" means. |
| 2021 | hiQ Labs v. LinkedIn | The Supreme Court sent the case back to the Ninth Circuit to reconsider in light of Van Buren. |
| 18 April 2022 | hiQ Labs v. LinkedIn, 31 F.4th 1180 | The panel again upheld the preliminary injunction. This was an early-stage ruling, not a final judgment. |
| November 2022 | hiQ Labs v. LinkedIn | The district court held that hiQ breached the LinkedIn User Agreement by scraping and by using fake accounts. |
| December 2022 | hiQ and LinkedIn settlement | A consent judgment of $500,000 against hiQ and a permanent injunction. A settlement carries no precedent value. |
| 23 January 2024 | Meta Platforms v. Bright Data | Judge Edward Chen denied Meta's summary judgment motion, finding the terms did not bar scraping public data while logged off. Meta dropped the remaining claim on 23 February 2024. |
| 9 May 2024 | X Corp. v. Bright Data | Judge William Alsup dismissed X's complaint for failure to state a claim. In November 2024 an amended complaint was partly allowed, so the case is still going. |
The Ninth Circuit wrote that "the concept of 'without authorization' does not apply to public websites", and that the opposite rule risked "information monopolies that would disserve the public interest". But hiQ ultimately lost on contract. Criminal access law and contract are separate risks.
Two limits on the Meta ruling: it turned on how Meta's terms were worded at the time, and Instagram's current terms cover automated collection whether or not you are logged in. In the X case, the court reasoned that X's claim would give it "de facto copyright ownership". Do not read either result as a clear win for scrapers.
Europe and the UK: public is not the same as free to use
Regulators in Europe and elsewhere treat personal data as protected even when it is publicly visible. On 24 August 2023, 12 data protection authorities, including the UK ICO, Canada's OPC and Australia's OAIC, issued a joint statement. It says:
- "Personal information that is publicly accessible is still subject to data protection and privacy laws in most jurisdictions."
- "Mass data scraping of personal information can constitute a reportable data breach in many jurisdictions."
A follow-up statement in October 2024 had 17 authorities. Under the GDPR you need a legal basis for processing, listed in Article 6. Article 14 says you must inform people when you obtain their data from somewhere other than themselves, with an exception where that would take "disproportionate effort".
Enforcement is real. The Dutch authority fined Clearview AI 30.5 million euros over its collection of images for facial recognition, announced on 3 September 2024.
What the platforms' terms say
Platform terms are where most scraping disputes start, and the main platforms restrict automated collection in plain words.
| Platform | What the terms say |
|---|---|
| X Terms of Service | "crawling or scraping the Services in any form, for any purpose without our prior written consent is expressly prohibited" |
| TikTok Terms of Service | "use automated scripts to collect information from or otherwise interact with the Services" |
| Instagram Terms | "You can't attempt to create accounts or access or collect information in unauthorized ways." |
| Meta's Automated Data Collection Terms | "You may not access or collect data from our Products using automated means (without our prior permission)" |
Is scraping Instagram, Twitter or LinkedIn legal?
Each of the three platforms people ask about most has a case that bears on the answer, though none settles it. The same questions apply to TikTok, covered in the TikTok scraper guide.
Meta v. Bright Data went Bright Data's way on the terms as written then, but Instagram's terms now restrict collecting information in unauthorized ways. For the technical side, see the Instagram scraper guide.
Twitter (X)
X's terms prohibit scraping without written consent, and X Corp. v. Bright Data has not ended. See the Twitter scraper guide for the methods.
LinkedIn is the hiQ case: a win on computer access at the injunction stage, then a loss on the User Agreement. See the LinkedIn API page for what we serve.
A practical checklist
A defensible scraping project starts with a short list of habits, and none of them is a guarantee.
- Collect only publicly available data. Do not log in, and do not create fake accounts to get access.
- Keep request rates low and honor robots.txt. It is a signal site owners use, and it avoids loading their servers.
- Minimize personal data. Collect the fields you need and nothing more.
- Write down your purpose and your legal basis before you collect.
- Set a retention period and delete data when it expires.
- Respond to removal and erasure requests against your own copy.
- Read the terms of service of each site you collect from.
- Ask a lawyer who knows your country and your use case.
Where Handles API fits
Handles API is a read-only API that returns public social media data, and it cannot make your use of that data lawful on its own. It does not return private or protected content, and it does not send messages, post, like or follow. It is an independent service with no affiliation with the platforms.
The acceptable use policy forbids using the data for harassment, surveillance, doxxing, spam and selling personal data, and it says you are responsible for complying with platform terms and the law where you and the people concerned are located. Anyone can ask us to remove a public account through the data removal page. That removes records from our catalog, not copies customers already received. More in the privacy policy.
Using an API moves the collection off your servers, but it does not remove your own obligations under GDPR or similar laws.
Frequently asked questions
Is web scraping legal in the US?
Is it legal to scrape public data?
Is scraping Instagram legal?
Is scraping Twitter (X) legal?
Does GDPR apply to public data?
What did hiQ v. LinkedIn decide?
Can I get sued for scraping?
Try it on your own handles
The free trial gives you 100 credits for every endpoint, once, with no card. Paid plans start at $29 a month.