Create an API key
Create API keys in the dashboard under Integrations. Important behavior:- Keys always start with
bscraper_ - The full secret is shown exactly once when you create it
- You can keep up to 10 active keys per user
- Revoked keys stay in the list for audit visibility, but they stop working immediately
Send an authentication header
You can authenticate with either header:
Both methods are equivalent.
Example request
Session auth vs API keys
- The dashboard uses your signed-in session cookie.
- API keys are the right choice for backend jobs, scripts, and external automations.
- The Google OAuth callback endpoint relies on a browser session and is not designed for direct server-to-server calls.
Rate limits
The API router applies different limits based on the authenticated context:
Tier resolution. “Paid” means the account has completed at least one successful Stripe credit purchase (i.e. a non-zero charge that settled). Once paid, you stay on the paid limiter — refunds do not demote you back to free. Free users with promotional or signup-bonus credits stay on the free limiter until their first paid purchase.
POST /api/v1/jobs has a tighter per-user limiter on top of the global rate limit:
- Sustained rate:
1 req/s - Burst:
3
Rate limit response headers
Every API response carries the current limiter snapshot so your client can pace itself without guessing. Both the modern IETF structured-field form (draft-ietf-httpapi-ratelimit-headers) and the legacyX-RateLimit-* triplet are emitted:
On a
429 Too Many Requests response, the same header set is emitted with r=0 so clients can confirm “remaining=0” without inference.
Client guidance. Back off as soon as RateLimit r=0, or on any 429. Use Retry-After as the minimum wait — exponential backoff on top of that handles transient bursts without thundering the limiter the moment the bucket refills.
Idempotency for POST /api/v1/jobs
Job creation is billable. If your client retries blindly after a timeout, you can create duplicate jobs and duplicate charges.
Send an Idempotency-Key header on POST /api/v1/jobs to make retries safe:
- Replay window: 24 hours
- Same key and same request body: returns the cached response, with
Idempotent-Replayed: true - Same key and different request body: returns
409 Conflictwithidempotency_key_in_use_with_different_body - Same key while the first request is still running: returns
409 Conflictwithidempotency_key_in_useandRetry-After: 1 - Maximum key length: 255 bytes
Common error shape
Most failures return the same JSON envelope:401for missing or invalid authentication400for validation or query parameter errors409for idempotency conflicts422for invalid JSON or invalid UUID path values429for rate limiting or concurrent job limits

