Overview & Authentication

Welcome to the PageFleet Developer API. Our platform offers a centralized, highly optimized gateway to capture high-fidelity website snapshots across multiple global server regions.

All requests must include your Bearer API key in the authorization header. You can generate and manage keys in your administrator portal.

BASE URL https://api.pagefleet.site
Required Authorization Header: Authorization: Bearer YOUR_API_KEY

Take Screenshot

Renders a visual snapshot of the requested URL. Requests can be sent via JSON or URL-encoded form data. The orchestrator automatically routes the query to an active regional worker node.

POST /api/v1/screenshot

Request Parameters:

Field Type Status Description
url string Required Target URL (e.g., example.com).
region string Optional Region code (e.g., id-1). Fallback is random load balancing.
width number Optional Width in px (320 - 2560, default: 1280).
height number Optional Height in px (240 - 1600, default: 800).

Response Headers:

  • Content-Type: image/png - Screenshot output format.
  • X-Load-Time-Ms: 8172 - Rendering time in milliseconds.
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"url": "example.com", "region": "id-1"}' \
  https://api.pagefleet.site/api/v1/screenshot \
  -o screenshot.png
const axios = require('axios');
const fs = require('fs');

axios({
  method: 'post',
  url: 'https://api.pagefleet.site/api/v1/screenshot',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  data: {
    url: 'example.com',
    region: 'id-1',
    width: 1280,
    height: 800
  },
  responseType: 'stream'
})
.then(response => {
  response.data.pipe(fs.createWriteStream('screenshot.png'));
  console.log('Screenshot saved!');
})
.catch(err => console.error(err.message));
<?php
$ch = curl_init('https://api.pagefleet.site/api/v1/screenshot');
$data = json_encode([
    'url' => 'example.com',
    'region' => 'id-1'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
file_put_contents('screenshot.png', $result);
curl_close($ch);
echo "Screenshot saved!";
?>
import requests

url = "https://api.pagefleet.site/api/v1/screenshot"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}
payload = {
    "url": "example.com",
    "region": "id-1"
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
    with open("screenshot.png", "wb") as f:
        f.write(response.content)
    print("Screenshot saved!")

Get Regions

Fetches active regional worker node codes and names connected to the PageFleet Control Center orchestrator.

GET /api/v1/regions

Response Body (200 OK):

[
  {
    "code": "id-1",
    "name": "🇮🇩 ID - Jakarta"
  },
  {
    "code": "us-1",
    "name": "🇺🇸 US - Oregon"
  }
]