Get a snapshot by date
A common task is retrieving the screenshot of a specific page as it appeared on a particular date. Use the captured_before filter with per_page=1 to get the closest snapshot before your target date.
Step 1: Find your monitor
bash
curl "https://api.snapshotarchive.com/v1/monitors?url=example.com" \
-H "Authorization: Bearer YOUR_API_KEY" -H "Accept: application/json"
# Response: "data": [{"id": 42, ...}]$client = new \GuzzleHttp\Client();
$response = $client->get('https://api.snapshotarchive.com/v1/monitors', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
],
'query' => ['url' => 'example.com'],
]);
$data = json_decode($response->getBody(), true);
// $data['data'][0]['id'] => 42import requests
response = requests.get(
"https://api.snapshotarchive.com/v1/monitors",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
},
params={"url": "example.com"},
)
data = response.json()
# data["data"][0]["id"] => 42const response = await fetch(
"https://api.snapshotarchive.com/v1/monitors?url=example.com",
{
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
},
}
);
const data = await response.json();
// data.data[0].id => 42require "net/http"
require "json"
uri = URI("https://api.snapshotarchive.com/v1/monitors?url=example.com")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"
request["Accept"] = "application/json"
response = http.request(request)
data = JSON.parse(response.body)
# data["data"][0]["id"] => 42req, _ := http.NewRequest("GET",
"https://api.snapshotarchive.com/v1/monitors?url=example.com", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
// Parse JSON to find monitor IDStep 2: Get the closest snapshot
bash
# Get the latest snapshot on or before September 5
curl "https://api.snapshotarchive.com/v1/monitors/42/snapshots?captured_before=2026-09-05T23:59:59Z&status=completed&per_page=1" \
-H "Authorization: Bearer YOUR_API_KEY" -H "Accept: application/json"
# Download using the snapshot UUID from the response
curl -L "https://api.snapshotarchive.com/v1/snapshots/SNAPSHOT_UUID/screenshot" \
-H "Authorization: Bearer YOUR_API_KEY" -o screenshot-sept5.png$snapshots = Http::withToken('YOUR_API_KEY')
->get('https://api.snapshotarchive.com/v1/monitors/42/snapshots', [
'captured_before' => '2026-09-05T23:59:59Z',
'status' => 'completed',
'per_page' => 1,
])->json('data');
if (count($snapshots) > 0) {
$screenshotUrl = $snapshots[0]['files']['screenshot_url'];
}resp = requests.get(f'{BASE}/monitors/42/snapshots', headers=headers,
params={'captured_before': '2026-09-05T23:59:59Z', 'status': 'completed', 'per_page': 1})
snapshots = resp.json()['data']
if snapshots:
img = requests.get(snapshots[0]['files']['screenshot_url'])
with open('screenshot-sept5.png', 'wb') as f:
f.write(img.content)const { data: snapshots } = await fetch(
`${BASE}/monitors/42/snapshots?captured_before=2026-09-05T23:59:59Z&status=completed&per_page=1`,
{ headers }
).then(r => r.json());
if (snapshots.length > 0) {
const img = await fetch(snapshots[0].files.screenshot_url);
// save or display the image
}uri = URI("#{BASE}/monitors/42/snapshots?captured_before=2026-09-05T23:59:59Z&status=completed&per_page=1")
req = Net::HTTP::Get.new(uri, headers)
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
snapshots = JSON.parse(resp.body)['data']
puts snapshots.first['files']['screenshot_url'] if snapshots.any?req, _ := http.NewRequest("GET",
BASE+"/monitors/42/snapshots?captured_before=2026-09-05T23:59:59Z&status=completed&per_page=1", nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
resp, _ := http.DefaultClient.Do(req)
// parse response and use files.screenshot_url