Skip to main content
Use this guide to handle API errors cleanly, respect rate and concurrency limits, and paginate through multi-page responses.

Error Response Format

Failed API requests return a non-2xx HTTP status code and a JSON body with a message (authentication and scope rejections use error instead, sometimes with a structured error code):
Scope and authentication denials use stable error strings:

HTTP Status Codes

For Web API endpoints (fetch, batch-fetch, crawl), an HTTP 200 with status: "completed" means Hyperbrowser loaded the page, not that the target site returned HTTP 200. Always check data.statusCode on fetched pages to detect target-side 401, 403, 404, or 5xx responses.

Rate Limits & Concurrency

Each plan caps concurrent active browser sessions and concurrent batch-fetch jobs; requests over those caps return 429 Too Many Requests. Plans also cap URLs per batch-fetch job and maxPages per crawl; requests over those caps return 400. During temporary capacity spikes, session or sandbox creation may also return 429; retry after a few seconds. Need higher limits? Contact info@hyperbrowser.ai.

Handling Errors & Retries in the SDKs

Both SDKs throw HyperbrowserError on non-2xx responses and network failures. Inspect statusCode (status_code in Python), retryable, code, and requestId (request_id) to decide whether to retry.

Pagination Conventions

Hyperbrowser uses two consistent 1-indexed pagination shapes depending on the resource:

1. Multi-page job results (GET /api/web/crawl/:id, GET /api/web/batch-fetch/:id)

Responses return totalPages, totalPageBatches, currentPageBatch, and batchSize alongside data.
In the Node and Python SDKs, startAndWait / start_and_wait on web.crawl and web.batchFetch (web.batch_fetch) accept returnAllPages / return_all_pages (default true), which automatically fetches every batch (batchSize: 100) and concatenates data for you.

2. List endpoints (sessions, profiles, sandboxes, jobs)

List endpoints such as GET /api/sessions, GET /api/web/fetch, GET /api/web/batch-fetch, and GET /api/web/crawl accept page (1-indexed, default 1) and limit (page size; endpoint-specific; Web API job lists default to 10 with a max of 20).