API REFERENCE

Screenshot API documentation

Pass a URL and get back a screenshot or PDF, or extract structured data with AI. Reference for the /v1/screenshot and /v1/extract endpoints below — there's no SDK required.

Authentication

Every request needs your API key, either as a Bearer header or an api_key query parameter. Find your key on the dashboard.

curl
curl "https://snapurl.app/v1/screenshot?url=https://example.com" \
  -H "Authorization: Bearer sk_live_..." \
  -o shot.png

GET /v1/screenshot — capture a screenshot or PDF

Renders the page at url and streams back the image or PDF bytes directly.

Parameters

ParamTypeDefaultDescription
urlstring, requiredThe page to capture. Must be a public, resolvable URL.
formatpng / jpeg / webp / pdfpngOutput format.
widthint, 320–38401280Viewport width in pixels.
heightint, 240–4320800Viewport height in pixels.
full_pagetrue / falsefalseCapture the full scrollable page instead of just the viewport.
wait_untilload / domcontentloaded / networkidleloadWhen to consider navigation finished.
wait_forCSS selectorWait for a selector to appear before capturing.
delayint ms, 0–5000Extra fixed delay before capture, on top of any wait conditions.
selectorCSS selectorCrop the capture to a single element instead of the whole viewport/page.
block_adstrue / falsetrueBlock common ad networks before rendering.
block_cookie_bannerstrue / falsetrueAuto-dismiss common cookie consent banners.

GET /v1/extract — extract structured JSON

Renders the page at url and returns AI-extracted structured data as JSON. Available on the Starter and Growth plans — Free returns 403 plan_not_eligible.

Parameters

ParamTypeDefaultDescription
urlstring, requiredThe page to extract from. Must be a public, resolvable URL.
promptstringPlain-language description of the data to extract. Required unless schema is given — exactly one of the two must be present.
schemaURL-encoded JSON objectA JSON schema-like object describing the fields to extract. Required unless prompt is given.
include_screenshottrue / falsefalseAlso render a 1280×800 screenshot and return it base64-encoded. Consumes one extraction and one screenshot render.

wait_until, wait_for, delay, block_ads, and block_cookie_banners behave exactly as documented above for /v1/screenshot.

Response

{ "data": { ... } }, with a base64 PNG screenshot field added when include_screenshot=true.

curl
curl "https://snapurl.app/v1/extract?url=https://example.com&prompt=Get+the+page+title" \
  -H "Authorization: Bearer $SNAPURL_KEY"
JavaScript
const res = await fetch(
  "https://snapurl.app/v1/extract?url=https://example.com&prompt=Get+the+page+title",
  { headers: { Authorization: `Bearer ${process.env.SNAPURL_KEY}` } }
)
const { data } = await res.json()
Python
import requests

res = requests.get(
    "https://snapurl.app/v1/extract",
    params={"url": "https://example.com", "prompt": "Get the page title"},
    headers={"Authorization": f"Bearer {SNAPURL_KEY}"},
)
data = res.json()["data"]

Errors

Errors come back as JSON with an error code, alongside the HTTP status.

StatuserrorMeaning
400missing_urlThe url parameter was not provided.
400url_not_allowedThe URL resolves to a private, local, or otherwise blocked address.
400bad_paramA parameter failed validation. The offending param is included.
401invalid_api_keyMissing, malformed, or revoked API key.
402quota_exceededFree plans are capped at their monthly quota. Paid plans may burst past quota (billed as overage) up to a fixed multiple of it, after which requests are rejected until the next billing period.
402payment_suspendedYour account is suspended pending payment.
403plan_not_eligibleYour plan doesn't include this endpoint — e.g. /v1/extract on the Free plan.
408selector_timeoutwait_for selector never appeared.
429rate_limitedToo many requests per second for your plan. Includes a retryAfter in seconds.
502render_failedThe page failed to render. Includes a detail message.

Rate limits & quotas

PlanScreenshots / moScreenshot overageExtractions / moExtraction overage
Free25not available — upgrade to continuenot includednot available — upgrade to continue
Starter2,000$5.00 / 1,000200$2.00 / 100
Growth15,000$3.00 / 1,0002,000$1.50 / 100

Identical requests are cached, and cache hits (x-cache: HIT) don't count against your quota. Paid plans can burst up to 3× their included quota per unit before being rejected with 402 quota_exceeded; overage past the included quota is billed monthly, and overage totaling under $0.50 in a month isn't invoiced.

Examples

curl
curl "https://snapurl.app/v1/screenshot?url=https://example.com&format=png&full_page=true" \
  -H "Authorization: Bearer $SNAPURL_KEY" \
  -o shot.png
JavaScript
const res = await fetch(
  "https://snapurl.app/v1/screenshot?url=https://example.com&format=png",
  { headers: { Authorization: `Bearer ${process.env.SNAPURL_KEY}` } }
)
const bytes = await res.arrayBuffer()
Python
import requests

res = requests.get(
    "https://snapurl.app/v1/screenshot",
    params={"url": "https://example.com", "format": "png"},
    headers={"Authorization": f"Bearer {SNAPURL_KEY}"},
)
open("shot.png", "wb").write(res.content)