Skip to content

Use the API

Stefan Zweifel edited this page Feb 10, 2021 · 7 revisions

To use the API, you must have an API key. You find your API key at the dashboard.
Next it's important to know that Screeenly doesn't store your screenshots forever. 1 hour after the creation of a screenshot, the file will be deleted on the server!

Available API Endpoints

The base url for all API calls is https://domain-to-screeenly-instance.com/api/v1.
In the case of screeenly.com the base URL would be http://screeenly.com/api/v1. The response type is always JSON.

1. /fullsize

Create a screenshot of a given URL.

Payload structure:

keyname type validation default value description
key string required Your Screeenly API Key
url string required Website which should be captured
height integer optional Height of screenshot
width integer optional Width of screenshot viewport (300 equals mobile device)
delay integer optional 1 Delay in seconds before a screenshot should be taken (max 10 seconds)

Response structure

Success
keyname Description
path Path to image file on Screeenly server
base64 Base64-string of image file. Can be used in src-Attribute of img-Tag (eg. <img src="$response->base64">)
base64_raw Base64-string of image file. Can be used, if you want to store the image directly to a file
Error
keyname Description
title Title message
message Description of accoured error

A word about errors

Everything else than HTTP status 200 should be considered as an error!

HTTP Code Description
200 All is fine
401 Authorization failed. No or wrong API Key used
400 Validation Error, checkout the response message!
500 Something went wrong in the API