Getting Started
You can use the API to generate screenshots in PNG, JPEG, or WebP format for any given URL. Whether you need to archive web pages, generate social media previews, or monitor site changes, we've got you covered.
First Touch
The Screenshot API is straightforward to use. Here is an example of an actual request to the API:
curl -X POST https://snappkit.com/api/screenshot \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://apple.com"
}' \
--output screenshot.pngThe result is a high-quality screenshot of apple.com saved as screenshot.png.
Sign up to get your access key and start taking screenshots.
Requests
The API supports POST HTTP requests. All requests are sent over HTTPS to protect your privacy.
To take a screenshot, send a POST request to:
https://snappkit.com/api/screenshotAccess Key
You must provide your access key in the Authorization header:
Authorization: Bearer <your_access_key>Options
Specify options as JSON in the body of the request:
POST https://snappkit.com/api/screenshot
Content-Type: application/json
{
"url": "https://example.com",
"width": 1920,
"height": 1080,
"fullPage": true
}See the API Reference for all available options.
Responses
The API returns the raw image binary (PNG, JPEG, or WebP) directly in the response body.
Content-Type
The Content-Type header is set according to the requested format:
image/png(default)image/jpegimage/webp
Caching
Responses include standard HTTP caching headers to optimize performance:
Cache-Control: public, max-age=3600(Cached for 1 hour)ETag: A unique hash of the image content
Errors
If something goes wrong (e.g., invalid URL, missing API key), the API returns a JSON error response with an appropriate HTTP status code.
{
"error": "Invalid request parameters",
"details": [
{
"field": "url",
"message": "Invalid URL format"
}
]
}See the Error Handling Guide for a complete list of error codes and solutions.