Screenshots
One of the most useful features from SnapsBrew is being able to get screenshots of your own site pages. Sometimes you don't want to generate a custom image but just show a preview of the page your visitors will see. Doing this with SnapsBrew is as easy as it gets.
The screenshot model
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the screenshot.
- Name
url
- Type
- string
- Description
The url from where the screenshot was taken.
- Name
image_url
- Type
- string
- Description
The url where the screenshot is stored.
- Name
width
- Type
- integer
- Description
The width in pixels of the screenshot.
- Name
height
- Type
- integer
- Description
The height in pixels of the screenshot.
- Name
created_at
- Type
- timestamp
- Description
The date and time when the screenshot was taken..
Screenshot model
{
"id": "859419e5-765d-4711-b76b-95f4b05e73bf",
"url": "https://legendsverse.com",
"image_url": "https://media.snapsbrew.com/859419e5/legendsverse-com.png",
"width": 1330,
"height": 780,
"created_at": "1985-10-15T00:00:00.619Z"
}
List all screenshots
This endpoint will allow you to make a GET
request to get a list of the screenshots that have been created. This endpoint doesn't have any required fields but you certainly need to add a few to travel trough the paginated list.
Optional attributes
- Name
cursor
- Type
- string
- Description
Cursor position of the paginated response.
- Name
pagination
- Type
- integer
- Description
The items quantity returned in each response page. Defaults to
15
Request
{
cursor: "1041afe7-b9c3-42ef-8530-6910bb486e76"
}
Response
{
"items": [
{
"id": "859419e5-765d-4711-b76b-95f4b05e73bf",
"url": "https://legendsverse.com",
"image_url": "https://media.snapsbrew.com/859419e5/legendsverse-com.png",
"width": 1330,
"height": 780,
"created_at": "1985-10-15T00:00:00.619Z"
},
{
"id": "775d1f4a-370e-42b4-ba90-3ed20181f7b8",
"url": "https://miispeek.com",
"image_url": "https://media.snapsbrew.com/775d1f4a/miispeek-com.png",
"width": 1330,
"height": 780,
"created_at": "1955-10-15T00:00:00.619Z"
},
{
"id": "11f58c0f-8aa8-4f43-a1a2-282047b08558",
"url": "https://remotedevs.lat",
"image_url": "https://media.snapsbrew.com/775d1f4a/remotedevs-lat.png",
"width": 1330,
"height": 780,
"created_at": "1895-10-15T00:00:00.619Z"
}
],
"metadata": {
"items_per_page": 15,
"next_page_cursor": "d78ae80b-34d5-4a1e-8845-48bbff14697b",
"previous_page_cursor": null
}
}
Take a screenshot
This endpoint allows you to make a POST
request to take screenshots of any website. Basically, the only required field is url
, but you can customize the browser size. Take a look below.
Required attributes
- Name
url
- Type
- string
- Description
The website page you want to take a screenshot from.
Optional attributes
- Name
width
- Type
- integer
- Description
The width of the browser you are going to take a screenshot to. Defaults to
1330
.
- Name
height
- Type
- integer
- Description
The height of the browser you are going to take a screenshot to. Defaults to
1080
.
Request
{
"url": "https://legendsverse.com",
"width": 1500,
"height": 1200
}
Response
{
"id": "73824855-47b0-421d-be7d-e238ebfbfe29",
"url": "https://legendsverse.com",
"image_url": "https://media.snapsbrew.com/43/conversions/media-librarywE0C8F-image.jpg",
"width": 1500,
"height": 1200,
"created_at": "1985-10-15:18:38.000000Z"
}
Retrieve a Screenshot
This endpoint will allow you to make a GET
request to get a single screenshot.
Response
{
"id": "73824855-47b0-421d-be7d-e238ebfbfe29",
"url": "https://legendsverse.com",
"image_url": "https://media.snapsbrew.com/43/conversions/media-librarywE0C8F-image.jpg",
"width": 1500,
"height": 1200,
"created_at": "1985-10-15:18:38.000000Z"
}