include_patterns, exclude_patterns, depth and max_items, and the download endpoint
Ask your AI agent
With the Zenrows MCP server connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.How patterns steer the crawl
include_patterns decides two things: which URLs Crawl returns, and which links it opens to find more. Plan your patterns around the path that leads to your items, not just the items themselves.
depth sets how many link steps Crawl follows from the start URL: 1 returns the links on the start page. max_items sets how many URLs Crawl keeps and max_pages how many pages it opens, both 100 by default. Each opened page is billed as one Fetch request.
Map the site and export a CSV
Start a crawl withoutoutput_format, wait until it ends, download every URL as NDJSON, then write a CSV.
--include-patterns and --exclude-patterns once per pattern. See the CLI guide.
Example output
The Python run printed:urls.jsonl holds one URL per line:
urls.csv is ready for a spreadsheet:
stop_reason: max_pages means the site holds more, so raise max_pages to map the rest. URLs come back normalized: http and https, www. and trailing-slash spellings of one URL count as one, and tracking parameters such as utm_* are removed.
Map one level
For a quick inventory of what a single page links to, setdepth: 1. Crawl opens the start page once and returns its matching links:
cURL
Customize it
Troubleshooting
- Few URLs, all from the first page: your include patterns skip the pages that link onward. Add the pagination or category path, such as
/page/. status: failedwithno_items_found: no link matched your patterns. Check the patterns against real URLs on the start page; patterns match plain text anywhere in the URL.- The list stops short:
stop_reasonismax_itemsormax_pages. Start a new crawl with higher values. - A download is missing URLs: the
X-Crawl-Statusheader readrunning. Download again once the crawl has ended. 429withtoo_many_crawls: your account’s Crawl and Batch jobs are all running. Wait theRetry-Afterseconds, then start the crawl.
Related recipes
Crawl a website from a start URL
Crawl and store each page’s HTML in the same run.
Scrape a list of URLs
Turn your URL inventory into pages or data with Batch.
Get structured JSON from any page
Extract fields from each mapped page.
Build a RAG knowledge base from a website
From a mapped site to markdown chunks for retrieval.