PRNT REST API
Documentation & SDKs
Integrate programmatic web capturing into your applications in minutes. RESTful design, JSON responses, and signed HMAC webhooks.
Sub-50ms Rendering
Pre-warmed Chromium instances across 12 global edge nodes with instant CDN cache hits for repeated requests.
Pixel-Perfect DOM
Full JavaScript hydration, WebGL frames, infinite scrolling, retina scale multipliers, and automated cookie banner dismissal.
Hardened Security
Automated SSRF protection, isolated single-use Docker sandboxes, zero target cookie persistence, and 256-bit TLS 1.3.
Multi-Language SDKs
Idiomatic libraries and copy-paste ready examples in cURL, Python, Node.js, PHP, and Go with typed parameters.
01 Quickstart Guide
Make your very first programmatic screenshot request in less than 60 seconds with our RESTful API:
- Sign up for a free developer account to obtain your live API key.
- Navigate to your API Keys Dashboard to copy your bearer token.
- Send an HTTP POST request to the
/v1/captureendpoint with your target URL.
# Request full-page PNG screenshot
curl -X POST "https://api.prnt.tr/v1/capture" \
-H "Authorization: Bearer prnt_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://github.com",
"format": "png",
"full_page": true,
"viewport": { "width": 1920, "height": 1080 }
}' --output screenshot.png
import requests
url = "https://api.prnt.tr/v1/capture"
headers = {
"Authorization": "Bearer prnt_live_your_api_key_here",
"Content-Type": "application/json"
}
payload = {
"url": "https://github.com",
"format": "png",
"full_page": True
}
response = requests.post(url, json=payload, headers=headers)
with open("screenshot.png", "wb") as f:
f.write(response.content)
print("Screenshot saved successfully!")
import fs from 'fs/promises';
const response = await fetch('https://api.prnt.tr/v1/capture', {
method: 'POST',
headers: {
'Authorization': 'Bearer prnt_live_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://github.com',
format: 'png',
full_page: true
})
});
const buffer = Buffer.from(await response.arrayBuffer());
await fs.writeFile('screenshot.png', buffer);
console.log('Screenshot captured successfully.');
<?php
$apiKey = 'prnt_live_your_api_key_here';
$ch = curl_init('https://api.prnt.tr/v1/capture');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer {$apiKey}",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://github.com',
'format' => 'png',
'full_page' => true
]),
CURLOPT_RETURNTRANSFER => true
]);
$image = curl_exec($ch);
file_put_contents('screenshot.png', $image);
curl_close($ch);
02 Authentication & Security
PRNT authenticates API requests via cryptographic Bearer tokens. Include your key in the Authorization header of every request:
03 Base URL & Content Formats
All API endpoints are served securely over TLS 1.3. The production entrypoint is:
PRNT supports multiple output image encodings tailored for web, print, and archiving:
| Format | MIME Type | Best Use Case |
|---|---|---|
png |
image/png |
Default. Lossless quality, perfect for crisp text, UI elements, and transparent backgrounds. |
jpeg / jpg |
image/jpeg |
Optimized file size for photo-heavy websites with configurable quality (1-100). |
webp |
image/webp |
Modern high-compression web format with up to 30% smaller file size than JPEG. |
pdf |
application/pdf |
Paginated vector document export for invoices, legal compliance, and archival printing. |
04 POST /v1/capture
The core programmatic endpoint to render web pages into high-resolution images or documents.
Request Parameters (JSON Body)
| Parameter | Type | Status | Description & Default |
|---|---|---|---|
url |
string | REQUIRED | The fully-qualified target webpage URL (must include https:// or http://). |
format |
string | OPTIONAL | png (default), jpeg, webp, or pdf. |
full_page |
boolean | OPTIONAL | Automatically scrolls through lazy DOM elements to capture full page height. Default is false. |
viewport.width |
integer | OPTIONAL | Browser window width in pixels. Default is 1920. |
viewport.height |
integer | OPTIONAL | Browser window height in pixels. Default is 1080. |
delay |
integer | OPTIONAL | Wait time in milliseconds after DOM load before snapping (0 – 10000ms). Default is 0. |
dark_mode |
boolean | OPTIONAL | Emulates prefers-color-scheme: dark CSS media queries. Default is false. |
block_cookie_banners |
boolean | OPTIONAL | Automatically detects and removes intrusive GDPR / Cookie consent popups. Default is true. |
custom_css |
string | OPTIONAL | Inject custom CSS rules before snapping (e.g. .announcement { display: none; }). |
custom_js |
string | OPTIONAL | Execute arbitrary client-side JavaScript before capture. |
05 HTTP Status Codes & Errors
PRNT returns standard HTTP response codes accompanied by structured JSON error payloads:
| HTTP Code | Error Constant | Reason & Resolution |
|---|---|---|
200 OK |
SUCCESS | Screenshot successfully rendered and returned as binary image or CDN asset. |
400 Bad Request |
INVALID_PARAMETER | Missing target URL, invalid dimensions, or malformed JSON payload. |
401 Unauthorized |
INVALID_API_KEY | Missing or revoked API Bearer token in the request header. |
403 Forbidden |
DOMAIN_BLOCKED | The requested target domain violates our Acceptable Use Policy or SSRF firewall. |
429 Too Many Requests |
RATE_LIMIT_EXCEEDED | Your plan request quota or concurrency limit has been reached. Upgrade plan to scale. |
504 Gateway Timeout |
RENDER_TIMEOUT | The target webpage failed to respond or render within the 30-second execution window. |
06 SDK Code Examples & Libraries
Explore ready-to-integrate sample scripts for our official SDKs and HTTP clients:
package main
import (
"bytes"
"encoding/json"
"io"
"net/http"
"os"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"url": "https://github.com",
"format": "png",
"full_page": true,
})
req, _ := http.NewRequest("POST", "https://api.prnt.tr/v1/capture", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer prnt_live_your_api_key_here")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := os.Create("screenshot.png")
defer out.Close()
io.Copy(out, resp.Body)
}
# pip install prnt-sdk
from prnt import PrntClient
client = PrntClient(api_key="prnt_live_your_api_key_here")
screenshot = client.capture(
url="https://github.com",
format="png",
full_page=True,
dark_mode=True,
delay=500
)
screenshot.save("github_dark.png")
// npm install @prnt/sdk
import { PrntClient } from '@prnt/sdk';
const prnt = new PrntClient({ apiKey: 'prnt_live_your_api_key_here' });
const image = await prnt.capture({
url: 'https://github.com',
format: 'webp',
fullPage: true,
blockCookieBanners: true
});
await image.save('output.webp');