Take Website Screenshots with our RESTful Screenshot API
GrabzIt's REST API allows you to captures URL's or HTML entirely using RESTful techniques. Before you start please read the following caveats carefully depending on your use case one of our other API solutions maybe more suitable.
- Some features such as merging and encrypting captures are not available through this REST API. To use these features you will need to use another API Library
- Do not use this API on the client side, it will expose your Application Key! Instead use the JavaScript API
Below is the API URL, that is used for all REST API calls. When converting HTML all parameters must be posted in the request body as key-value pairs. Ensure all parameter values are URL encoded, and the content type is application/x-www-form-urlencoded.
The capture will then be returned in the HTTP response. The following additional options are also available with this type of capture, all of which are optional except for those marked as required. When testing the API functionality we recommend using Postman to simplify the process.
height - the height of the resulting thumbnail in pixels
Default: if both the output width and output height are not specified or 0 then the output width and height will match the final image width and height, if the output width is specified the output height will be proportional to the output width
Maximum: Maximum height for package
Full Height: -1 (passing -1 means that the height of the thumbnail is not reduced)
height - the height of the resulting video in pixels
Default: if not set it will match the browser height
Full Length: -1 (passing -1 means that the page height is equal to the web page)
height - the height of the resulting animated GIF in pixels.
Default: 120px
Maximum: Maximum height for package
Auto-size: -1 (passing -1 means that the height of the animated GIF is scaled in relation to its width, if the height is being auto-sized the width cannot)
hide - the CSS selectors of the one or more HTML elements in the web page to hide, to specify multiple HTML elements to hide seperate each selector with a comma.
Default: empty
includealltables - if true all table on the web page will be extracted with each table appearing in a separate spreadsheet sheet.
Only available with the XLSX format
Default: 0
Options:
0 = indicates all the tables will not be extracted
1 = indicates all the tables will be extracted
includeheadernames - if true header names will be included in the table
Default: 1
Options:
0 = indicates the header names will not be include in the table
1 = indicates the header names will be include in the table
includeimages - if true the images of the web page should be included in the DOCX
Default: 1
Options:
0 = indicates the DOCX document will not include web page images
1 = indicates the DOCX document will include web page images
includelinks - true if links should be included in the document
Default: 1
Options:
0 = indicates the document should not include links
1 = indicates the document should inlcude links
includeoutline - true if PDF bookmarks should be included
Default: 0
Options:
0 = indicates the PDF document will not include a outline
1 = indicates the PDF document will include a outline
quality - the quality of the capture, JPG and WEBP have a default compression of 90% and GIF 85%. This parameter has no effect on BMP, PNG or TIFF images.
Reducing the quality will reduce the filesize and reduce download times.
Default: -1
Minimum: -1
Maximum: 100
repeat - number of times to loop the animated GIF.
Default: 0
Loop Continuously: 0
Never Loop: -1
reverse - if true the frames of the animated GIF are reversed
Default: 0
Options:
0 = indicates the animation will not be reveresed
1 = indicates the animation will be reversed
requestas - the type of user agent you wish to use
Default: 0
Options:
0 = indicates the standard version of the website should be returned
1 = indicates the mobile version of a website should be returned
2 = indicates the search engine view of a website should be returned
speed - the speed of the animated GIF.
Default: 1
Minimum: 0.2
Maximum: 10
start - the starting position of the video that should be converted into a animated GIF.
Default: 0 seconds
start - the starting time in seconds after loading that the video should be captured from.
Default: 0 seconds
tabletoinclude - the index of the table to be converted, were all tables in a web page are ordered from the top of the web page to bottom
Default: 1
target - this parameter specifies the CSS selector of the only HTML element on the target web page that is to be turned into a document, all other parts of the web page are ignored. If there are multiple matching HTML elements the first one is chosen.
Default: empty
target - this parameter specifies the CSS selector of the only HTML element on the target web page that is to be turned into a image, all other parts of the web page are ignored. If there are multiple matching HTML elements the first one is chosen.
Default: empty
target - the id of the only HTML element in the web page that should be used to extract tables from
templateid - add a template ID that specifies the header and footer of the document
Default: empty
title - provide a title to the PDF document
Default: empty
waitfor - this specifies the HTML element, using a CSS selector. Once the element is visible the capture is executed. If there are multiple matching HTML elements the first one is chosen. When this parameter is used it will wait for a maximum of 25 seconds before the capture is performed.
width - the width of the resulting thumbnail in pixels
Default: if both the output width and output height are not specified or 0 then the output width and height will match the final image width and height, if the output height is specified the output width will be proportional to the output height
Maximum: Maximum width for package
Full Width: -1 (passing -1 means that the width of the thumbnail is not reduced)
width - the width of the resulting video in pixels
Default: if not set it will match the browser width
width - the width of the resulting animated GIF in pixels.
Default: 180px
Maximum: Maximum width for package
Auto-size: -1 (passing -1 means that the width of the animated GIF is scaled in relation to its height, if the width is being auto-sized the height cannot)
User Details
Get your current account package, and remaining allowance with this simple call.
repeat - how often in minutes the URL should be checked for a change.
cssselector - the CSS selector that should be used to identify what part of the web page should be monitored.
Specify :root to monitor the whole web page
https://api.grabz.it/monitor?key=Sign in to view your Application Key&url=https://www.astropioneer.blog&email=hello@example.com&repeat=60&cssselector=%23id1
Delete Monitor
To delete a web monitor just specify its ID, along with your application key. You get the ID when creating the monitor from the Add Monitor web method above. On success it will return true in the result attribute.
If there is some issue with the request you have made to the API, a JSON object will be returned explaining the error. The best way to determine this is to check the content type of the response before
processing, if its application/json an error has occurred. The error code found in the JSON follows the standard list of codes.
{
"Result": false,
"Code":"URL is missing",
"Message":100
}