Skip to main content

6 min read

Legal Web Scraping: Laws, Court Cases and Ethical Data Extraction

Legal Web Scraping and Ethical Data Extraction

Legal web scraping depends less on the technique and more on three questions: what data you collect, how you access it, and what you do with it afterwards. Collecting public product prices at a modest pace is a very different matter from copying a protected database, scraping behind a login, or harvesting personal data. This guide summarises the main legal and ethical considerations, so that you can plan a project sensibly and know when to ask a lawyer.

This article is general information, not legal advice. Laws differ by country and change over time, so take professional advice for your specific project.

Is web scraping legal?

Web scraping isn’t illegal as such, and businesses, researchers and journalists use it every day. Whether a particular project is lawful depends on several separate areas of law, any of which can apply at the same time:

Area The question it asks
Data protection (GDPR, CCPA and others) Are you collecting information about identifiable people, and do you have a lawful basis for it?
Contract (terms of service) Have you agreed to terms that restrict automated access, for example by creating an account?
Computer access laws (such as the US CFAA) Are you getting around a technical barrier, such as a login or password?
Copyright and database rights Are you copying protected content, or a substantial part of a protected database?
Unfair competition and other laws Does your use harm the site or mislead people, for example by overloading servers or passing off content as your own?

Personal data: the biggest risk

Many people assume that information visible to everyone is free to collect. Under the EU and UK GDPR, that’s not the case: names, photos, email addresses, usernames and similar details are still personal data when they are public.

  • You need a lawful basis. For scraping this is usually “legitimate interests”, which requires a documented balancing test showing that your purpose outweighs the impact on the people concerned.
  • People have rights. These include being told about the processing, accessing their data and objecting to it. Collecting data indirectly doesn’t remove these duties.
  • Regulators enforce this. Several European data protection authorities have fined Clearview AI for scraping photos of people from the web to build a facial recognition database.
  • Collect less. If your purpose doesn’t need personal data, filter it out at the point of collection, not afterwards.

Other regions have their own rules: the CCPA and other state laws in the US, PIPEDA in Canada, the Privacy Act in Australia, and many more. Where your project touches personal data, involve your data protection adviser early.

Terms of service and logins

Terms of service are a contract, so their force depends on whether you agreed to them. When you create an account and log in, you normally accept the terms, and scraping that breaks them can lead to account closure and legal claims. Data collected while logged out of a public page is in a weaker position for the site owner, but it isn’t automatically safe.

Two US cases show where the lines have been drawn:

  • hiQ Labs v. LinkedIn: in 2022 the US Ninth Circuit Court of Appeals found that scraping publicly accessible profiles probably doesn’t count as accessing a computer “without authorization” under the CFAA. hiQ still lost later in the case on contract grounds, because it had used accounts that accepted LinkedIn’s terms.
  • Meta v. Bright Data: in 2024 a US federal court found that Meta’s terms didn’t stop Bright Data from collecting public data while logged out.

The practical lesson: don’t scrape behind a login without permission, and don’t get around barriers that are designed to keep you out.

Copyright and database rights

  • Facts such as a price or a stock level aren’t usually protected by copyright. Creative content such as articles, photos and product descriptions often is.
  • In the EU, a database can be protected by a separate “database right” when its maker invested substantially in it. Extracting a substantial part, or repeatedly taking small parts, can infringe that right.
  • Text and data mining: EU law allows mining of lawfully accessible content, but commercial users must respect a rights holder’s machine-readable opt-out. Check robots.txt and any AI or data mining reservations on the site.
  • Republishing scraped content is riskier than analysing it internally.

Ethical data extraction: beyond the law

Something can be legal and still damage trust in your brand. Good practice includes:

  • Don’t harm the site: limit your request rate and concurrent connections, scrape outside peak hours, and stop if you see errors.
  • Respect robots.txt: it isn’t a law in most places, but it clearly states the owner’s wishes.
  • Prefer official access: use an API, data feed or licensed dataset where one exists. See pre-collected datasets vs collecting your own.
  • Be clear about purpose: know why you need each field, and don’t reuse data for a new purpose without checking again.
  • Secure and delete: protect what you store, and set a retention period.

A compliance checklist before you start

  1. Write down the purpose and the exact fields you need.
  2. Check whether an official API, feed or licence covers the need.
  3. Read the site’s terms and robots.txt, and decide whether you’ll need to log in. If you will, get permission.
  4. Identify any personal data, and either exclude it or document your lawful basis.
  5. Check for copyrighted content or a protected database, and plan to analyse it rather than republish it.
  6. Set rate limits, monitoring and an emergency stop.
  7. Decide how long you’ll keep the data and who can access it.
  8. Get legal advice for commercial projects, sensitive data or anything that has been contested before.

Where proxies fit

Proxies are a networking tool. A residential proxy lets you see public pages as visitors in a given location see them, and spreads requests across many IPs so that no single address is overloaded. Proxies don’t change any of the legal questions above. They aren’t permission to collect data, and they shouldn’t be used to get around a login, a block or a site’s clear refusal. Read more in residential proxies for web scraping.

Conclusion

Legal web scraping is usually a matter of restraint: collect public, non-personal data where you can, stay logged out unless you have permission, respect copyright and database rights, and keep your request rate considerate. Document your decisions, and take legal advice where the stakes are high.

Planning a responsible data project? Start with a $1.99 trial.

Questions and Answers

Q1: Is it legal to scrape publicly available data?

A1: Often, yes, but “public” isn’t a complete defence. Personal data, copyright, database rights and contract terms can all still apply.

Q2: Does robots.txt have legal force?

A2: In most countries, robots.txt isn’t a law in itself. It’s still evidence of the site owner’s wishes, and in the EU it can be used to opt out of commercial text and data mining.

Q3: Can I scrape personal data if it’s public?

A3: Under the GDPR you need a lawful basis and must respect people’s rights, even for public data. Many projects avoid the issue by excluding personal data altogether.

Q4: Do proxies make scraping legal?

A4: No. They change the IP address your requests come from, not your legal position. The same rules apply with or without a proxy.

Related reading

Put the article into practice.

Spin up real residential IPs in 150+ countries. Pay once or subscribe — from $11.