--fields and --all-pages are mutually incompatible in practice. Combining them returns page 1 only, exits 0, and prints nothing to stderr. The pagination flag is inert.
Reproduction
# 2 pages, 18 results
serpapi search engine=google q=coffee --all-pages --max-pages 3 | jq '.organic_results | length'
# => 18
# same flags + --fields: 1 page, 8 results
serpapi search --fields "organic_results[].{title,link}" \
engine=google q=coffee --all-pages --max-pages 3 | jq '.organic_results | length'
# => 8
# --fields alone, no pagination at all
serpapi search --fields "organic_results[].{title,link}" \
engine=google q=coffee | jq '.organic_results | length'
# => 8
Runs 2 and 3 are byte-identical after jq -S '.organic_results'. adding --all-pages --max-pages 3 changes nothing.
Suspect
Passing --fields sets json_restrictor, which prunes the response server-side. That prune removes serpapi_pagination, the only thing the pagination loop reads to find the next page.
Environment
- main @ 853dbae
- go1.25.5, darwin/arm64
- Verified with live API calls against engine=google
--fieldsand--all-pagesare mutually incompatible in practice. Combining them returns page 1 only, exits 0, and prints nothing to stderr. The pagination flag is inert.Reproduction
Runs 2 and 3 are byte-identical after
jq -S '.organic_results'. adding--all-pages--max-pages 3changes nothing.Suspect
Passing
--fieldssetsjson_restrictor, which prunes the response server-side. That prune removesserpapi_pagination, the only thing the pagination loop reads to find the next page.Environment