screencapturehttps://api.pixlab.io/screencapture
Description
Extract a screen capture from a given website URL.
HTTP Methods
GET
Request Parameters
Required
Fields | Type | Description |
---|---|---|
url | URL | Website to extract a screen capture from. |
key | String | Your PixLab API Key. |
Fields | Type | Description |
---|---|---|
width | Integer | Desired capture width. If this parameter is missing, then the default width is set to 1280px. |
height | Integer | Desired capture height. If this parameter is missing, then the default width is set to 1024px. |
zoom | Integer | Zoom factor. A value between 1 .. 10. |
export | File Format | Desired image output format. Only png or jpeg output format are allowed. If this field is missing then png is the default format. |
blob | Boolean | By 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:
Fields | Type | Description |
---|---|---|
status | Integer | Status code 200 indicates success, any other code indicates failure. |
link | URL | Link 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). |
id | String | Unique image ID. |
error | String | Error 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
nsfw, header, facedetect, ocr