You can use our API Builder Tool to visually see how the most common parameters are used in the API requests!
https://api.pagelr.com or http://api.pagelr.com
The PageLr API uses simple Urls (Http GET) requests designed to minimize the amount of parameters required, every API parameter has a default value, except the
uri parameter that is required.
A minimum valid request looks like:
A request like this using all default parameters would return the full length page, captured in a viewport
The above example returned an image with a width of 1024 pixels, and the height corresponding to the full page.
If you want the same page capture but at a different size, you can get a scaled down version by append the desired image width e.g.
&width=600 to the api call.
The above example returned an image with a width of 600 pixels, and the height corresponding to the full page scaled down from a width of 1024 pixels.
Now when you want different browser size for instance 128, and at a 4/3 aspect ratio can get a scaled down version by append the desired parameters e.g.
&width=600&b_width=1280&height=450 to the url.
uri to the page you want to capture. If it contains anything more than a simple path it need to be urlencoded.
HTTP is used as default protocol in the request, if you require SSL/HTTPS you add that to the uri parameter.
The viewport or browser width in pixels is defined by
b_width and is used layout and render the page. Default is 1024 pixels.
Most webpages are designed to fill up the width of a 1024 pixel wide screen, commonly with a content width around 980 pixels with
some space and chrome around.
To capture a page rendering at a larger width, e.g. 1280 pixels, add
&b_width=1280 to the request.
The width of the image returned, scaled down from the browser width,
width is specified image will have the same width as the viewport (
The height of the image returned, if a
width is specified and is smaller than
b_width the image height will be scaled down with the same proportions as width/b_width.
height is specified in the request the image will have the full height of the web page, this is how you get a fullpage screenshot capture.
There are also pages that changes their look dynamically over time, with a slider or animations. To capture such a page at different points in time you can use the
delay parameter with different values.
delay supported is 30 seconds,
If you need your screenshots with resolution optimizied for high resolution displays, e.g. retina displays.
The PageLr service has built in caching, there are two important reasons to avail of the caching in the service. Foremost it allows to server already captured images really fast, in fractions of a second, secondly captured screenshots served from the cache does NOT count against your Used Capture count in the subscriptions.
If for some reason you normally use default or bigger maxage, i.e. a week or a few days, but a cached image need to be updated before it becomes too old.
You can request the screenshot with the same parameters, and add
&maxage=0, this will refresh the image in the cache. After which your normal request will return
the fresh image, and you don't have to change any code or change the orginial request parameters.
When you need to capture screenshots without advertisement, maybe to avoid adult unrelated content, due to speed or whatnot you can specify
&ads=0 in the request,
and request for content on the captured page coming from known adservers will be excluded.
The service currently blocks ads from this ad server list.
&key=1234ABCD1234ABCD1234ABCD1234ABCDto your urls. You can find your key in your subscription details at Manage Subscription