This guide combines two powerful PeekShot features: capturing screenshots via the REST API and delivering the finished screenshot URL to your system via a webhook. By the end, you’ll trigger captures from your code and receive results automatically.
Step 1: Generate an API Key
From the sidebar, go to Account.
Open the API Keys tab.
Create a new API key (if you don’t already have one) and copy it somewhere secure.
Your key will be used as an x-api-key header in API requests.
Step 2: Set Up a Webhook Endpoint in PeekShot
From the sidebar, click Webhooks.
Click Create Webhook.
Provide a Name and paste your endpoint URL (from your server, Zapier, Make.com, Pabbly Connect, etc.).
Select one or more Projects that will trigger this webhook, or leave it blank to receive events from all projects.
Click Create Webhook to save.
Tip: Use the Send sample webhook button to test your endpoint receives and logs data correctly.
Step 3: Choose or Create a Project for API Captures
Each screenshot is associated with a project:
Go to Projects from the sidebar.
Either use an existing project or create a new one dedicated to your API-driven captures (for example, "API Captures").
Note the project’s ID from the table (shown in the ID column).
Step 4: Call the PeekShot URL Screenshot API
To capture a screenshot from a URL using the API, send a POST request to:
https://api.peekshot.com/api/v1/screenshots
Include the following header:
x-api-key: YOUR_API_KEY_HEREAnd a JSON body similar to:
{
"project_id": "YOUR_PROJECT_ID",
"url": "https://example.com",
"file_type": "png",
"full_page": "false",
"disable_javascript": "false",
"disable_animations": "false",
"retina": "false"
}Notes:
Make sure
project_idmatches a project that is linked to your webhook (directly or via "All Projects").Additional options like
delay,emulate_device,element_selector,proxy_url,inject_css, andinject_jscan also be provided as strings.
Step 5: Understand the API Response
When you send a valid request, PeekShot responds with a JSON object containing status information and a requestId. For example:
{
"status": "success",
"data": {
"requestId": 12345,
"message": "Screenshot request accepted"
}
}This tells you the capture request is queued and being processed. The actual screenshot URL will be delivered through the webhook once the capture completes.
Step 6: Receive the Screenshot via Webhook
When the screenshot finishes processing for the project(s) you configured, PeekShot sends an HTTP POST request to your webhook URL with a payload that includes:
The screenshot URL
Capture status (for example, COMPLETE or FAILED)
Request or screenshot identifiers
Associated project information and timestamps
In tools like Zapier, Make.com, or Pabbly Connect, you will see this payload as input data you can map into Google Sheets, Airtable, Slack, or other destinations.
Step 7: Wire the Webhook Data into Your Workflow
Depending on your integration platform:
Zapier / Make.com / Pabbly: Use the webhook trigger, then add actions to write the screenshot URL into a spreadsheet, database, CRM, or notification channel.
Custom backend: In your server route, parse the JSON body, store the screenshot URL in your database, and run any additional business logic.
Step 8: Test and Iterate
Trigger a sample API request from your code, API client, or a simple curl script.
Confirm your webhook receives the payload and that your workflow processes the screenshot URL as expected.
Adjust your capture options (full page, delay, device, etc.) if the final image does not look as desired.
Best Practices for API + Webhook Workflows
Use separate projects: Group all API-triggered captures for a given workflow into a dedicated project so webhooks remain easy to reason about.
Secure your endpoint: Validate incoming requests (for example, by checking source IPs, secrets, or request structure) to prevent abuse.
Handle retries gracefully: Design your receiver to handle duplicate messages without breaking your downstream data.
Monitor credits: API-based automation can create many captures; keep an eye on credits and plan capacity via the Overview and Billing pages.