Skip to content

Core concepts

Timeouts

The 60-second limit, platform-specific function limits, and when to go async.

Server limit: 60 seconds

Synchronous requests have a 60-second server-side limit, which covers loading the page, waiting (wait_until, wait_for_selector, delay), scrolling and capturing. If the render doesn't finish in time the API returns 500 and you're not billed.

Most requests finish in one to a few seconds. Long ones are usually caused by:

  • wait_until=networkidle0 on pages with constant background requests (analytics, websockets);
  • large delay values (max 30 s);
  • very long full-page captures with full_page_scroll;
  • slow proxies.

Set your HTTP client timeout slightly above the server limit (for example 65 seconds) so you receive the API's error rather than a client-side abort.

Use is_async for long work

With is_async=true the API immediately returns 202 with a job_id. The job then runs without the 60-second HTTP constraint of your client. Either poll /v1/jobs/{id} (free) or pass a webhook_url to be notified. See Async jobs.

curl -G "http://localhost:4000/v1/capture" \
  --data-urlencode "url=https://heavy.example" \
  -d full_page=true -d full_page_scroll=true -d is_async=true \
  -H "x-api-key: $SNAPLENS_API_KEY"
# → {"success":true,"job_id":"job_…","status":"Queued"}

Platform tips

Serverless platforms often stop your function before a slow capture finishes.

Platform Default / max duration Recommendation
Vercel Functions Short default; configurable maxDuration depending on plan Raise maxDuration to at least 65 s for sync calls, or use is_async + webhook.
AWS Lambda 3 s default, up to 15 min Set the function timeout to ≥ 65 s. Behind API Gateway (29 s limit), use is_async.
Netlify Functions 10 s default, up to 26 s synchronous Use is_async + webhook, or Background Functions.
Cloudflare Workers Generous wall-clock time while waiting on fetch, but subrequest limits apply Sync calls usually work; for batches use Queues + is_async.
Make.com HTTP module timeout is configurable (default 40 s) Raise the timeout to 60–65 s or use is_async with a webhook trigger scenario.
Zapier Actions time out after about 30 s Use is_async=true with a "Catch Hook" Zap as webhook_url.

Limits change over time; check your platform's documentation for current values.

Retries and idempotency

A timed-out synchronous request is never billed, so retrying is safe. For async jobs, store the job_id and poll it instead of re-submitting.