Configure request deadlines, client timeouts, and disconnect behavior.

On this page

Control how long crawlapi spends on a request with the timeout field, and set your HTTP client timeout at least 5 seconds longer so your client never gives up right as the API finishes.

Setting timeout

Setting Range Default Behavior when exceeded
timeout (request body) 1,000–60,000 ms 30,000 ms Returns 408 TIMEOUT (retryable: true)
HTTP client timeout timeout + 5 seconds 35–65 s Gives the server time to return its response cleanly
curl -sS --max-time 50 https://api.crawlapi.dev/v1/scrape \
  -H "Authorization: Bearer $CRAWLAPI_API_KEY" \
  -H 'content-type: application/json' \
  --data '{"url": "https://example.com", "timeout": 45000}'

Client timeouts and disconnects

  • Client disconnects: Closing the connection early cancels in-flight work on the server.
  • Avoid duplicate retries: Keep your HTTP client timeout longer than the request timeout. If your client drops the socket right as the server finishes and immediately retries, the retry runs as a second request.

Choosing a deadline

Workload Request timeout HTTP client timeout
User-facing / interactive requests 15,000–30,000 ms 20–35 s
JavaScript-heavy apps or large PDFs 45,000–60,000 ms 50–65 s
Background jobs and URL batches 30,000–60,000 ms 65 s (or use crawl -i)

Locale

Pages are requested in a locale matching the site’s country domain or URL path when present (such as .fr or /de-de/), and en-US otherwise.

esc
↑↓navigate↵openescclose
Documentation