Installation
Sync & Async
Both
LobstrClient and AsyncLobstrClient with identical API surfaces.Typed Models
Dataclass models for every response — no raw dicts in the public API.
Auto-Pagination
Lazy
PageIterator streams all pages on demand with .iter() method.Automatic Auth
Token resolved from explicit param,
LOBSTR_TOKEN env, or ~/.config/lobstr/config.toml.Authentication
The SDK resolves your API token in this order:- Explicit parameter —
LobstrClient(token="your_token") - Environment variable —
LOBSTR_TOKEN=your_token - CLI config file —
~/.config/lobstr/config.toml(written by the lobstr CLI on login)
Quick Start
API Reference
User
Balance.available is your plan’s total allotment, not credits remaining. Remaining credits = available − consumed. Example: Balance(available=100, consumed=64) means 36 credits left.Crawlers
Squids
Tasks
Runs
start() vs call(). start() launches a run and hands back the Run immediately — you poll its progress or come back to it later. call() launches a run and waits until it finishes, returning the finished Run (the same as start() followed by wait()). Both accept timeout on the waiting side.Timeouts.
wait() and call() wait indefinitely by default (timeout=None). Set timeout to a number of seconds to give up waiting — a RunTimeout (a subclass of the built-in TimeoutError) is raised. The run is not aborted; it keeps running server-side, so you can re-attach later with runs.wait(run_id) or runs.get(run_id).