Core concepts
Best practices
Checklist for fast, reliable and cost-efficient production integrations.
Security
- Call the API from your server, never from browsers or mobile apps. Keys in client code will leak.
- Use one key per service and environment, with an alias you'll recognize in logs.
- Set per-key quotas and expiry dates on keys you share or use in less-trusted environments.
- Rotate keys periodically.
- Verify webhook signatures before trusting payloads.
Reliability
- Retry only what's retryable — 5xx, timeouts and plan rate limits. See Error handling.
- Set a client timeout slightly above the 60-second server limit (for example 65 s).
- Use
is_async=truefor heavy pages, batch jobs and serverless functions with short time limits. See Timeouts. - Pick a deterministic wait strategy:
wait_for_selectorbeats an arbitrarydelay.
Speed
- Cache repeated URLs with
cache=trueand a sensiblecache_ttl. - Block what you don't need:
block_resources=media,fontorblock_urls=analytics,trackingspeeds up rendering. - Prefer
format=webporjpegwithimage_quality=80for thumbnails; PNG is lossless but larger. - Use
selectorto capture only the element you need. - Keep concurrency within your plan's rate limits.
Cost
- Failed requests are free — but avoid sending invalid URLs in bulk; validate inputs first.
- Use
fieldsto reduce payload size (it doesn't change the credit cost, but saves bandwidth). - Monitor balances with
/v1/usageand enable auto top-up for predictable spend. - Use per-key quotas to cap spend from a single integration.
Clean output
remove_cookie_banners=trueandremove_ads=truefor marketing-quality captures.remove_selectorsfor site-specific overlays (chat widgets, promo bars).full_page_scroll=trueto load lazy images before full-page captures.dark_mode=trueandscale_factor=2for docs and retina displays.
Respect target sites
- Only capture pages you're allowed to access.
- Avoid hammering a single site with high concurrency; spread requests and cache results.