Lesson 4 of 15
36. Design a Web Crawler

36.3 What are the doors?

3 min read+10 XP

Step 3: API and data model (10 minutes)

A crawler is mostly internal, so its "API" is the interfaces between its parts:

frontier.add(url, priority) # from seeds, extracted links, re-crawl scheduler frontier.next() -> url # only when that host's politeness timer allows fetcher.fetch(url) -> status, headers, body (bounded size and time) parser.links(body, base_url) -> [url] store.put(url, fetched_at, content_hash, compressed_body)

Plus admin endpoints: add seeds, pause or slow down a host, block a domain, see crawl stats.