Documentation
One endpoint turns a URL into an image or a PDF.
Quick start
- Create a free account and copy your API key from the dashboard. It is shown only once.
- 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.pngAuthentication
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=webpParameter names also work in camelCase (fullPage, darkMode…).
Parameters
| Name | Values | Default | Description |
|---|---|---|---|
url | string | url or html | Page to capture, starting with http:// or https://. |
html | string, up to 2 MB | url or html | Render your own HTML instead of a URL (invoices, social cards, emails). POST only in practice. |
format | png · jpeg · webp · pdf | png | Output format. PDF pages are A4 with backgrounds. |
quality | 1–100 | — | Compression quality for jpeg and webp. |
full_page | boolean | false | Capture the whole scrollable page instead of the visible area. |
width / height | pixels | 1280 × 800 | Viewport size (200–3840 × 200–2160). |
viewport | desktop · mobile · tablet | desktop | Quick size presets: 1280×800, 390×844, 820×1180. |
device | device id | — | Emulate a real device (size, density, user agent). See the list below. |
retina | boolean | false | Render at 2× pixel density. Use scale for 1–3. |
dark_mode | boolean | false | Ask the page for its dark color scheme. |
element | CSS selector | — | Capture only the first element matching this selector. |
wait_for_selector | CSS selector | — | Wait until this element appears before capturing. |
delay | ms, 0–10000 | 0 | Extra wait after the page has loaded (animations, lazy content). |
timeout | ms, 1000–60000 | 30000 | Maximum time to load the page. |
hide | selectors, comma-separated | — | Elements to hide before capturing (chat widgets, popups). |
block_cookies | boolean | true | Hide cookie consent banners. |
block_ads | boolean | false | Block common ad and tracking networks. |
block_chats | boolean | false | Hide chat bubbles, newsletter popups and share bars (Intercom, Crisp, HubSpot…). |
click | CSS selector | — | Click this element before capturing (close a modal, open a tab). |
styles | CSS, up to 100 KB | — | Inject CSS before capturing. Alias: css. |
scripts | JavaScript, up to 100 KB | — | Run JavaScript in the page before capturing. Alias: js. |
lazy_load | boolean | false | Scroll through the page first so lazy images load. Best with full_page. |
omit_background | boolean | false | Transparent background for pages without one. png and webp only. |
reduced_motion | boolean | false | Ask the page to turn off animations. |
geolocation_latitude / _longitude | degrees | — | Pretend to be at this place (store finders, local results). _accuracy in meters is optional. |
timezone | IANA name | UTC | Browser time zone, e.g. Europe/Paris. |
locale | language tag | en-US | Browser language, e.g. fr-FR. Also sets Accept-Language. |
user_agent | string | Chrome | Custom user agent. |
cache_ttl | seconds, 0–2592000 | 0 | Reuse 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:
X-Credits-Remaining: screenshots left this monthX-Cache: HIT when served from your cache (free), MISS otherwiseX-Screenshot-Width,X-Screenshot-Height: size of the captureX-Processing-Time-Ms: total time spent
Errors
Errors are JSON: {"error": {"code": "…", "message": "…", "hint": "…"}}
| 400 | VALIDATION_ERROR | A parameter is missing or invalid. The details field lists which. |
| 401 | MISSING_API_KEY / INVALID_API_KEY | No key sent, or the key is unknown or revoked. |
| 402 | INSUFFICIENT_CREDITS | Monthly quota used up. It resets with your next billing month. |
| 401 | INVALID_SIGNATURE | The signed URL was changed, or signed with another secret. |
| 422 | SELECTOR_NOT_FOUND | The element, click target or wait_for_selector never appeared. |
| 422 | SCRIPT_ERROR | Your scripts parameter threw an error. The message says which. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests this minute for your plan. See Retry-After. |
| 502 | NAVIGATION_FAILED / NETWORK_ERROR | The target site could not be reached. |
| 503 | BUSY | All capture slots are busy. Retry after a few seconds. |
| 504 | TIMEOUT | The 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
| Plan | Screenshots / month | Requests / minute |
|---|---|---|
| Free | 100 | 10 |
| Starter | 2,500 | 30 |
| Growth | 12,000 | 60 |
| Scale | 50,000 | 120 |
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.