Screenshotlayer

FREE
By stefan.skliarov
Updated 5 months ago
Video, Images
-/10
Popularity Score
-
Latency
-
Success Rate

Screenshotlayer API Documentation

Capture and automate highly customizable screenshots.

View API Details
POSTcaptureSnapshot
POSTcaptureSnapshot

Verify the provided address

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
urlSTRING
REQUIREDWebsite url to capture
apiKeyCREDENTIALS
REQUIREDApi key obtained from Screenshotlayer
Optional Parameters
outputFormatSELECT
OPTIONALYour snapshots can be requested in three different formats: PNG, JPG and GIF. You can change the default format (PNG) simply by appending the API's outputFormat parameter containing your preferred format
placeholderImageSTRING
OPTIONALBy appending the API's placeholderImage parameter and setting it to 1, you can request the default screenshotlayer placeholder image. If you prefer setting your own custom placeholder image, simply append it to the API's placeholderImage parameter as an image URL.Supported file formats: PNG, JPEG, GIF
thumbnailsWidthNUMBER
OPTIONALBy default, the screenshotlayer API returns your target website's snapshot in original size (1:1). If you'd like to request a thumbnail, append the API's thumbnailsWidth parameter containing your preferred thumbnail width in pixels.
cachingTimeNUMBER
OPTIONALBy default, website screenshots are cached for 30 days (2,592,000 seconds). Using the API's cachingTime parameter, you can specify a custom caching time (time-to-live) lower than the default setting.
cssUrlSTRING
OPTIONALInject a custom CSS stylesheet into the target website
acceptLanguageSTRING
OPTIONALThe default HTTP Accept-Language header is en-US, en (US English, or English in general). You can specify a custom Accept-Language header by appending it to the API's acceptLanguage parameter.
captureDelayNUMBER
OPTIONALSpecify a custom delay time (in seconds) before the snapshot is captured
viewportControlSTRING
OPTIONALThe screenshotlayer API's default viewportControl setting is 1440x900. You can specify a custom viewport by setting the viewportControl parameter to your desired dimensions. (format: width x height, in pixels)
forceRefreshNUMBER
OPTIONALYou can easily force the API to capture a fresh screenshot of the requested target URL by appending the forceRefresh parameter to the request URL and setting it to 1.
fullPageNUMBER
OPTIONALBy default, screenshots are rendered based on the height of the selected (or default) viewport. Alternatively, you can request the full height of the target website to be captured, simply by setting the API's fullPage parameter to 1.
secretKeywordSTRING
OPTIONALSecret keyword to prevent your publicly displayed API request URL from being abused
userAgentSTRING
OPTIONALBy default, the screenshotlayer API does not send any HTTP User-Agent headers with your request. You can specify a custom user-agent string by appending it to the API's userAgent parameter.
exportToSTRING
OPTIONALIf you are subscribed to the Professional or Enterprise Plan, you may request the API to directly export your snapshot to your AWS S3 Bucket. This can be done simply by appending your S3 Bucket path (format: s3://API_KEY:[email protected]) to the API's exportTo parameter. Professional and Enterprise Customers may also specify a custom ftp path to directly export captured snapshots to. This can be achieved simply by appending your desired FTP path (format: ftp://user:[email protected]) to the API's exportTo parameter.
Code Snippet
unirest.post("https://Screenshotlayerstefan-skliarovV1.p.rapidapi.com/captureSnapshot")
.header("X-RapidAPI-Host", "Screenshotlayerstefan-skliarovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://Screenshotlayerstefan-skliarovV1.p.rapidapi.com/captureSnapshot
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://Screenshotlayerstefan-skliarovV1.p.rapidapi.com/captureSnapshot")
.header("X-RapidAPI-Host", "Screenshotlayerstefan-skliarovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication