Screenshot Capture Endpoint

Swagger documentation: https://api.screenshotapi.io/swagger#!/capture/capture

Endpoint for submitting a request to capture a URL:

POST https://api.screenshotapi.io/capture

Add your API key to the HTTP header in the apikey field.

Capture Request

Configure the capture options by sending a capture request object in the body of the request. Example of the capture options sent in the body of the capture request:

{
  "url": "string",
  "viewport": "1280x1024",
  "fullpage": false,
  "javascript": true,
  "webdriver": "firefox",
  "device": "",
  "waitSeconds": 0,
  "fresh": false
}

URL

Any valid URL which is publicaly accessible over the Internet.

Viewport

The viewing area of the browser which is making the screenshot request. Manipulating this value will result in the web page rendering differently as it would at those resolutions for responsive and mobile sites.

Fullpage

Optional. By default screenshots are only of the visible "above the fold" area of the viewport. If Fullpage is specified, the resulting screenshot will include the entire page, scrolled down to the bottom.

Incompatible with Chrome webdriver

This option is not available when using the Chrome webdriver.

Javascript

Optional. By default, Javascript is enabled. To disable Javascript while capturing the screenshot, set this to false. This can be useful to prevent pop up banners from covering portions of the page you wish to capture, however some sites will not render properly without Javascript.

Incompatible with Chrome webdriver

This option is not available when using the Chrome webdriver.

Webdriver

Specify the web driver (web browser) to use for the capture. Options are:

  • firefox (default)
  • chrome
  • phantomjs

Device

You can emulate a device to take a screenshot as it would appear on that device by passing this argument.

Only available with Chrome webdriver

This feature is only available with the Chrome webdriver.

Valid options for device emulation are as follows:

 ['apple_iphone_3gs',
 'apple_iphone_4', 
 'apple_iphone_5', 
 'apple_iphone_6', 
 'apple_iphone_6_plus', 
 'blackberry_z10', 
 'blackberry_z30', 
 'google_nexus_4', 
 'google_nexus_5', 
 'google_nexus_s', 
 'htc_evo', 
 'lg_optimus_g', 
 'lg_optimus_one', 
 'motorola_droid_4', 
 'motorola_droid_razr_hd', 
 'samsung_galaxy_note_3', 
 'samsung_galaxy_note', 
 'samsung_galaxy_s4', 
 'firefox_os_flame', 
 'alcatel_fire_e', 
 'geeksphone_keon', 
 'intex_cloud_fx', 
 'lg_fireweb', 
 'zen_fire_105', 
 'zte_open', 
 'amazon_kindle_fire_hdx_7', 
 'apple_ipad_mini', 
 'apple_ipad_4', 
 'blackberry_playbook', 
 'google_nexus_10', 
 'google_nexus_7', 
 'motorola_xoom', 
 'samsung_galaxy_tab', 
 'via_vixen', 
 'matchstick', 
 'chromecast', 
 '720p_hd_television', 
 '1080p_full_hd_television', 
 '4k_ultra_hd_television', 
 'lg_g_watch', 
 'lg_g_watch_r', 
 'moto_360'],

Wait Seconds

Optional, the number of seconds to wait after the page has loaded before taking the screenshot. This may allow extra time for Javascript to fully render on some pages. Two seconds are always waited, this is really additional seconds, so if 3 seconds are specified here, 5 seconds will elapse after the page loads but before the screenshot is taken. Default is 0, max is 10.

Fresh

By default we cache screenshot requests for a maximum of 72 hours. If your request matches a request we have alredy captured within that time, we will immediately serve back the cached content. Keep in mind that unique requsts are the URL plus all specified capture options, so you will only get a cached response if your entire request, including all options, matches what we have already stored.

If however you have a need to ensure the screen capture is fresh (performed on demand and not served from the cache), specify fresh: true in the capture request. Your API credits cost for a fresh request will be 2 credits (as opposed to 1 credit for normal requests).

Capture Response

Example response of a valid capture request:

{
  "status": "accepted",
  "key": "6e5835db1602b82a0ad0d441d2d647e1",
  "apiCreditsCost": 1
}

If the request is not valid, the response will contain error information about the invalid request.

Status

Indicates the status of the request, namely that the request has been accepted.

Key

This is the RequestId or unique key to retrieve the screenshot. This is used to download the screenshot once it has been processed, and to retrieve any log information about the request.

ApiCreditsCost

Inidicates the number of API credits which were consumed by accepting the request. All capture requests use 1 API credit, unless the Fresh flag is indicated, in which case 2 API credits are used.