Shots (Screenshots and PDFs)
The /api/v1/shots
API endpoints allows you to generate screenshots or PDFs of a given URL or HTML snippet. You can find a detailed list of all available parameters in the API reference.
Create a screenshot from URL
The most basic payload to create a screenshot of a URL looks like this.
{
"url": "https://en.wikipedia.org/wiki/Special:Random"
}
The resulting JSON response will contain a URL to download the screenshot or PDF, as well as the expiration date of the generated file. The meta section contains information about your current usage and limits.
{
"data": {
"url": "https://en.wikipedia.org/wiki/Special:Random",
"expires_at": "2024-06-28T19:20:50+00:00",
"screenshot_url": "https://3.screeenly.com/storage/153449/3e23f899-ba17-44ac-a089-48382db7fc7c.jpg"
},
"meta": {
"request_id": null,
"usage_limit": {
"limit": 1000,
"usage": 15,
"remaining": 985,
"resets": "2024-07-01T00:00:00+00:00"
}
}
}
Create a screenshot from HTML
If you want to create a screenshot from a given HTML snippet, you can use the following payload.
{
"html": "<html><head></head><body><h1>Hello World</h1></body></html>"
}
Create a PDF from a URL
To create a PDF from a given URL, you can use the following payload.
{
"url": "https://en.wikipedia.org/wiki/Special:Random",
"file_type": "pdf"
}
Create a PDF from HTML
To create a PDF from a given HTML snippet, you can use the following payload.
{
"html": "<html><head></head><body><h1>Hello World</h1></body></html>",
"file_type": "pdf"
}
As mentioned, these are just a few examples of how you can use the /api/v1/shots
API. For a full list of available parameters and responses, please refer to the API reference.
You can also try out different parameters in our playground. The playground will also build up the API payload for you, so you can easily copy and paste it into your application.