YepAPI
Web Scraping

Screenshot

Take pixel-perfect screenshots of any webpage.

POST/v1/scrape/screenshot
$0.02/call

Usage

const res = await fetch('https://api.yepapi.com/v1/scrape/screenshot', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://example.com' }),
});
const { data } = await res.json();
// data.image is a base64-encoded PNG
const img = Buffer.from(data.image, 'base64');
curl -X POST https://api.yepapi.com/v1/scrape/screenshot \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "fullPage": false}'

Request Body

ParameterTypeRequiredDescriptionDefault
urlstringYesURL to screenshot
fullPagebooleanNoCapture entire scrollable pagefalse
widthnumberNoViewport width in pixels1920
heightnumberNoViewport height in pixels1080

Response

{
  "ok": true,
  "data": {
    "url": "https://example.com",
    "image": "iVBORw0KGgoAAAANSUhEUgAA...(base64 PNG)",
    "width": 1920,
    "height": 1080
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
dataobjectResponse payload
data.urlstringThe URL that was screenshotted
data.imagestringBase64-encoded PNG image data
data.widthnumberWidth of the captured screenshot in pixels
data.heightnumberHeight of the captured screenshot in pixels
Info

The image field contains a base64-encoded PNG. Decode it to get the raw image bytes. For full-page screenshots, the height will reflect the actual page height.

On this page