Everything you need to integrate SnapAPI into your application.
https://api.test.chmesa.com/api/v1
All API requests require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Important: Keep your API key secure and never expose it in client-side code.
Capture a screenshot of any website.
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The URL of the website to screenshot |
| width | integer | No | Viewport width in pixels (default: 1920) |
| height | integer | No | Viewport height in pixels (default: 1080) |
| format | string | No | Image format: png, jpg, or webp (default: png) |
| full_page | boolean | No | Capture full page or just viewport (default: false) |
| dark_mode | boolean | No | Enable dark mode (default: false) |
| delay | integer | No | Wait time in seconds before capture (default: 0, max: 10) |
| quality | integer | No | Image quality 1-100 for jpg/webp (default: 80) |
{
"url": "https://example.com",
"width": 1920,
"height": 1080,
"format": "png",
"full_page": false,
"dark_mode": false,
"delay": 2
}
Check your current usage and plan limits.
curl -X GET https://api.test.chmesa.com/api/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY"
{
"used": 42,
"limit": 5000,
"percentage": 0.84,
"reset_at": "2026-03-23T18:43:00Z",
"plan": "Pro"
}
Successful screenshot requests return the following format:
{
"success": true,
"screenshot": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com",
"image_url": "https://api.test.chmesa.com/storage/screenshots/550e8400.png",
"width": 1920,
"height": 1080,
"format": "png",
"file_size": 245632,
"cached": false,
"created_at": "2026-02-23T18:43:00Z"
}
}
The API uses standard HTTP status codes:
Invalid parameters or malformed request.
Missing or invalid API key.
SSRF protection triggered or blocked URL.
Monthly quota exceeded or rate limit hit.
Server error during screenshot capture.
{
"success": false,
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Monthly screenshot quota exceeded",
"details": "You have used 5000 of 5000 screenshots this month"
}
}
curl -X POST https://api.test.chmesa.com/api/v1/screenshot \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"width": 1920,
"height": 1080,
"format": "png",
"full_page": true
}'
import requests
url = "https://api.test.chmesa.com/api/v1/screenshot"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"url": "https://example.com",
"width": 1920,
"height": 1080,
"format": "png",
"full_page": True,
"dark_mode": False
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
if result["success"]:
print(f"Screenshot saved: {result['screenshot']['image_url']}")
else:
print(f"Error: {result['error']['message']}")
const axios = require('axios');
async function captureScreenshot() {
try {
const response = await axios.post(
'https://api.test.chmesa.com/api/v1/screenshot',
{
url: 'https://example.com',
width: 1920,
height: 1080,
format: 'png',
full_page: true
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log('Screenshot URL:', response.data.screenshot.image_url);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
captureScreenshot();
$ch = curl_init('https://api.test.chmesa.com/api/v1/screenshot');
$data = [
'url' => 'https://example.com',
'width' => 1920,
'height' => 1080,
'format' => 'png',
'full_page' => true
];
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if ($result['success']) {
echo "Screenshot URL: " . $result['screenshot']['image_url'];
} else {
echo "Error: " . $result['error']['message'];
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.test.chmesa.com/api/v1/screenshot"
data := map[string]interface{}{
"url": "https://example.com",
"width": 1920,
"height": 1080,
"format": "png",
"full_page": true,
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}