Get Screenshot
Overview
The PeekShot Screenshot API allows you to retrieve a previously captured screenshot using its unique identifier.
Endpoint
GET https://api.peekshot.com/api/v1/screenshots/{screenshot_id}
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
screenshot_id | string | Yes | The unique ID of the screenshot to fetch. |
Request Headers
Header | Description |
---|---|
x-api-key | Your unique API key for authentication. |
Example Request (Using Axios)
- cURL
- Node.js
- Python
- Go
- Java
- PHP
- Ruby
curl --location 'https://api.peekshot.com/api/v1/screenshots/1' \
--header 'x-api-key: your-api-key'
const axios = require('axios');
const config = {
method: 'get',
url: 'https://api.peekshot.com/api/v1/screenshots/1',
headers: {
'x-api-key': 'your-api-key'
}
};
axios.request(config)
.then(response => console.log(response.data))
.catch(error => console.error(error));
import requests
url = "https://api.peekshot.com/api/v1/screenshots/1"
headers = {
"x-api-key": "your-api-key"
}
response = requests.get(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.peekshot.com/api/v1/screenshots/1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("x-api-key", "your-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
public class ScreenshotAPI {
public static void main(String[] args) {
try {
URL url = new URL("https://api.peekshot.com/api/v1/screenshots/1");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("x-api-key", "your-api-key");
int responseCode = conn.getResponseCode();
BufferedReader reader = new BufferedReader(new InputStreamReader(
(responseCode >= 200 && responseCode < 300) ? conn.getInputStream() : conn.getErrorStream()));
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
System.out.println("Response: " + response.toString());
conn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
<?php
$url = "https://api.peekshot.com/api/v1/screenshots/1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: your-api-key"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'uri'
uri = URI.parse("https://api.peekshot.com/api/v1/screenshots/1")
request = Net::HTTP::Get.new(uri)
request["x-api-key"] = "your-api-key"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
Example Response
{
"status": "success",
"message": "screenshot request status fetched successfully",
"data": {
"id": 1,
"organizationId": 1,
"projectId": 1,
"status": "COMPLETE",
"url": "https://www.yourdomain.com/",
"screenshotImageSize": 1012796,
"options": {
"delay": 0,
"fresh": true,
"width": 1680,
"height": 867,
"output": "json",
"retina": true,
"language": "en-GB,en-US;q=0.9,en;q=0.8",
"block_ads": false,
"dark_mode": false,
"file_type": "jpeg",
"full_page": false,
"disable_javascript": false,
"block_cookie_banner": false
},
"screenshotUrl": "https://peekshot.s3.ap-south-1.amazonaws.com/6/image.jpeg",
"creditsRequired": 1,
"duration": "9.864",
"isActive": true,
"createdAt": "2025-03-23T09:11:25.906Z",
"updatedAt": "2025-03-23T09:11:25.906Z",
"deletedAt": null,
"deletedByUserId": null
},
"statusCode": 200
}
Error Responses
Status Code | Error Message | Description |
---|---|---|
400 | Invalid Request | Check if the screenshot ID is valid. |
403 | Forbidden | Invalid or inactive API key. |
500 | Internal Server Error | Issue on the server side. |
Notes
- Ensure that the provided
screenshot_id
exists in the system. - API requests must include a valid
x-api-key
in the headers.
For further assistance, contact [email protected].