- Getting Started
- Code Review
- Platforms
- Configuration
- CI integrations
- Web Projects
- Developer Tools
- Get Notified
- API
Screenshotbot provides an API so that you can build internal tooling or write custom scripts.
In most cases, you shouldn’t need to use this API directly, and we suggest you instead use the command line interface instead. In particular, you should avoid calling this API from your tests directly.
This API is still useful query the data that you've already uploaded, or do things like automatically accepting changes.
All our APIs are accessed from https://api.screenshotbot.io/api/. For Enterprise customers you should use the endpoint that you access it from, for example https://customer.screenshotbot.io/api/.
In most cases, error handling is done using HTTP error codes, with success being 200. In some older endpoints we always return 200, but wrap the response as follows:
{ "success": <true|false> "response": <actual-response> "error": <error message if success is false> }
We try to maintain backward compatibility, but this is not guaranteed. To specify a particular API version to maintain compatibility with, pass the optional X-client-api-version HTTP request parameter. The current API version is 17.
We use HTTP Basic authentication, with the username being the API Key, and the password being the API Secret.
For example, if using curl, you can make read requests like so:
curl -u api-key:api-secret https://api.screenshotbot.io/api/...
Send a POST request to /api/image.
{ "id": <unique-id>, "uploadUrl": <a url to upload to> }
If the uploadUrl is present, it means you have to upload the image via a PUT request to the given URL. This will usually only be present the first time you upload this specific image (determined by the md5sum). However we might ask you to reupload images occasionally, so you should not rely on this assumption.
Send a POST request to /api/run.
Each screenshot object has the following structure:
{ "name": <name of the screenshot>, "imageId": <id of the image object associated with this screenshot> }
{ "id": <id of the run> }
Sign up or contact us.