Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apilayer/screenshotlayer

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apilayer/screenshotlayer

Screenshotlayer: Capture highly customizable snapshots of any website

  • 0.1.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

screenshotlayer-js

Screenshotlayer: Capture highly customizable snapshots of any website

Installation

Using npm

npm install --save @apilayer/screenshotlayer

or yarn

yarn add @apilayer/screenshotlayer

Getting Started

Head over to Screenshotlayer and create an account. Copy access key from dashboard.

You can set a secret key from the dashboard or just use an empty string.

import screenshotlayer from '@apilayer/screenshotlayer'

const useHTTPs = false
const layer = new screenshotlayer("<your-access-key>", "<your-secret-key>", useHTTPs)

capture

capture creates a valid screenshot URL

Signature:

capture(site: string, config: Config = null): string

Example:

const response = layer.capture("https://apilayer.com")

console.log("response:", response)

Response:

"http://api.screenshotlayer.com/api/capture
  ?access_key=<your-access-key>
  &url=https://apilayer.com
  &viewport=1440x900
  &format=PNG"

Alternatively, you can specify a Config object as the second parameter. Supported properties include:

ParameterDescription
fullPageset to true if you want to capture the full height of the target website
widthspecify your preferred thumbnail width in pixels
vHeightspecify your preferred viewport height dimensions in pixels
vWidthspecify your preferred viewport width dimensions in pixels
formatset your preferred image output format (PNG
injectCSSattach a URL containing a custom CSS stylesheet
delayspecify a delay before screenshot is captured (in seconds)
tTLdefine the time (in seconds) your snapshot should be cached
forceset to true if you want to force the API to capture a fresh screenshot
placeholderattach a URL containing a custom placeholder image or set to "1"
userAgentspecify a custom User-Agent HTTP header to send with your request
acceptLangspecify a custom Accept-Language HTTP header to send with your request
exportexport snapshot via custom ftp path or using your AWS S3 user details

License

MIT

FAQs

Package last updated on 01 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc