Skip to main content
The crawl endpoint can be limited in two ways:
  • maxVisits: cap how many pages are visited.
  • maxDepth: cap how far the crawl can move from startUrls.
Some reasons to limit crawls:
  • Control cost. Each page visit has network and operation cost.
  • Reduce runtime. Smaller crawl scope finishes faster.

Limit the number of visits

maxVisits sets a hard cap on visited pages. Example:

Limit the depth

maxDepth limits crawl distance from the startUrls set. Depth is measured as:
  • Start URL = depth 0
  • Links from start URLs = depth 1
  • Next level = depth 2, etc.
Example: