scrapebadger
Async Rust SDK and CLI for the ScrapeBadger web-scraping API — 137 endpoints across Amazon, Google (16 product APIs), Twitter/X, Reddit, Vinted, Web Scraping, and Account, plus real-time Twitter Streams (WebSocket + HMAC webhooks).
One crate ships a library and a binary, both named scrapebadger.
Install
[]
= "0.2"
= { = "1", = ["macros", "rt-multi-thread"] }
Library
use ScrapeBadger;
async
Every endpoint is client.<platform>().<method>(<path args…>, params). Inputs are
Default-able *Params structs — set what you need, spread the rest with
..Default::default().
Namespaces
account() · amazon() · google() · reddit() · twitter() · vinted() · web()
Pagination
Generic helpers in core::pagination turn any "fetch one page" closure into a
flat Stream. Cursor- and page-paginated endpoints also have ready-made
*_stream adapters that follow the pagination for you — Twitter (next_cursor),
Reddit (after), and Amazon/Vinted (page numbers):
use StreamExt;
# async
Real-time Twitter Streams (feature = "stream", on by default)
use StreamExt;
# async
For long-lived consumers, client.twitter().stream_events_reconnecting() returns
an endless stream that reconnects with exponential backoff on drop/error.
Verify webhook callbacks with
scrapebadger::twitter::stream::verify_webhook_signature(secret, body, header).
CLI
Every one of the 137 endpoints is a nested subcommand
(scrapebadger <platform> <group> <action> [<ids>] [--flags]), generated from
the same specs as the SDK. The full tree is in docs/CLI.md and
on docs.rs under cli_reference.
# Store the key once in the global config (~/.config/scrapebadger/config.json, chmod 600):
# (or `export SCRAPEBADGER_API_KEY=sb_live_xxx`, or pass `--api-key`)
Discovering commands
|
Output, inspection & escape hatch
||
# raw reaches any endpoint directly:
How it works
Typed models and per-endpoint methods are generated from the vendored OpenAPI
specs (specs/*.json) by cargo run -p xtask -- gen; the ergonomic namespace
layer and transport core are hand-written. See
ARCHITECTURE.md
for the full design, codegen notes, and the complete endpoint reference, and
TASKS.md for
build status.
Configuration
use Duration;
let client = builder
.api_key
.timeout
.max_retries
.build?;
# Ok::
Features
cli(default) — thescrapebadgerbinary.stream(default) — Twitter Streams WebSocket + webhook verification.
License
MIT