Skip to content

Update scrapingbee-cli package to support Header based Authorization - #32

Open
sahilsunny wants to merge 3 commits into
feat/api-parity-1.6.0/SCR-577from
sahil/scr-585-update-scrapingbee-cli-package-to-support-header-based
Open

Update scrapingbee-cli package to support Header based Authorization#32
sahilsunny wants to merge 3 commits into
feat/api-parity-1.6.0/SCR-577from
sahil/scr-585-update-scrapingbee-cli-package-to-support-header-based

Conversation

@sahilsunny

@sahilsunny sahilsunny commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Switches API auth from the deprecated api_key query param to the Authorization: Bearer header, so the key no longer shows up in URLs. The only exception is crawl, whose scrapy-scrapingbee middleware will be migrated separately.

Also adds two params that are missing from the docs but confirmed working against the live API (it rejects unknown params with 400, these return 200):

  • google --nb-results
  • amazon-product --autoselect-variant

Stays on 1.6.0 since it isn't published yet; release date set to 2026-08-24.

Tested live on a pipx install (usage, GET, PUT, both new flags) plus unit tests for the new behavior. Based on #31 — merge that first, with a merge commit (not squash).

The google --help variant matched on the raw PTY stream, but the REPL's
differential renderer can repaint straight to the final frame without
ever emitting the scrolled-off warning line into the stream, so the
assertion raced on slow CI runners (failed on ubuntu/3.11 in PR CI and
macos/3.10 on main — different cells, same mechanism). Restore the
1.5.1-era approach: usage --help keeps the output short so the warning
stays on screen, and the transient pump checks every intermediate
screen state.
…SCR-585)

- All Client requests now authenticate via 'Authorization: Bearer' instead
  of the deprecated api_key query parameter, so the key no longer appears
  in request URLs. Applies to every command including auth validation and
  usage; crawl's scrapy-scrapingbee middleware still builds api_key URLs
  and migrates separately.
- google --nb-results: requested results per page. Absent from llms.txt
  but verified live: the API strictly rejects unknown params (400 'Unknown
  field' control) yet accepts nb_results with 200.
- amazon-product --autoselect-variant: matches the existing amazon-search
  flag; same live verification (200 vs 400 bogus-param control).
- Skill docs: --custom-google price corrected 15 -> 20 credits per the
  API's own error message ('Each request will cost 20 credits!').

Live-verified via pipx build: usage/GET/PUT all 200 under Bearer auth,
nb-results and autoselect-variant accepted. 863 unit tests green (new:
Bearer session header, no api_key in GET/POST/usage params, param
forwarding for both new options); ruff + ty clean.
sahilsunny added a commit that referenced this pull request Aug 20, 2026
Stacked PRs (based on another PR's branch) silently got zero checks:
on.pull_request was filtered to branches [main], so PRs #32 and #33
never ran CI. Drop the filter so every PR runs the suite; the push
trigger stays main-only.
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.

1 participant