Skip to content

feat(google): type the condensed Light Search response (0.88.0, SCR-774) - #108

Merged
0xGhostCasper merged 2 commits into
mainfrom
kasparasizi1/scr-774-light-phone
Dec 3, 2026
Merged

0xGhostCasper merged 2 commits into
mainfrom
kasparasizi1/scr-774-light-phone

Conversation

@0xGhostCasper

@0xGhostCasper 0xGhostCasper commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

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

  • New exported types in 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() returns GoogleLightResponse (string for output: "html", the union when output is not known) instead of the untyped GoogleResponse. The overloads' param types are unchanged. It still calls GET /v1/google/light/search.
  • light() JSDoc: the new shape, the 422s (tbm, udm other than 14/web, ludocid, lsig, kgmid, ibp, uds) and the 503 with Retry-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 covers search() only.
  • Tests: the condensed answer comes back from /v1/google/light/search typed as GoogleLightResponse, and the overloads resolve to string / GoogleLightResponse / the union.
  • Version 0.88.0 and a CHANGELOG entry that lists the fields removed from the Light response.

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: pass
  • npm test: 38 files, 538 tests pass

Release is a separate step; nothing is published from this PR.

🤖 Generated with Claude Code

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

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@0xGhostCasper
0xGhostCasper merged commit f74e586 into main Dec 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants