Utils API
screenshot public
1
Node
JavaScript
Python beta
Ruby beta
Shell
curl
Hey! Want to build awesome, scalable APIs like this one?
Sign up with Standard Library today and build your own API or connect to others in seconds.
We hope you enjoy documentation for the Utils screenshot API on Standard Library! This API can be used via the command line (shell), Node, Ruby, Python or as a generic HTTP call in any language. Check the code examples on the right associated with each API method for how to use this API in your language of choice.
API Description
Screenshot as a Service
# API Documentation Given a url and dimensions in pixels, `utils.screenshot` returns a PNG. For convenience, instead of specifying `width` and `height` manually, you can choose from two pre-defined `screenSize`s- ```javascript mobile: { width: 750, height: 1334 }, desktop: { width: 1920, height: 1080 } ``` You can also provide a query selector as `selector` instead of a set of dimensions. `utils.screenshot` will return an image of just the element represented by the selector. Should a jpeg be preferred, you can set `fileFormat` to 'jpeg'.
Takes a screenshot of [url]. Must specify either [screenSize], [width] and [height], or [selector]
Authenticated   |   Pricing  ·  Free   |   Limit  ·  no rate limit
Unauthenticated   |   Limit  ·  no rate limit
Parameters
url
required
string
(no description)
current value set to
enter a test value
screenSize
string
One of [mobile, desktop]
optional, default value is
null
optional, current value set to
enter a test value
width
number
Width of the viewport in pixels
optional, default value is
null
optional, current value set to
enter a test value
height
number
Height of the viewport in pixels
optional, default value is
null
optional, current value set to
enter a test value
selector
string
Query selector of element you want to capture
optional, default value is
null
optional, current value set to
enter a test value
fileFormat
string
One of [png, jpeg]. Default is png
optional, default value is
"png"
optional, current value set to
enter a test value
Made with by the Utils team with the help of Standard Library.