Skip to content

robots.txt

robots.txt is a plain text file at the root of a website that tells crawlers which paths the site owner would like them to stay away from.

What robots.txt contains

The file sits at the root of a domain, for example example.com/robots.txt. It lists rules per user agent: which paths a bot is asked not to visit, and sometimes how fast it may request pages or where the sitemap is. Search engines and other well-behaved crawlers read it before they start and follow what it asks.

A preference, not a permission

robots.txt has no enforcement behind it. A rule in the file does not block anyone, and the absence of a rule does not grant a legal right to collect or reuse content. Whether a particular crawl or scrape is lawful depends on other things as well: the site's terms, data protection law, copyright and database rights, and rules on unauthorized access. Respecting robots.txt and keeping request rates low is still good practice and shows good faith. Read more in is web scraping legal and in web crawler vs web scraper. This is general information, not legal advice.

Full guideWeb Crawler vs Web Scraper: What's the Difference?

Related terms

Turn any website into a product data table

Every product page is a data source.