GrabzIt
Tools to Capture and Convert the Web

GrabzIt's JavaScript API ParametersJavaScript API

The GrabzIt JavaScript API allows you to customize your screenshots and captures by specifying different parameters. Listed below are the common parameters that can be found in all captures, followed by parameters relating to just image screenshots, PDF screenshots, table captures and video to animated GIF conversions.

  • format - the format the screenshot/capture should be in.
  • cache - this parameter specifies if the screenshot/capture should be cached or not
    • Default: 1
    • Options:
      • 0 = indicates it will not be cached
      • 1 = indicates it will be cached
  • customwatermarkid - add a custom watermark to the file
    • Default: empty
  • download - this parameter specifies if the capture should downloaded or shown in the web page
    • Default: 0
    • Options:
      • 0 = indicates the capture will be shown in the web page
      • 1 = indicates the capture will be automatically downloaded
  • quality - the quality of the returned file. The default uses the recommended quality for the specified format.
    • Reducing the quality will reduce the filesize and reduce download times.
    • Default: -1
    • Minimum: -1
    • Maximum: 100
  • 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: "UK", "US"
  • filename - override the filename of the downloaded file
    • Only valid where the screenshot/capture is being downloaded
    • Default: empty
  • errorid - add this as a id attribute to the error message span element
    • Default: empty
  • errorclass - add this as a class attribute to the error message span element
    • Default: empty
  • onfinish - the name of the function that should be called after the screenshot has loaded.
    • Default: empty
  • onerror - the name of the function that should be called when a error occurs.
    • Default: empty

Image Only Parameters

These parameters can only be used with image screenshots. A image screenshot can either be displayed at a specified location on the webpage or automatically downloaded when complete, if the download parameter is set.

  • delay - the number of milliseconds to wait before taking the screenshot
    • Default: 0
    • Maximum: 30000
  • bwidth - the width of the browser in pixels
    • Default: 1024
    • Maximum: 10000
  • 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)
  • 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)
  • 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)
  • 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 screenshot, all other parts of the web page are ignored. If there are multiple matching HTML elements the first one is chosen.
    • Default: empty
  • 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
  • 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
  • suppresserrors - suppresses error reporting
    • Only valid where the screenshot result is being downloaded
    • Default: 0
    • Options:
      • 0 = shows any errors
      • 1 = hides any errors
  • displayid - add this as a id attribute to the screenshot image
    • Default: empty
  • displayclass - add this as a class attribute to the screenshot image
    • Default: empty

PDF Only Parameters

These parameters can only be used with a PDF screenshots. PDF screenshots are automatically downloaded when complete.

  • delay - the number of milliseconds to wait before taking the screenshot
    • Default: 0
    • Maximum: 30000
  • background - if true the background of the web page should be included in the screenshot
    • 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
  • pagesize - the page size of the PDF
    • Default: A4
    • Options:
      • A3
      • A4
      • A5
      • A6
      • B3
      • B4
      • B5
      • B6
      • Legal
      • Letter
  • orientation - the orientation of the PDF document
    • Default: Portrait
    • Options:
      • Portrait
      • Landscape
  • includelinks - true if links should be included in the PDF
    • Default: 1
    • Options:
      • 0 = indicates the PDF document should not include links
      • 1 = indicates the PDF document should inlcude links
  • includeoutline - true if the PDF outline 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
  • title - provide a title to the PDF document
    • Default: empty
  • coverurl - the URL of a web page that should be used as a cover page for the PDF
    • Default: empty
  • templateid - add a PDF template ID that specifies the header and footer of the PDF document
    • Default: empty
  • 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
  • mtop - the margin in millimeters that should appear at the top of the PDF document page
    • Default: 10
  • mleft - the margin in millimeters that should appear at the left of the PDF document page
    • Default: 10
  • mbottom - the margin in millimeters that should appear at the bottom of the PDF document page
    • Default: 10
  • mright - the margin in millimeters that should appear at the right of the PDF document
    • Default: 10
  • 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

Table Only Parameters

These parameters can only be used with table captures. Table captures are automatically downloaded when complete.

  • 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
  • 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
  • includealltables - if true all table on the web page will be extracted with each table appearing in a seperate 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
  • target - the id of the only HTML element in the web page that should be used to extract tables from
    • Default: empty
  • requestas - the type of user agent you wish to use
    • Default: 0
    • Options:
      • 0 = indicates the standard version of the website should be used
      • 1 = indicates the mobile version of a website should be used
      • 2 = indicates the search engine view of a website should be used
      • 3 = indicates the fallback version of a website should be used using a user agent of a basic browser

Animation Only Parameters

These parameters can only be used when converting an online video into a animated GIF. Note that animated GIFs can also be made from Vimeo and Youtube video URLs.

  • width - the width of the resulting animated GIF in pixels.
    • Default: 180px
    • Maximum: Maximum width for package
  • height - the height of the resulting animated GIF in pixels.
    • Default: 120px
    • Maximum: Maximum height for package
  • start - the starting position of the video that should be converted into a animated GIF.
    • Default: 0 seconds
  • duration - the length in seconds of the video that should be converted into a animated GIF.
    • Default: maximum length for package
  • speed - the speed of the animated GIF.
    • Default: 1
    • Minimum: 0.2
    • Maximum: 10
  • fps - the number of frames per second that should be captured from the video.
    • Default: 10
    • Minimum: 0.2
    • Maximum: 60
  • 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
  • displayid - add this as a id attribute to the animated gif
    • Default: empty
  • displayclass - add this as a class attribute to the animated gif
    • Default: empty
Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Screenshots
  • Bigger Everything
Start Free Trial