Tools to Capture and Convert the Web

Take Website Screenshots with our RESTful Screenshot APIREST 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

To get started just select what you want to do from the filter below and the available parameters will be displayed along with a basic example.

When making requests please ensure all parameter values are URL encoded.

    https://api.grabz.it/services/convert.ashx?key=Sign in to view your Application Key&format=&url=https%3A%2F%2Fspacex.com%2F

When converting HTML all parameters must be posted in the request body as key-value pairs. Ensure all parameter values are URL encoded.

    curl 
    -d key=Sign in to view your Application Key 
    -d format= 
    -d html=%3Ch1%3EConvert%20Me%21%3C%2Fh1%3E 
    https://api.grabz.it/services/convert.ashx    

The following additional options are 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.

  • url - the URL to the capture.
    • Required
  • html - the HTML to the convert.
    • Required
    • When converting HTML you must use a HTTP POST.
  • key - your Application Key.
    • Required
  • callback - the URL of the handler GrabzIt should call after it has completed its work.
  • customid - the custom identifier that you can associate with the capture.
    • This will be returned with any callback URL you have specified.
  • format - the format the capture should be in.
    • Default: jpg
    • Options:
      • bmp8
      • bmp16
      • bmp24
      • bmp
      • csv
        • CSV files are automatically downloaded.
      • gif
      • html
        • HTML files are automatically downloaded.
      • jpg
      • json
        • JSON files are automatically downloaded.
      • pdf
        • PDF files are automatically downloaded.
      • docx
        • DOCX files are automatically downloaded.
      • png
      • tiff
      • webp
      • xlsx
        • XLSX files are automatically downloaded.
  • address - the URL to execute the HTML code in. Can be useful if the HTML being converted uses relative URL's to resources such as CSS and images.
    • Default: empty
  • background - if true the background of the web page should be included in the PDF
    • Default: 1
    • Options:
      • 0 = indicates the PDF document should not include the web page background
      • 1 = indicates the PDF document should include the web page background
  • background - if true the background images of the web page should be included in the DOCX
    • Default: 1
    • Options:
      • 0 = indicates the DOCX document should not include the web page background images
      • 1 = indicates the DOCX document should include the web page background images
  • bwidth - the width of the browser in pixels
    • Warning this feature is currently in beta and may not provide consistent results.
    • Default: 1024
    • Maximum: 10000
    • Auto Width: -1 (passing -1 means that the width of the browser matches the width of the document)
  • bheight - the height of the browser in pixels.
    • Default: 768
    • Maximum: 10000
    • Full Length: -1 (passing -1 means that a sceenshot of the whole web page is taken)
  • country - the country the screenshot/capture should be taken from.
    • Warning this feature is currently in beta and may not provide consistent results.
    • Default: The current fastest location
    • Options: "SG", "UK", "US"
  • coverurl - the URL of a web page that should be used as a cover page for the PDF
    • Default: empty
  • customwatermarkid - add a custom watermark to the file
    • Default: empty
  • delay - the number of milliseconds to wait before taking the screenshot
    • Default: 0
    • Maximum: 30000
  • duration - the length in seconds of the video that should be converted into a animated GIF.
    • Default: maximum length for package
  • export - the export URL that specifies where the capture should be exported too.
  • filename - override the filename of the downloaded file
    • Only valid where the screenshot/capture is being downloaded
    • Default: empty
  • fps - the number of frames per second that should be captured from the video.
    • Default: 10
    • Minimum: 0.2
    • Maximum: 60
  • hd - if true the image capture will be in high definition this doubles the size of the image dimensions.
    • Default: 0
    • Options:
      • 0 = create a high definition image
      • 1 = create a high definition image
  • height - the height of the resulting thumbnail in pixels
    • Default: The highest ratio of the browser height possible that fits within the maximum height for the users package
    • Maximum: Maximum height for package
    • Full Height: -1 (passing -1 means that the height of the thumbnail is not reduced)
  • height - the custom height of the resulting document in mm
  • 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 id or class 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
  • mergeid - add the ID of a capture that should be merged at the beginning of the new document
    • Default: empty
  • mtop - the margin in millimeters that should appear at the top of the document page
    • Default: 10
  • mleft - the margin in millimeters that should appear at the left of the document page
    • Default: 10
  • mbottom - the margin in millimeters that should appear at the bottom of the document page
    • Default: 10
  • mright - the margin in millimeters that should appear at the right of the PDF document
    • Default: 10
  • media - the CSS Media Type of the PDF document
    • Default: Print
    • Options:
      • Print
      • Screen
  • noads - if true adverts should be automatically hidden.
    • Default: 0
    • Options:
      • 0 = display adverts
      • 1 = hide adverts
  • nonotify - if true all commonly found cookie notifications should be automatically hidden.
    • Default: 0
    • Options:
      • 0 = display cookie notifications
      • 1 = hide cookie notifications
  • orientation - the orientation of the document
    • Default: Portrait
    • Options:
      • Portrait
      • Landscape
  • pagesize - the page size of the document
    • Default: A4
    • Options:
      • A3
      • A4
      • A5
      • A6
      • B3
      • B4
      • B5
      • B6
      • Legal
      • Letter
  • password - the password to protect the document with
    • Default: empty
  • proxy - the HTTP proxy details the browser software should use to use to create this capture
  • post - any post parameters you want to send.
  • quality - the quality of the capture, JPG and GIF have a default compression of 85% and WEBP 80%. 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
  • 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
      • 3 = indicates the fallback version of a website should be returned using a user agent of a basic browser
  • 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
  • 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 id or class 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 id or class 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
    • Default: empty
  • transparent - if true the image capture should be transparent. This is only compatible with png and tiff images.
    • Default: 0
    • Options:
      • 0 = create a non-transparent image
      • 1 = create a transparent image
  • 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 id or class of a 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: The highest ratio of the browser width possible that fits within the maximum width for the users package
    • Maximum: Maximum width for package
    • Full Width: -1 (passing -1 means that the width of the thumbnail is not reduced)
  • width - the custom width of the resulting document in mm
  • 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)