Tools to Capture and Convert the Web

GrabzIt Client with Node.js

Node.js API

Description

This class handles all communication with the GrabzIt screenshot web services.

Public Methods

get_result(id)

This method returns the screenshot itself. If nothing is returned then something has gone wrong or the screenshot is not ready yet.

Parameters


url_to_animation(url, options)

Specifiy the URL of the online video that should be converted into a animated GIF.

Parameters

Return Value

void

Animation Options

All of the options available when creating an animated GIF.

Options Example

{
    'width':250,
    'height':250,
    'speed':2
}

url_to_image(url, options)

Specifies the URL that should be converted into a image screenshot.

Parameters

Return Value

void

html_to_image(html, options)

Specifies the HTML that should be converted into a image.

Parameters

Return Value

void

file_to_image(path, options)

Specifies a HTML file that should be converted into a image.

Parameters

Return Value

void

Image Options

All of the options available when creating image captures.

Options Example

{
    'width':500,
    'height':500
}

url_to_video(url, options)

Specifies the URL that should be converted into a video.

Parameters

Return Value

void

html_to_video(html, options)

Specifies the HTML that the video should be captured from.

Parameters

Return Value

void

file_to_video(path, options)

Specifies a HTML file that should be converted into a video.

Parameters

Return Value

void

Video Options

All of the options available when creating a video of a webpage.

Options Example

{
    'duration':5,
    'framesPerSecond':3
}

url_to_rendered_html(url, options)

Specifies the URL that should be converted into rendered HTML.

Parameters

Return Value

void

html_to_rendered_html(html, options)

Specifies the HTML that should be converted into rendered HTML.

Parameters

Return Value

void

file_to_rendered_html(path, options)

Specifies a HTML file that should be converted into rendered HTML.

Parameters

Return Value

void

HTML Options

All of the options available when creating rendered HTML captures.

Options Example

{
    'country':'SG',
    'delay':5000
}

url_to_pdf(url, options)

Specifies the URL that should be converted into a PDF.

Parameters

Return Value

void

html_to_pdf(html, options)

Specifies the HTML that should be converted into a PDF.

Parameters

Return Value

void

file_to_pdf(path, options)

Specifies a HTML file that should be converted into a PDF.

Parameters

Return Value

void

PDF Options

All of the options available when creating PDF captures.

Options Example

{
    'pagesize':'A5',
    'includeLinks':true
}

url_to_docx(url, options)

Specifies the URL that should be converted into a DOCX.

Parameters

Return Value

void

html_to_docx(html, options)

Specifies the HTML that should be converted into a DOCX.

Parameters

Return Value

void

file_to_docx(path, options)

Specifies a HTML file that should be converted into a DOCX.

Parameters

Return Value

void

DOCX Options

All of the options available when creating DOCX captures.

Options Example

{
    'pagesize':'A5',
    'includeLinks':true
}

url_to_table(url, options)

Specifies the URL that the HTML tables should be extracted from.

Parameters

Return Value

void

html_to_table(html, options)

Specifies the HTML that the HTML tables should be extracted from.

Parameters

Return Value

void

file_to_table(path, options)

Specifies a HTML file that the HTML tables should be extracted from.

Parameters

Return Value

void

Table Options

All of the options available when converting HTML tables to CSV, XLSX or JSON.

Options Example

{
    'format':'xlsx',
    'includeHeaderNames':true
}

Using the callBackUrl option is the recommended method of saving a file

save(callBackUrl, oncomplete)

Save the result asynchronously and returns a unique identifier, which can be used to get the screenshot with the get_result method.

Parameters

save_to(saveToFile, oncomplete)

Save the result synchronously without using a callback URL.

Parameters


get_status(id, oncomplete)

Get the current status of a GrabzIt screenshot.

Parameters


get_cookies(domain, oncomplete)

Get all the cookies that GrabzIt is using for a particular domain. This may include user defined cookies as well.

Parameters


set_cookie(name, domain, options, oncomplete)

Sets a new custom cookie on GrabzIt, if the custom cookie has the same name and domain as a global cookie the global cookie is overridden.

This can be useful if a websites functionality is controlled by cookies.

Parameters


delete_cookie(name, domain, oncomplete)

Delete a custom cookie or block a global cookie from being used

Parameters


get_watermarks()

Get all your uploaded custom watermarks

Parameters


get_watermark(identifier, oncomplete)

Return your custom watermark that matches the specified identifier

Parameters


add_watermark(identifier, path, xpos, ypos, oncomplete)

Add a new custom watermark

Parameters


delete_watermark(identifier, oncomplete)

Delete a custom watermark

Parameters


set_local_proxy(value)

This method enables a local proxy server to be used for all requests.

Parameters


use_ssl(value)

Specifies if requests to GrabzIt's API should use SSL

Parameters


create_encryption_key()

Create a cryptographically secure base 64 encryption key, 44 characters long.


decrypt(data, key)

Decrypt an encrypted capture using the provided encryption key.

Parameters


decrypt_file(path, key, oncomplete)

Decrypt an encrypted capture using the provided encryption key.

Parameters


Result Classes

Cookie

Public Variables

Status

The class representing the current status of the screenshot.

Public Variables

WaterMark

This class represents the custom watermarks stored in GrabzIt

Public Variables