// blog/developer/
Back to Blog
Developer · Published August 30, 2026 · 10 min read · By Toine

Web Scraping Ethics and Legal Guide for 2026

Web Scraping Ethics and Legal Guide for 2026

Web scraping sits in a legal gray area that has gotten both clearer and more complicated in recent years. hiQ Labs v. LinkedIn (US) confirmed that scraping publicly available data does not violate the Computer Fraud and Abuse Act. GDPR (EU) added strict rules around collecting personal data, however it is obtained. And terms of service keep evolving as sites try to control how their data is used.

For developers, the question is not just "can I scrape this?" but "should I, and how do I do it responsibly?" Irresponsible scraping can crash servers, violate privacy, breach contracts, and trigger lawsuits. Responsible scraping is a legitimate tool for research, price comparison, market analysis, and building useful services.

This guide covers the current legal picture, ethical best practices, and technical rules for scraping the web without causing harm or getting yourself in trouble.

* * *

The Legal Framework in 2026

Web scraping legality depends on what you scrape, where you scrape from, and what you do with the data.

United States: - The hiQ v. LinkedIn ruling (2022) confirmed that scraping publicly accessible data does not violate the CFAA - However, violating a website's Terms of Service can be a breach of contract - Copyright law still protects creative content. Scraping and republishing articles, images, or creative works is infringement - The CAN-SPAM Act and state privacy laws restrict scraping and using email addresses for marketing

European Union: - GDPR applies to any personal data (names, emails, IP addresses) regardless of whether it is publicly available - Scraping personal data requires a legal basis (consent, legitimate interest, etc.) - The Database Directive protects databases from extraction and re-use even if individual data points are not copyrighted - The Digital Services Act and AI Act add additional requirements for AI training data collection

Other jurisdictions: - Australia: similar to the EU, with strong privacy protections - Japan: relatively permissive for data analysis and research purposes - China: increasingly restrictive, with data localization requirements

The safest approach: check if an official API exists before scraping. APIs are explicit permissions to access data. Use the API Request Builder to test API endpoints. Many sites that prohibit scraping in their terms offer APIs for legitimate data access.

* * *

Robots.txt and Technical Signals

The robots.txt file is a website's machine-readable statement about what automated access is permitted.

` User-agent: * Disallow: /private/ Disallow: /admin/ Crawl-delay: 10

User-agent: MyScraperBot Disallow: / `

This file says: all bots are blocked from /private/ and /admin/, should wait 10 seconds between requests, and the specific bot "MyScraperBot" is blocked from the entire site.

Is robots.txt legally binding? Not in most jurisdictions. It is a voluntary standard (RFC 9309). However, ignoring it demonstrates bad faith if a legal dispute arises. Courts have considered robots.txt compliance as evidence of whether a scraper acted reasonably.

Best practice: always check and respect robots.txt. If a site blocks your scraper, do not scrape it. Contact the site owner and ask for permission or API access.

Other technical signals that indicate a site does not want to be scraped: - Rate limiting or IP blocking after repeated requests - CAPTCHAs triggered by automated access - Login walls that require authentication to access content - Anti-bot measures (JavaScript challenges, browser fingerprinting)

These signals are not legal barriers, but ignoring them shows disregard for the site's wishes and may escalate to legal action.

Validate the URLs you plan to scrape with the URL Validator before running your scraper. Broken or redirected URLs waste resources and may indicate structural changes that affect your scraping strategy.

Laptop screen showing robots.txt file and web scraper code side by side
Laptop screen showing robots.txt file and web scraper code side by side
* * *

Ethical Scraping Practices

Legal compliance is the floor, not the ceiling. Ethical scraping goes further.

Rate limiting: never send more requests than a human would browse. A human visits maybe 1 page every 5 to 10 seconds. Your scraper should not exceed 1 request per second at most. For smaller sites, 1 request every 5 to 10 seconds is more appropriate.

Identify yourself: set a descriptive User-Agent string that includes your name, contact email, and purpose. This lets site owners contact you if there is a problem.

` User-Agent: ResearchBot/1.0 (contact@example.com; academic research project) `

Scrape during off-peak hours: run intensive scraping jobs during nights and weekends (in the target site's timezone) to minimize impact on their servers and real users.

Cache aggressively: never scrape the same page twice if the content has not changed. Store responses locally and check Last-Modified or ETag headers before re-requesting.

Minimize data collection: scrape only the data you need. If you need product prices, do not also collect user reviews, images, and every metadata field available.

Do not circumvent access controls: if a site requires login, CAPTCHA, or payment to access content, scraping around those barriers is ethically wrong regardless of legality.

Respect content ownership: scraping data for analysis is different from scraping and republishing. Aggregating prices for comparison is generally acceptable. Copying and republishing articles is not.

Format scraped data as clean JSON with the JSON Formatter for easier storage, analysis, and potential sharing of your datasets.

* * *

Personal Data: The GDPR Red Line

The biggest legal risk in web scraping is inadvertently collecting personal data. Under GDPR (and similar laws worldwide), personal data includes anything that can identify a person: names, emails, phone numbers, social media profiles, IP addresses, and even combinations of non-identifying data that together identify someone.

Scraping public social media profiles: even though the data is public, collecting it at scale for purposes not intended by the platform or the user can violate GDPR. The legal basis of "legitimate interest" requires a balancing test between your interest and the data subject's privacy rights.

Scraping review sites: product reviews often contain personal data (reviewer names, locations). Scraping reviews for sentiment analysis may be acceptable. Scraping reviewer information for marketing is almost certainly not.

Scraping directories and databases: business directories often contain personal data (owner names, contact information). Using this data for B2B outreach may be acceptable under "legitimate interest" in some jurisdictions but requires proper assessment.

GDPR compliance checklist for scrapers: 1. Conduct a legitimate interest assessment before scraping personal data 2. Document what personal data you collect and why 3. Implement data minimization (collect only what you need) 4. Set retention limits (delete data when no longer needed) 5. Enable data subject access requests (individuals can ask what data you have) 6. Implement appropriate security for stored personal data 7. Consider appointing a Data Protection Officer if scraping personal data at scale

When in doubt, anonymize. If you need aggregate statistics rather than individual records, aggregate the data during scraping and discard the personally identifiable elements.

Key takeaway

The biggest legal risk in web scraping is inadvertently collecting personal data.

* * *

Alternatives to Scraping

Before building a scraper, check whether there is a better way to get the data.

Official APIs: many sites offer APIs for the data people commonly scrape. Google, Twitter/X, Reddit, Amazon, and most major platforms have APIs. Rate limits and terms vary, but APIs are the cleanest and most legal data source.

Data partnerships: some companies sell or license their data. Contacting the site's business development team may get you a data feed that is more reliable and cheaper than maintaining a scraper.

Open data sources: government data, academic datasets, and non-profit databases are freely available. Data.gov, the World Bank, academic repositories, and Kaggle host enormous datasets.

RSS feeds: many news sites, blogs, and content platforms offer RSS feeds. These are explicitly designed for automated consumption and do not carry the legal ambiguity of scraping.

Data providers: companies like Factual, SimilarWeb, and Bright Data sell pre-scraped datasets. The legal burden shifts to them. You pay for clean, structured data without running scrapers yourself.

Webhooks and exports: some platforms let you subscribe to data updates or export your own data. This is always preferable to scraping for data you have a legitimate relationship with.

The hierarchy of preference: official API > data partnership > open data > RSS > data provider > responsible scraping. Only scrape when none of the alternatives provide the data you need.

Infographic showing the decision tree for ethical web scraping
Infographic showing the decision tree for ethical web scraping
* * *

FAQ

Can I scrape a website if their terms of service prohibit it?

Technically, in the US, violating ToS is generally considered a breach of contract rather than a criminal offense (post-hiQ v. LinkedIn). However, some courts have treated ToS violations more seriously, especially when combined with other factors (like circumventing access controls). The safe approach: if the ToS prohibit scraping, contact the site owner and request permission or ask about API access.

Is scraping for AI training legal?

This is the most actively litigated question in 2026. Major lawsuits (New York Times v. OpenAI, visual artists v. Stability AI) are challenging the legality of using scraped data for AI training. The EU AI Act requires transparency about training data. Japan has been more permissive. The US is still deciding. If you scrape for AI training, document your process and be prepared for evolving regulations.

How do I handle being blocked by a website?

Being blocked is a clear signal that the site does not want your scraper accessing it. Rotating IP addresses, using proxy networks, or spoofing headers to evade blocks is ethically problematic and may be legally risky. Instead, contact the site owner, explain your purpose, and ask for access or API availability.

Can I share scraped data publicly?

It depends on the data. Factual data (prices, weather, stock quotes) is generally not copyrightable and can be shared. Creative works (articles, images, reviews) are copyrighted and cannot be republished. Personal data is subject to privacy laws. Datasets assembled with substantial investment may be protected under database rights (EU). Always analyze the nature of the data before sharing.

Key takeaway

### Can I scrape a website if their terms of service prohibit it.