Skip to content

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=true for heavy pages, batch jobs and serverless functions with short time limits. See Timeouts.
  • Pick a deterministic wait strategy: wait_for_selector beats an arbitrary delay.

Speed

  • Cache repeated URLs with cache=true and a sensible cache_ttl.
  • Block what you don't need: block_resources=media,font or block_urls=analytics,tracking speeds up rendering.
  • Prefer format=webp or jpeg with image_quality=80 for thumbnails; PNG is lossless but larger.
  • Use selector to 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 fields to reduce payload size (it doesn't change the credit cost, but saves bandwidth).
  • Monitor balances with /v1/usage and enable auto top-up for predictable spend.
  • Use per-key quotas to cap spend from a single integration.

Clean output

  • remove_cookie_banners=true and remove_ads=true for marketing-quality captures.
  • remove_selectors for site-specific overlays (chat widgets, promo bars).
  • full_page_scroll=true to load lazy images before full-page captures.
  • dark_mode=true and scale_factor=2 for 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.