Snapiant
Documentation

Documentation

Getting startedParametersErrorsExamplesQuota

Getting started

The url format for making a screenshot request to Snapiant via GET or POST request:

https://screenshot.snapiant.com/v1/screenshot

Parameters are passed through a query string:

https://screenshot.snapiant.com/v1/screenshot?param1=somevalue&param2=anothervalue

You'll also need to add your access_key parameter to authorize usage of this service:

https://screenshot.snapiant.com/v1/screenshot?access_key=MY_ACCESS_KEY?url=amazon.com

Parameters

Parameter

Default

Description

access_key

A valid access key allowing you to make API calls. Access keys can be managed from your dashboard.

url

The URL of the website you wish to take a screenshot of.

timeout

30

How long to wait (in seconds) for the requested URL to response.

ttl

86400

The amount of seconds that a screenshot will be cached. This means that requesting the same screenshot within the TTL period will not count towards your usage. Range is from 0 seconds to 2592000 seconds (30 days).

force

Generate a new screenshot even if it is cached.

full_page

Set to true if you would like to capture the full page of the website.

width

1920

Width (in pixels) of the browser viewport.

height

1080

Height (in pixels) of the browser viewport.

delay

0

Delay (in seconds) to wait before the screenshot will be taken. Range: 0 seconds to 10 seconds.

wait_for_selector

Wait until the provided CSS selector matches within the webpage before taking a screenshot. Default timeout is 20 seconds.

selector

Takes a screenshot of the first match of the given CSS selector. Default timeout is 20 seconds.

wait_timeout

20

Time (in seconds) before `waitForSelector` or `selector` will timeout. Range: 0 seconds to 45 seconds.

format

jpeg

Format of the screenshot. Can be `jpeg` or `png`

quality

85

Image quality of the screenshot. Only works with `jpeg`. Range: 0 to 100

transparent

Hide the website's default background and the image will have a transparent background. Only works with `png`

thumbnail_width

Width (in pixels) of the thumbnail to be created. This option will be ignored if `fullPage` is set to true

retina

This will increase create a high definition screenshot that is suited well for retina devices. Since this is a heavy task, it will take slightly longer to generate.

css

You can provide custom CSS by using a URL encoded string.

js

You can provide custom JavaScript by using a URL encoded string.

accept_language

Sets the `Accept-Language` header.

user_agent

Sets the `User-Agent` header to mimic other devices/browsers.

headers

Sets headers on the request. The string should be URL encoded.

cookies

Sets cookies on the request. The string should be URL encoded.

latitude

Latitude used to emulate the Geolocation API.

longitude

Longitude used to emulate the Geolocation API.

accuracy

0

The accuracy value (in meters) used to emulate the Geolocation API.

fail_on_4xx

If the request to the URL receives a status code 400-451 it will make the API call fail.

fail_on_5xx

If the request to the URL receives a status code 500-511 it will make the API call fail.

Errors

HTTP Status Code

Description

400

Request contains invalid parameters or missing a required parameter.

401

Access key is not provided or invalid.

402

A failed payment has occurred.

403

Current subscription plan doesn't have permission to perform the request.

426

Monthly quota has been reached. Upgrade your subscription to continue.

429

Too many requests hit the API too quickly.

500

Something bad happened on Snapiant's end. (Rare).

Examples

curl --request GET --url https://screenshot.snapiant.com/v1/screenshot?access_key=MY_ACCESS_KEY&url=SOME_WEBSITE_URL

Quota

Header

Description

X-Quota-Limit

Subscription plan limit

X-Quota-Remaining

Amount of screenshots remaining until your next billing period

X-Quota-Reset-At

UNIX timestamp for when the current billing period ends and your remaining screenshots resets

About Snapiant

We offer a clean and straight forward API that anyone can use to simplify their screenshot needs. We use cloud technology that enables us to scale with ease, stability, and cost efficiency.

Links

DocumentationContactTerms of ServicePrivacy Policy

© 2022 Snapiant - All rights reserved