Repository navigation
feat(google): type the condensed Light Search response (0.88.0, SCR-774) - #108
Merged
Merged
Conversation
GET /v1/google/light/search now returns each organic result's own URL in `link` and a smaller response with no null fields (scrape-badger/scrapebadger#3741). - New GoogleLightResponse with GoogleLightSearchParameters, GoogleLightSearchMetadata, GoogleLightSearchInformation, GoogleLightOrganicResult and GoogleLightPagination, exported from google/index.ts and the package root. Fields the API can leave out are optional (displayed_link, snippet, gl_requested, the location echo). - light() returns GoogleLightResponse (string for output: "html", GoogleLightResponse | string when output is not known) instead of GoogleResponse. The overloads' param types are unchanged. - light() JSDoc: the new shape, the 422s for tbm / udm / ludocid / lsig / kgmid / ibp / uds, the 503 with Retry-After: 1 (not billed), and device / user_agent being echoed only. - docs/google.md: a "Light Search" section, a methods-table row, the type list, and the link-resolving text limited to search(). - Tests: the condensed answer comes back typed as GoogleLightResponse from /v1/google/light/search, and the overloads resolve to string / GoogleLightResponse / the union. - Version 0.88.0 and a CHANGELOG entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…laim Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Google Light Search now returns each organic result's own URL and a smaller response (API: scrape-badger/scrapebadger#3741). This updates the Node SDK to match. Python SDK: scrape-badger/scrapebadger-python#118.
What changed
src/google/types.ts:GoogleLightResponse,GoogleLightSearchParameters,GoogleLightSearchMetadata,GoogleLightSearchInformation,GoogleLightOrganicResult,GoogleLightPagination. Fields the API can leave out are optional (displayed_link,snippet,gl_requested, the location echo).google.search.light()returnsGoogleLightResponse(stringforoutput: "html", the union whenoutputis not known) instead of the untypedGoogleResponse. The overloads' param types are unchanged. It still callsGET /v1/google/light/search.light()JSDoc: the new shape, the 422s (tbm,udmother than14/web,ludocid,lsig,kgmid,ibp,uds) and the 503 withRetry-After: 1(not billed).docs/google.md: a new "Light Search" section, a methods-table row, the type list, and the link-resolving text now coverssearch()only./v1/google/light/searchtyped asGoogleLightResponse, and the overloads resolve tostring/GoogleLightResponse/ the union.For TypeScript users, code that read a field Light no longer returns (for example
related_searches) now fails to compile. The API stops returning them with scrape-badger/scrapebadger#3741.Checks
npm run lint,npm run typecheck,npm run build: passnpm test: 38 files, 538 tests passRelease is a separate step; nothing is published from this PR.
🤖 Generated with Claude Code