ScreenAPI

Documentation

One endpoint turns a URL into an image or a PDF.

Quick start

  1. Create a free account and copy your API key from the dashboard. It is shown only once.
  2. Call the API with the key and the page you want:
curl "https://getscreenapi.com/api/v1/screenshot?url=https://example.com&full_page=true" \
  -H "x-api-key: YOUR_KEY" \
  -o screenshot.png

Authentication

Send your key in the x-api-key header, or as Authorization: Bearer YOUR_KEY. For GET requests you can also pass access_key=YOUR_KEY in the URL. Only do this from your server: anyone who sees the URL can use your quota. Revoke a leaked key from the dashboard at any time.

Signed URLs

To put a capture straight into an <img> tag without exposing your key, sign the URL. Every key has a signing secret, shown in the dashboard. Build the query string with key_id, compute an HMAC-SHA256 of that exact string with the secret, and add it as signature. Anyone can load the link, but changing a single parameter breaks it. The dashboard URL builder does this for you.

// Node.js
import { createHmac } from 'crypto';

const query = new URLSearchParams({
  url: 'https://example.com', format: 'webp', cache_ttl: '86400', key_id: 'YOUR_KEY_ID',
}).toString();
const signature = createHmac('sha256', process.env.SIGNING_SECRET).update(query).digest('hex');
const src = `https://getscreenapi.com/api/v1/screenshot?${query}&signature=${signature}`;

Add cache_ttl so repeat views are served from cache and cost nothing. Creating a new signing secret in the dashboard turns off every link signed with the old one.

Request

POST https://getscreenapi.com/api/v1/screenshot
Content-Type: application/json
x-api-key: YOUR_KEY

{ "url": "https://example.com", "full_page": true, "format": "webp" }

GET https://getscreenapi.com/api/v1/screenshot?url=https://example.com&full_page=true&format=webp

Parameter names also work in camelCase (fullPage, darkMode…).

Parameters

NameValuesDefaultDescription
urlstringurl or htmlPage to capture, starting with http:// or https://.
htmlstring, up to 2 MBurl or htmlRender your own HTML instead of a URL (invoices, social cards, emails). POST only in practice.
formatpng · jpeg · webp · pdfpngOutput format. PDF pages are A4 with backgrounds.
quality1–100—Compression quality for jpeg and webp.
full_pagebooleanfalseCapture the whole scrollable page instead of the visible area.
width / heightpixels1280 × 800Viewport size (200–3840 × 200–2160).
viewportdesktop · mobile · tabletdesktopQuick size presets: 1280×800, 390×844, 820×1180.
devicedevice id—Emulate a real device (size, density, user agent). See the list below.
retinabooleanfalseRender at 2× pixel density. Use scale for 1–3.
dark_modebooleanfalseAsk the page for its dark color scheme.
elementCSS selector—Capture only the first element matching this selector.
wait_for_selectorCSS selector—Wait until this element appears before capturing.
delayms, 0–100000Extra wait after the page has loaded (animations, lazy content).
timeoutms, 1000–6000030000Maximum time to load the page.
hideselectors, comma-separated—Elements to hide before capturing (chat widgets, popups).
block_cookiesbooleantrueHide cookie consent banners.
block_adsbooleanfalseBlock common ad and tracking networks.
block_chatsbooleanfalseHide chat bubbles, newsletter popups and share bars (Intercom, Crisp, HubSpot…).
clickCSS selector—Click this element before capturing (close a modal, open a tab).
stylesCSS, up to 100 KB—Inject CSS before capturing. Alias: css.
scriptsJavaScript, up to 100 KB—Run JavaScript in the page before capturing. Alias: js.
lazy_loadbooleanfalseScroll through the page first so lazy images load. Best with full_page.
omit_backgroundbooleanfalseTransparent background for pages without one. png and webp only.
reduced_motionbooleanfalseAsk the page to turn off animations.
geolocation_latitude / _longitudedegrees—Pretend to be at this place (store finders, local results). _accuracy in meters is optional.
timezoneIANA nameUTCBrowser time zone, e.g. Europe/Paris.
localelanguage tagen-USBrowser language, e.g. fr-FR. Also sets Accept-Language.
user_agentstringChromeCustom user agent.
cache_ttlseconds, 0–25920000Reuse an identical capture made within this time. Cache hits are free.

Response

On success the body is the file itself (image/png, image/jpeg, image/webp or application/pdf), with these headers:

Errors

Errors are JSON: {"error": {"code": "…", "message": "…", "hint": "…"}}

400VALIDATION_ERRORA parameter is missing or invalid. The details field lists which.
401MISSING_API_KEY / INVALID_API_KEYNo key sent, or the key is unknown or revoked.
402INSUFFICIENT_CREDITSMonthly quota used up. It resets with your next billing month.
401INVALID_SIGNATUREThe signed URL was changed, or signed with another secret.
422SELECTOR_NOT_FOUNDThe element, click target or wait_for_selector never appeared.
422SCRIPT_ERRORYour scripts parameter threw an error. The message says which.
429RATE_LIMIT_EXCEEDEDToo many requests this minute for your plan. See Retry-After.
502NAVIGATION_FAILED / NETWORK_ERRORThe target site could not be reached.
503BUSYAll capture slots are busy. Retry after a few seconds.
504TIMEOUTThe page did not load within the timeout.

Failed captures do not use credits.

Devices

Pass the id as device. The list is also available at GET /api/v1/devices.

iphone-15-pro-max430×932

iphone-15-pro393×852

iphone-14-pro-max430×932

iphone-14390×844

iphone-13390×844

iphone-12390×844

iphone-se375×667

galaxy-s24-ultra412×915

galaxy-s23360×780

galaxy-a54412×915

pixel-8-pro412×915

pixel-7412×915

ipad-pro-12.91024×1366

ipad-air820×1180

galaxy-tab-s9800×1280

desktop-19201920×1080

desktop-14402560×1440

macbook-pro-161728×1117

Limits

PlanScreenshots / monthRequests / minute
Free10010
Starter2,50030
Growth12,00060
Scale50,000120

Pages on private networks (localhost, internal IPs, cloud metadata) are refused. A capture takes 1 to 5 seconds for most pages; set a timeout in your HTTP client of at least 60 seconds.