Version 1.9.72 (Release Notes)


screencapturehttps://api.pixlab.io/screencapture

Description

Extract a screen capture from a given website URL.

HTTP Methods

GET

Request Parameters

Required

FieldsTypeDescription
urlURLWebsite to extract a screen capture from.
keyStringYour PixLab API Key.
Optional
FieldsTypeDescription
widthIntegerDesired capture width. If this parameter is missing, then the default width is set to 1280px.
heightIntegerDesired capture height. If this parameter is missing, then the default width is set to 1024px.
zoomIntegerZoom factor. A value between 1 .. 10.
exportFile FormatDesired image output format. Only png or jpeg output format are allowed. If this field is missing then png is the default format.
blobBooleanBy default, this command return a JSON object holding the link to the image output. But, if the Blob parameter is set to true then the image binary contents is returned instead.

Response

application/json if the optional blob parameter is not set.

This command return a JSON object after each call only if the optional blob parameter is not set. Otherwise the image binary contents is returned instead. The following are the JSON fields returned in response body:

FieldsTypeDescription
statusIntegerStatus code 200 indicates success, any other code indicates failure.
linkURLLink to the image output (Your screen capture) which is usually stored on the pixlab.xyz storage server unless you set your own S3 keys (refer to your dashboard on how to do that).
idStringUnique image ID.
errorStringError message if status != 200

Python Example

import requests
import json

req = requests.get('https://api.pixlab.io/screencapture',params={'url':'https://github.com','key':'My_PixLab_Key'})
reply = req.json()
if reply['status'] != 200:
	print (reply['error'])
else:
	print ("The screen capture is located on: " + reply['link'])

See Also