API Documentation

Capture any webpage as an image with a single HTTP request.

Authentication

Every request requires an API key. You can pass it as a header or query parameter:

Header (Recommended)

X-API-Key: px_your_api_key_here

Query Parameter

GET /api/capture?url=https://example.com&api_key=px_your_api_key_here
Tip: Use the header method in production to keep your key out of server logs and browser history.
GET /api/capture Capture a screenshot

Takes a screenshot of the specified URL and returns the image binary directly in the response body.

Parameters

ParameterTypeDefaultDescription
url required string The full URL to capture. Must start with http:// or https://.
width optional integer 1280 Viewport width in pixels. Max depends on plan.
height optional integer 720 Viewport height in pixels. Max depends on plan.
format optional string png Output format: png, jpeg, webp, or pdf. Available formats depend on plan.
quality optional integer 80 Image quality (1-100). Only applies to JPEG and WebP.
full_page Pro+ boolean false Capture the full scrollable page instead of just the viewport.
delay Pro+ integer 0 Wait time in milliseconds (max 10000) after page load before capturing. Useful for JS-heavy pages.

Response

On success, returns the raw image/PDF bytes with appropriate headers:

HeaderDescription
Content-Typeimage/png, image/jpeg, image/webp, or application/pdf
X-Screenshot-IdUnique ID for this screenshot (for support reference)
X-Duration-MsTime taken to capture the screenshot
X-RateLimit-RemainingRemaining requests in the current minute window
X-Monthly-UsedScreenshots used this billing month
X-Monthly-LimitTotal screenshots allowed this month

Examples

cURL

curl -H "X-API-Key: px_your_key" \
  "https://pxshot.dev/api/capture?url=https://example.com&width=1280&format=png" \
  --output screenshot.png

JavaScript / Node.js

const response = await fetch(
  'https://pxshot.dev/api/capture?url=https://example.com&format=png',
  { headers: { 'X-API-Key': 'px_your_key' } }
);
const blob = await response.blob();
// Use blob, save to file, etc.

Python

import requests

resp = requests.get(
    'https://pxshot.dev/api/capture',
    params={'url': 'https://example.com', 'format': 'png'},
    headers={'X-API-Key': 'px_your_key'}
)
with open('screenshot.png', 'wb') as f:
    f.write(resp.content)

Full-Page PDF (Pro+)

curl -H "X-API-Key: px_your_key" \
  "https://pxshot.dev/api/capture?url=https://example.com&format=pdf&full_page=true" \
  --output page.pdf

Error Codes

Errors return JSON with an error field:

{ "error": "Missing required parameter: url" }
StatusErrorDescription
400Missing required parameter: urlNo URL was provided.
400Invalid URLURL must start with http:// or https://.
400Format not available on your planYour plan doesn't support this format.
400Full-page capture requires Pro or higherUpgrade to use full_page=true.
400Custom delay requires Pro or higherUpgrade to use the delay parameter.
400Viewport exceeds plan limitsWidth/height exceeds your plan's max.
401API key requiredNo API key was provided.
401Invalid API keyThe key doesn't match any active key.
403Origin not allowedRequest origin is not in the key's allowed origins.
429Rate limit exceededToo many requests per minute.
429Monthly screenshot limit reachedUpgrade your plan for more screenshots.
500Screenshot failedInternal error during capture. Try again.

Rate Limits

PlanPer MinuteMonthly
Free5 requests50 screenshots
Pro30 requests2,000 screenshots
Business100 requests10,000 screenshots
Rate limits are per API key. If you hit the per-minute limit, wait 60 seconds. Monthly limits reset on the 1st of each month (UTC).

Plan Comparison

FeatureFreePro ($19/mo)Business ($49/mo)
Monthly screenshots502,00010,000
FormatsPNGPNG, JPEG, WebPPNG, JPEG, WebP
PDF export
API keys1310
Max viewport1280×7201920×10803840×2160
Full-page capture
Custom delay
Rate limit5/min30/min100/min