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.
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 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} |
|
||||||||||
{size} |
The size of the thumbnail. Available sizes:
NotePremium accounts can have other sizes available as well |
||||||||||
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. WarningNever 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. |
||||||||||
premium optional |
This parameter forces the currently generated thumbnail to be regenerated. It is optional and will be ignored unless it contains the value NoteThis is available for premium accounts only |
||||||||||
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. NoteThis 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. |
These REST APIs are intended to be used server side, but will work client side as well, if needed.
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:
http://{entrypoint}.pagepeeker.com/v2/thumbs.php?size=m&refresh=1&url=wikipedia.org
http://{entrypoint}.pagepeeker.com/v2/thumbs_ready.php?size=m&url=wikipedia.org
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} |
|
||||||||||
{size} |
The size of the thumbnail. Available sizes:
NotePremium accounts can have other sizes available as well |
||||||||||
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. WarningNever 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. |