Crawl as Controlled Graph Traversal

Firecrawl’s Crawl endpoint answers a different question from a single-page Scrape: not “Can this URL become a document?” but “Which pages may enter this site-shaped job, in what order, and when is the group complete?” This chapter focuses on that frontier lifecycle. The useful judgment is to predict why a link will be followed or skipped, understand how each admitted page re-enters the ordinary scrape pipeline, and interpret a crawl’s final result without assuming that every discovered link must succeed.

A crawl begins by creating a frontier

A website is a graph of possible pages, but a production crawler cannot treat the whole graph as its job. Firecrawl starts with a seed URL and a set of boundaries: path patterns, domain and subdomain rules, sitemap policy, depth and discovery limits, robots behavior, delay, and a total page limit. Those options define the frontier—the set of URLs that may become page work—before the first discovered link is allowed to expand it.

The API controller validates the request and creates a crawl identity. It stores the origin URL, crawler options, scrape options, team information, retention behavior, and the selected queue backend as a StoredCrawl. It also creates a group for the crawl and enqueues a kickoff job. The group is important because a crawl is not one request that happens to run for a long time. It is a durable unit whose members will be page jobs with separate states, while the group carries the information needed to interpret them together.

Kickoff work prepares the first frontier. Firecrawl can obtain robots.txt for the origin, inspect sitemap locations, and query indexed links when those sources are enabled. If a sitemap is found, it can supply many candidate URLs without waiting for each page to reveal its own links. The index can provide another form of prior knowledge: URLs that Firecrawl has seen before. Neither source replaces page acquisition. They accelerate the discovery of candidates that still have to pass crawl filters and, when admitted, go through page scraping.

The repository also supports a prompt-shaped crawl request. When the caller supplies a natural-language prompt, the controller can first obtain a bounded view of the website’s structure, add a sample of URLs to the prompt, and ask an extraction component to generate crawler options. Those generated options are merged carefully with explicit user values, and the result is checked against the same path-pattern constraints. The important architectural point is that natural language can help describe the frontier, but it does not bypass the frontier’s validation rules.

After kickoff locks and enqueues the first page work, each member is processed through the same single-page pipeline described earlier. A crawl job asks the page scraper to retain raw HTML even when the caller did not request it directly, because the crawler needs the source material to discover links. The worker can therefore receive a normalized document for the caller and still use the underlying page content for the next expansion step.