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_IDParameters
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| encoded_url | string | Required. URL-encoded target URL |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| app_id | string | - | Required. Your API key |
| format | string | jpeg | Image format: jpeg, png, or webp |
| quality | number | 80 | Image quality (10-80, rounded to nearest 10) |
| full_page | boolean | false | Capture entire scrollable page instead of just the viewport |
| dimensions | string | md | Viewport size: xs, sm, md, lg |
| selector | string | - | CSS selector to capture a specific element |
| exclude_selectors | string | - | Comma-separated CSS selectors to hide from screenshot (e.g., .header,.footer) |
| block_cookie_banner | boolean | true | Auto-block known cookie consent banners |
| dark_mode | boolean | false | Set browser preference to dark mode |
| cache_ok | boolean | true | Allow cached screenshots |
| use_proxy | boolean | false | Use proxy for protected sites |
| capture_delay | number | - | Delay in milliseconds before capture (0-10000) |
| navigationTimeout | number | 30000 | Navigation timeout in milliseconds (1000-60000) |
Dimension Presets
| Preset | Viewport Size | Use Case |
|---|---|---|
| xs | 375 x 812 | Mobile phone (iPhone X) |
| sm | 1024 x 768 | Tablet |
| md | 1366 x 768 | Laptop (default) |
| lg | 1920 x 1080 | Desktop 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.pngExample 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.