/api/crawl endpoint supports two crawl modes. You must provide exactly one of pattern or query.
Pattern-based crawl
Usepattern when you already know the URL structure you want.
A URL pattern is a full URL plus wildcard operators:
*matches any character except/**matches any character including/
-
Pattern:
https://example.com/a/* -
Pattern:
https://example.com/a/**
results.hits section contains all the matching URLs.
If your pattern is too broad, switch from ** to * where you want to avoid crossing path segments.
Query-based crawl
Usequery when you do not know the URL structure ahead of time, but you can describe the kind of page you want.
With query crawl, FetchFox starts from startUrls, visits those pages, and uses page content plus links on the page to learn which URLs directly match your query and which links lead toward matching pages.
query crawl requires startUrls.
Example request:
pattern when you know the URL shape. Use query when you want FetchFox to discover relevant URLs from page content.