`--fields` silently disables `--all-pages`: only page 1 is returned
@adarshdigievo is already working on this.
Since Jul 27, 2026.
Assessment
This issue has not been assessed yet.
Description
--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
- Dominant language
- Go
- Stars
- 13
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from serpapi/serpapi-cli
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
serpapi/serpapi-cli#13 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
serpapi/serpapi-cli#12 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
serpapi/serpapi-cli#10 ·
All issues in serpapi/serpapi-cli
Similar issues
-
textual definition
Difficulty 1/5 Under an hour Newbie friendliness 90/100
geneontology/go-ontology#32653 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
needs design
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100