POST /screenshot
Capture high-quality screenshots of any web page.
Renders any URL in a headless browser and returns a screenshot. Supports full-page capture, custom viewports, device emulation, and multiple output formats. Perfect for visual monitoring, social previews, PDF generation, and feeding screenshots to vision models like GPT-4V.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Required | The URL to screenshot. |
| format | string | Optional | "png" or "jpeg". Default: "png" |
| quality | integer | Optional | JPEG quality (1-100). Only applies to JPEG. Default: 80 |
| full_page | boolean | Optional | Capture the full scrollable page, not just the viewport. Default: false |
| viewport | object | Optional | Custom viewport size: {"width": 1280, "height": 720}. Default: 1280×800 |
| device | string | Optional | Emulate a device: "iPhone 14", "iPad Pro", "Pixel 7". Overrides viewport. |
| wait_for | string | Optional | CSS selector to wait for before capturing. |
| wait_ms | integer | Optional | Additional ms to wait after page load. Max: 10000. |
| dark_mode | boolean | Optional | Enable dark mode (prefers-color-scheme: dark). Default: false |
| hide_cookie_banners | boolean | Optional | Attempt to dismiss cookie consent banners. Default: true |
| clip | object | Optional | Clip to a specific region: {"x": 0, "y": 0, "width": 500, "height": 300} |
| proxy_country | string | Optional | Two-letter country code for geo-targeted access. |
Example Request
curl -X POST https://api.mantisapi.com/v1/screenshot \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://github.com/trending",
"format": "png",
"full_page": true,
"viewport": { "width": 1440, "height": 900 },
"dark_mode": true,
"hide_cookie_banners": true
}'
Response
{
"status": 200,
"url": "https://github.com/trending",
"screenshot_url": "https://cdn.mantisapi.com/screenshots/s_7f3a9b2c.png",
"format": "png",
"dimensions": {
"width": 1440,
"height": 4820
},
"file_size_bytes": 847293,
"expires_at": "2026-03-08T16:00:00Z",
"credits_used": 2,
"credits_remaining": 4998
}
Screenshot URLs expire after 24 hours. Download or process the image promptly. For permanent storage, download the image and store it in your own infrastructure.
Device Emulation
Pass a device name to emulate mobile or tablet viewports with accurate user agents:
{
"url": "https://example.com",
"device": "iPhone 14",
"format": "jpeg",
"quality": 90
}
Supported devices: iPhone 14, iPhone 14 Pro Max, iPad Pro, iPad Mini, Pixel 7, Samsung Galaxy S23, MacBook Pro 16
Use with Vision Models
Screenshots pair perfectly with GPT-4V, Claude Vision, and other multimodal models:
import requests, base64
# 1. Take screenshot
screenshot = requests.post(
"https://api.mantisapi.com/v1/screenshot",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"url": "https://competitor.com/pricing", "format": "jpeg"}
).json()
# 2. Download image
img_data = requests.get(screenshot["screenshot_url"]).content
img_b64 = base64.b64encode(img_data).decode()
# 3. Send to GPT-4V for analysis
analysis = openai_client.chat.completions.create(
model="gpt-4-vision-preview",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Analyze this pricing page. What tiers exist and what are the prices?"},
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{img_b64}"}}
]
}]
)
Credit Usage
2 credits per screenshot (always uses headless browser rendering). Device emulation does not cost extra.