Hashtag
Scrolling screenshots

You can access the 'Scrolling Screenshot' functionality, which allows you to capture a video (in webm, gif, or mp4 format) of a web page with various customizable options. These options include the ability to scroll backward, adjust scrolling speed, set the duration, and start recording instantly

Example:

const axios = require("axios");
let config = {	method: "get",	maxBodyLength: Infinity,	url: "https://shot.screenshotapi.net/screenshot?token=TOKEN&url=https%3A%2F%2Fgoogle.com&output=json&file_type=gif&wait_for_event=load&scrolling_screenshot=true",	headers: { }};
axios.request(config).then((response) => {	console.log(JSON.stringify(response.data));}.catch((error) => {	console.log(error);});

In the following video, you'll find a more illustrative example of how to utilize the 'Scrolling Screenshot' functionality. When you click the 'Take Screenshot' button, it will take a few seconds to capture the video and provide you with JSON containing the video information.

Here is the recorded video demonstrating the example.

Hashtag
Multiple Scrolling screenshots

In addition to the 'Scrolling Screenshot' functionality, our application offers the feature of 'Multiple Scrolling Screenshots'. With this feature, you can capture multiple scrolling screenshots of web pages, each with different sizes in terms of width and height. This means you have the flexibility to customize the dimensions of the screenshots according to your specific requirements.

Example:

In the parameters of the endpoint, we will pass an array of objects with different sizes. To achieve this, we need some code to pass this array in the 'sizes' parameter.

let sizesArr = [ 	{ id:  1 , width:  1920 , height:  1080 },	{ id:  2 , width:  1280 , height:  720 },	{ id:  3 , width:  800 , height:  450 },];
let  SIZES = JSON.stringify(sizesArr);console.log(SIZES);
const axios = require("axios");
let config = {	method: "get",	maxBodyLength: Infinity,	url: "https://shot.screenshotapi.net/screenshot?token=TOKEN&output=json&file_type=mp4&scrolling_screenshot=true&url=https%3A%2F%2Fgoogle.com%2F&multiple_scrolling=true&sizes=%5B%7B%22id%22%3A1%2C%22width%22%3A%221920%22%2C%22height%22%3A%221080%22%7D%2C%7B%22id%22%3A2%2C%22width%22%3A%221280%22%2C%22height%22%3A%22720%22%7D%2C%7B%22id%22%3A3%2C%22width%22%3A%22800%22%2C%22height%22%3A%22450%22%7D%5D",	headers: { }};
axios.request(config).then((response) => {	console.log(JSON.stringify(response.data));}.catch((error) => {	console.log(error);});

In the following video, you'll find a more illustrative example of how to utilize the 'Multiple Scrolling Screenshot' functionality. When you click the 'Take Screenshot' button, it will take a few seconds to capture the video and provide you with JSON containing the video information.

Hashtag
Features

Hashtag
File Type

The file type determines the format in which the rendered content (such as video or animation) will be returned.

Available file types:

  • WEBM

  • MP4

  • GIF

The default value is WEBM.

Hashtag
Scroll Speed

The scrolling speed affects how quickly the page is scrolled during rendering, which can impact the render time and the final output.

Available options:

  • fast

  • normal

  • slow

The default value is normal.

Hashtag
Duration

This value determines how long the scrolling action will take, measured in seconds.

  • You can set a value between 0 and 100 to adjust the scrolling time.

  • A higher value will result in a longer scrolling duration and a longer video.

  • A lower value will speed up the scrolling, reducing the video duration.

The default value is 0 (indicating no scrolling or instant rendering).

Hashtag
Scroll Back

The scroll_back option, when set to true, allows the scrolling action to return to the top of the page after reaching the bottom.

  • If enabled, the browser will scroll to the end of the page, and once it reaches the bottom, it will automatically scroll back up to the top.

  • This option creates a looping scrolling effect, useful for video renderings that require the entire page to be revisited.

The default value is false (no scrolling back to the top).

©2024 ScreenshotAPI. All Rights Reserved.