There are several ways to use our thumbnail generation service. You can use direct linking, javascript wrappers or you can use APIs on the server side for advanced functionality.

API Versions

V2 Current Version. Recommended for use.
V1 - Original API Discontinued. Redirected to V2. Should not be used.

The current version of the URL documented on this page is V2. If you still use the original first version of the API, you are encouraged to update to using the latest version.

The original API (functional between January 2011 and January 2013) is being redirected to the current version.

Direct Linking

Direct linking allows you to embed an image URL wherever you need that in your site.

The parameters for this URL

http://{entrypoint}.pagepeeker.com/v2/thumbs.php?size={size}&code={code}&refresh={refresh}&wait={wait}&url={url}

The parameters for this API are

Parameter Description
{entrypoint}
Free free. That makes it: http://free.pagepeeker.com/
Unbranded api. That makes it: http://api.pagepeeker.com/
All paid accounts api. That makes it: http://api.pagepeeker.com/
{size}

The size of the thumbnail. Available sizes:

t Tiny, 90 x 68 pixels
s Small, 120 x 90 pixels
m Medium, 200 x 150 pixels
l Large, 400 x 300 pixels
x Extra large, 480 x 360 pixels

Note

Premium accounts can have other sizes available as well

{code}

optional

Your API key. This is optional and recommended to use only for server side calls. Client side usage does not require it, as we automatically show the thumbnails only for the domains added in your account.

For the free branded accounts, this parameter is ignored, as we provide the free branded service for anybody, free of charge.

Warning

Never use this code on client side pages. We use it for counting your API calls, so having it used by third parties will count against your monthly quota.

{refresh}

premium

optional

This parameter forces the currently generated thumbnail to be regenerated. It is optional and will be ignored unless it contains the value 1

Note

This is available for premium accounts only

{wait}

premium

optional

If the thumbnail is not already generated and this parameter is present, the API will not return a placeholder image, but wait until the thumbnail is generated and then return the generated thumb. The value of the parameter is the maximum number of seconds we should wait before returning either the generated image or a placeholder.

Note

This is available for premium accounts only
{url}

The URL to generate the thumbnail from. Needs to be URL encoded.


For paid and unbranded accounts, this API returns a series of headers that can be examined in order to determine the outcome of the request and other useful information

Header Meaning
X-PP-Capture-Method The engine used for capturing the screenshot.
X-PP-Capture-Time How much the capturing of the screenshot took.
X-PP-Final-URL In case the URL requested has been redirected, the final URL the redirection lead to.
X-PP-Hash Hash of the capture. Used for debugging captures that went wrong.
X-PP-Timestamp The unix timestamp of the screenshot capture time.
X-PP-Error True if there was an error creating the thumbnail, False otherwise.

REST APIs Intended to be used server side

These REST APIs are intended to be used server side, but will work client side as well, if needed.

Thumbnail Ready

This API will let you check if a thumbnail is generated on our server and is available for being displayed.

A normal sequence for calling this API would be:

  • Issue a reset API call: http://{entrypoint}.pagepeeker.com/v2/thumbs.php?size=m&refresh=1&url=wikipedia.org
  • Poll this API until it returns that the image is available: http://{entrypoint}.pagepeeker.com/v2/thumbs_ready.php?size=m&url=wikipedia.org
  • Download the image: http://{entrypoint}.pagepeeker.com/v2/thumbs.php?size=m&url=wikipedia.org
http://{entrypoint}.pagepeeker.com/v2/thumbs_ready.php?size={size}&code={code}&url={url}

The parameters for this API are

Parameter Description
{entrypoint}
Free free. That makes it: http://free.pagepeeker.com/
Unbranded api. That makes it: http://api.pagepeeker.com/
All paid accounts api. That makes it: http://api.pagepeeker.com/
{size}

The size of the thumbnail. Available sizes:

t Tiny, 90 x 68 pixels
s Small, 120 x 90 pixels
m Medium, 200 x 150 pixels
l Large, 400 x 300 pixels
x Extra large, 480 x 360 pixels

Note

Premium accounts can have other sizes available as well

{code}

optional

Your API key. This is optional and recommended to use only for server side calls. Client side usage does not require it, as we automatically show the thumbnails only for the domains added in your account.

For the free branded accounts, this parameter is ignored, as we provide the free branded service for anybody, free of charge.

Warning

Never use this code on client side pages. We use it for counting your API calls, so having it used by third parties will count against your monthly quota.
{url}

The URL to generate the thumbnail from

This URL returns JSON code that shows whether the thumbnail is ready or not

Field Meaning
Error 1 if there was an error creating the thumbnail, 0 otherwise.
IsReady 1 if the screenshot is available and can be retrieved, 0 if not yet available.