Get Projects List
The Get Projects List API allows you to retrieve a list of projects associated with your account. Projects help organize your screenshots and provide better management capabilities.
Endpoint
Section titled “Endpoint”GET https://api.peekshot.com/api/v1/projects
Authentication
Section titled “Authentication”All requests must include the x-api-key
header with a valid API key.
Request Headers
Section titled “Request Headers”Header | Required | Description |
---|---|---|
x-api-key | Yes | Your unique API key for authentication |
Query Parameters
Section titled “Query Parameters”Parameter | Type | Required | Default | Description |
---|---|---|---|---|
page | integer | No | 1 | Page number for pagination |
limit | integer | No | 10 | Number of results per page |
name | string | No | - | Filter projects by name |
Example Requests
Section titled “Example Requests”Basic List Request
Section titled “Basic List Request”curl --location 'https://api.peekshot.com/api/v1/projects' \
--header 'x-api-key: your-api-key'
const axios = require("axios");
const getProjects = async (params = {}) => {
const config = {
method: "get",
url: "https://api.peekshot.com/api/v1/projects",
headers: {
"x-api-key": "your-api-key",
},
params: params,
};
try {
const response = await axios.request(config);
console.log(JSON.stringify(response.data));
return response.data;
} catch (error) {
console.log(error);
throw error;
}
};
// Usage
const projects = await getProjects();
import requests
def get_projects(params=None):
url = "https://api.peekshot.com/api/v1/projects"
api_key = "your-api-key"
headers = {
"x-api-key": api_key
}
response = requests.get(url, headers=headers, params=params)
print("Response Code:", response.status_code)
print("Response Body:", response.json())
return response.json()
# Usage
projects = get_projects()
<?php
$apiUrl = "https://api.peekshot.com/api/v1/projects";
$apiKey = "your-api-key";
// Initialize cURL
$ch = curl_init($apiUrl);
// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: $apiKey"
]);
// Execute the request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Check for errors
if (curl_errno($ch)) {
echo "cURL Error: " . curl_error($ch);
} else {
echo "Response (HTTP $httpCode): " . $response;
}
// Close cURL session
curl_close($ch);
?>
Response
Section titled “Response”Success Response (200 OK)
Section titled “Success Response (200 OK)”{
"status": "success",
"message": "Projects fetched successfully",
"data": {
"projects": [
{
"id": 11,
"name": "Delta",
"createdAt": "2025-02-25T04:58:28.205Z",
"updatedAt": "2025-02-25T04:58:28.205Z",
"createdByUser": {
"id": 21,
"email": "john.doe@gmail.com",
"firstName": "John",
"lastName": "Doe"
}
}
],
"meta": {
"currentPage": 1,
"totalProjects": 1,
"limit": 10
}
},
"statusCode": 200
}
Error Responses
Section titled “Error Responses”Status Code | Error Message | Description |
---|---|---|
400 | Invalid Request | Check your input parameters |
403 | Forbidden | Invalid or inactive API key |
500 | Internal Server Error | Issue on the server side |
Related Endpoints
Section titled “Related Endpoints”- Take Screenshot - Create screenshots within projects
- Get Screenshot - Get specific screenshot details
- Screenshots List - List screenshots by project