OpenGraph.io

Screenshot API

Capture high-quality screenshots of any webpage programmatically. Support for full-page captures, custom dimensions, and multiple device sizes.

Endpoint

HTTP
GET https://opengraph.io/api/1.1/screenshot/{encoded_url}?app_id=YOUR_APP_ID

Parameters

Path Parameters

ParameterTypeDescription
encoded_urlstringRequired. URL-encoded target URL

Query Parameters

ParameterTypeDefaultDescription
app_idstring-Required. Your API key
formatstringjpegImage format: jpeg, png, or webp
qualitynumber80Image quality (10-80, rounded to nearest 10)
full_pagebooleanfalseCapture entire scrollable page instead of just the viewport
dimensionsstringmdViewport size: xs, sm, md, lg
selectorstring-CSS selector to capture a specific element
exclude_selectorsstring-Comma-separated CSS selectors to hide from screenshot (e.g., .header,.footer)
block_cookie_bannerbooleantrueAuto-block known cookie consent banners
dark_modebooleanfalseSet browser preference to dark mode
cache_okbooleantrueAllow cached screenshots
use_proxybooleanfalseUse proxy for protected sites
capture_delaynumber-Delay in milliseconds before capture (0-10000)
navigationTimeoutnumber30000Navigation timeout in milliseconds (1000-60000)

Dimension Presets

PresetViewport SizeUse Case
xs375 x 812Mobile phone (iPhone X)
sm1024 x 768Tablet
md1366 x 768Laptop (default)
lg1920 x 1080Desktop monitor

Example Request

curl "https://opengraph.io/api/1.1/screenshot/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&dimensions=lg" \
  --output screenshot.png

Example Response

Response
{
  "screenshotUrl": "https://cdn.opengraph.io/screenshots/abc123.png",
  "dimensions": {
    "width": 1280,
    "height": 800
  },
  "requestInfo": {
    "host": "github.com",
    "responseCode": 200
  }
}

Note: Screenshot URLs are temporary and automatically expire after 24 hours. Download or cache the image if you need it longer.

Advanced Examples

Full page with WebP format

Full page WebP
curl "https://opengraph.io/api/1.1/screenshot/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&format=webp&quality=80&dimensions=lg&full_page=true"

Hide specific elements

Exclude header and footer
curl "https://opengraph.io/api/1.1/screenshot/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&exclude_selectors=.header%2C.footer"

Capture specific element

Capture only main content
curl "https://opengraph.io/api/1.1/screenshot/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&selector=.main-content"

Dark mode mobile screenshot

Mobile dark mode
curl "https://opengraph.io/api/1.1/screenshot/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&dimensions=xs&dark_mode=true"

Tip: For best results when using selectors, test them in browser dev tools first to ensure they target the correct elements.

Use Cases

  • Website monitoring and archiving
  • Visual regression testing
  • Thumbnail generation for link previews
  • Social media preview images
  • Documentation and reporting
  • Competitive analysis

MCP Tool

This endpoint is available as the Screenshot tool in the OpenGraph MCP Server. Your AI assistant can capture screenshots directly without writing any code.

Get started with MCP in 2 minutes →

Learn more about MCP integration →

Related