$ curl -X POST https://YOUR_DOMAIN/api/screenshot \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
-o screenshot.png
const res = await fetch('https://YOUR_DOMAIN/api/screenshot', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'https://example.com' })
});
const buffer = await res.arrayBuffer();
fs.writeFileSync('screenshot.png', Buffer.from(buffer));
import requests
res = requests.post(
'https://YOUR_DOMAIN/api/screenshot',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={'url': 'https://example.com'}
)
with open('screenshot.png', 'wb') as f:
f.write(res.content)
$ch = curl_init('https://YOUR_DOMAIN/api/screenshot');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode(['url' => 'https://example.com']),
CURLOPT_RETURNTRANSFER => true
]);
file_put_contents('screenshot.png', curl_exec($ch));