Skip to content

Your First Screenshot

Learn the basics of capturing screenshots with URLPix.

Basic Screenshot

The simplest request only needs a url parameter:

bash
curl "https://api.urlpix.com/v1/screenshot?url=https://github.com" \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -o github.png

Default settings: 1280×800 viewport, PNG format, 1x device scale.

Customize the Viewport

bash
curl "https://api.urlpix.com/v1/screenshot?url=https://github.com&width=1920&height=1080" \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -o github-hd.png

Change Format and Quality

bash
# High-quality WebP
curl "https://api.urlpix.com/v1/screenshot?url=https://github.com&format=webp&quality=95" \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -o github.webp

Wait for Dynamic Content

If the page loads content dynamically, use delay or waitForSelector:

bash
# Wait 2 seconds after page load
curl "https://api.urlpix.com/v1/screenshot?url=https://example.com&delay=2000" \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -o delayed.png

# Wait for a specific element
curl "https://api.urlpix.com/v1/screenshot?url=https://example.com&waitForSelector=.main-content" \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -o content.png

Retina / High-DPI

bash
curl "https://api.urlpix.com/v1/screenshot?url=https://github.com&deviceScale=2" \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -o github-retina.png

Get JSON Metadata Instead

bash
curl "https://api.urlpix.com/v1/screenshot?url=https://github.com&response=json" \
  -H "X-API-Key: sk_live_YOUR_KEY"

Returns image URL, dimensions, file size, format, and cache timestamp.

JavaScript (fetch)

javascript
const params = new URLSearchParams({
  url: 'https://github.com',
  format: 'webp',
  width: '1920',
  height: '1080',
})

const response = await fetch(
  `https://api.urlpix.com/v1/screenshot?${params}`,
  { headers: { 'X-API-Key': 'sk_live_YOUR_KEY' } }
)

const imageBlob = await response.blob()

Node.js

javascript
import fs from 'fs'

const params = new URLSearchParams({
  url: 'https://github.com',
  format: 'png',
  width: '1920',
  height: '1080',
})

const response = await fetch(
  `https://api.urlpix.com/v1/screenshot?${params}`,
  { headers: { 'X-API-Key': process.env.URLPIX_API_KEY } }
)

const buffer = Buffer.from(await response.arrayBuffer())
fs.writeFileSync('screenshot.png', buffer)

URLPix — Screenshot & OG Image API