To take screenshots trough the SiteCapt API you make a GET request to the API URL:



The API supports these parameters.

api_keyYour SiteCapt API key. api_key=44f398ca-4055-4d47-8464-54c5d0c5b7a7
urlThe URL of the website for the screenshot. url=https://www.google.com
viewport_widthThe width of the browser viewport in pixels. viewport_width=1900
viewport_heightThe height of the browser viewport in pixels. viewport_height=1200
widthThe width of the generated screenshot image. width=500
heightThe height of the generated screenshot image. height=300
fullsizeProduce a full size screenshot of the entire page. The height parameter is ignored when fullsize is yes. fullsize=yes
waitWait this many seconds after the page has fully loaded before taking the screenshot. wait=3

An Example

curl "https://api.sitecapt.com/?api_key=44f398ca-4055-4d47-8464-54c5d0c5b7a7&url=http://www.flickr.com/&viewport_width=1600&viewport_height=1200&width=800&height=400" > screenshot.png

This will generate a screenshot of http://www.flickr.com/. The browser viewport will be 1600x1200 pixels large and the screenshot will be scaled and cropped to 800x400 pixels.

If an image needs to be cropped, we always cut away pixels away at the right and bottom edges.

The resulting image is always in PNG format.


While it might be convenient for you to use the API URL directly in your HTML code to load website screenshots on the fly we would like to point out that for several reasons it is much safer and efficient to load and cache the screenshots yourself before displaying them:

  1. It takes an awful amount of time to load a website screenshot. On average a screenshot will be ready after 7 (!) seconds.
  2. If you cache screenshots and use these cached versions to display the images on your website you save a lot of money. Creating a screenshot again, even one you've requested a second ago, will cost credits.
  3. If you expose your API key to the public everyone can use you API key at their leisure to generate screenshots at your expense, so guard your API key as best as you can.
  4. The PNG format generated by the API ensures that you get the maximum quality resulting in a rather large file size. In most cases it makes more sense to deliver a much smaller JPEG image to your users.