Repository navigation
feat(crawl): make depth optional; defaults are 100 pages and 100 items - #36
Closed
gonzalo-zenrows wants to merge 1 commit into
Closed
gonzalo-zenrows wants to merge 1 commit into
gonzalo-zenrows wants to merge 1 commit into
Conversation
The Crawl API now accepts a create without depth: the crawl has no depth limit and follows links until max_pages or max_items stops it, or no link is left. max_pages and max_items now default to 100. - create(): depth is an optional keyword, sent only when given. - Crawl.depth is optional: a crawl created without depth omits it. - README and docstrings state the new defaults. - Acceptance: check 21 expects the documented default of 100; check 1's offline half creates without depth and expects none sent or read back.
StefanoGuerrini
self-requested a review
October 13, 2026 07:05
StefanoGuerrini
marked this pull request as ready for review
October 13, 2026 07:05
StefanoGuerrini
approved these changes
Oct 13, 2026
Contributor
|
Folded into #31, which now carries this change, so the Crawl client ships as one pull request. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
depthis now optional onZenRowsCrawlClient.create()and on theCrawlmodel, and the docs give the API's new defaults of 100 formax_pagesandmax_items. Stacked on #31: merge after it.What the task asked for
The Crawl API changes
POST /v1/crawlsin three ways:depthis optional. Left out or null, the crawl has no depth limit. It follows links untilmax_pagesormax_itemsstops it, or it runs out of links to open. An explicit depth is still 1 to 100,000. Anything else gets 422invalid_parameter.max_pagesandmax_itemsdefault to 100 instead of 10. The caps stay at 100,000.depthcomes back from create, get and list with nodepthfield. A crawl created with one still echoes it.How the check confirmed it
Unit tests check that a create without
depthsends{"url": ...}only and readsdepth is None. They also check that a create withdepth=1sends it, and thatlistparses a page that mixes both. 220 passed.ruff checkandruff format --checkare clean,tyreports nothing new, andmypy --stricton the acceptance type-check file showsdepth: int | None. Check 1's offline half now creates withoutdepth, and check 21 expects 100.How to try it
Provenance
depth: int | None = None, sent only when given, matching the other optional create arguments.Review
Human must verify:
Record owed
None in this repo. The changelog entry for the new defaults ships with the API.
Deviations
READMEquickstart keepsdepth=1andmax_pages=100, so the harness's cost substitutions still apply.