Crawl politely and legally

Before a pipeline fetches its first page, decide what it is allowed to fetch, how fast, and what it keeps. Here you build the robots.txt check, the per-host queue and the cache that every later lesson sits on.

A crawler that works is easy. A crawler that is still welcome six months later takes a little more thought. The site on the other end pays for every request you make: bandwidth, CPU, sometimes a per-request bill from their own host. When a crawler hits a small site twenty times a second, the owner notices, blocks the IP range, and in the worst cases sends a letter. Most of the scrapers that get blocked are not malicious. They are careless.

The APIs in this course do the fetching for you. When you send a URL to Website to Text or URL Title, the request to the target site is made from APIVerve's infrastructure, not from your server. That removes the browser, the proxy and the HTML parser from your code. It does not remove the decision about which URLs to send and how often. That decision is yours, and so are its consequences. This lesson builds the three pieces that encode it: a robots.txt check, a queue that paces each host, and a cache that stops you asking for the same page twice.

What you are allowed to fetch

Three sources of rules apply to any page, in rough order of how often they bite.

robots.txt is the site owner's machine-readable request: which paths crawlers should leave alone, sometimes how long to wait between requests. It was standardised as RFC 9309 in 2022 after nearly thirty years as a convention. It is not access control, and nothing technically stops you ignoring it. But it is the clearest statement of intent you will get, operators treat violations as hostile, and in a dispute it is the first thing anyone will ask about.

Terms of service are a contract question. A site's terms may forbid automated access or commercial reuse of its content. How enforceable that is depends on the jurisdiction and on whether you ever agreed to them: an account you signed up for is a much stronger agreement than a footer link you never clicked. The long-running US case hiQ Labs v. LinkedIn is the usual reference. The courts found that scraping public pages was not "access without authorization" under the federal anti-hacking statute, and hiQ still lost later on breach of LinkedIn's user agreement. Public is not the same as permitted. If a page needs a login, treat it as off-limits to your pipeline unless you have a written agreement.

Personal data law applies to what you keep, not just what you fetch. Under GDPR and laws modelled on it, a name, email address or profile photo on a public page is still personal data, and collecting it is processing that needs a lawful basis, a purpose and a retention limit. The practical rule for pipelines: do not store personal data you have no use for. If you are building a price tracker, the reviewer names on the product page are a liability, not an asset. Drop them at extraction time, before they reach a database you will have to audit later.

None of this is legal advice, and the edges are genuinely unsettled. But a pipeline that respects robots.txt, stays out of logged-in areas, paces itself and keeps only what it needs is on the right side of nearly every dispute that has actually happened.

Check yourself

Your pipeline extracts product prices from public retailer pages. The pages also show reviewer names and avatars. What should happen to the reviewer data?

Answer the check above to continue.

Run every example on your own key. Free plan, no card.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales