API Explorer and Code Generator Tool

It is important to test an API to understand the inner workings before implementing it into an application. While the Restpack APIs have always been approachable, we wanted to make it even more convenient for our users to visually test the API parameters, see results and generate working code samples in a single click.

👉 https://restpack.io/console/product/pdf/api-explorer

👉https://restpack.io/console/product/screenshot/api-explorer

API Version 6

A new major release is now available on both our HTML to PDF and Screenshot APIs. The new release is backwards compatible so we urge our users to simply replace their version to v6 from now on.

Improvements

  • width and height parameters on the HTML to PDF API, it is now not necessary. Simply use the pdf_page or pdf_[width|height] parameters for page size customization.PDF page and viewport sizes are now automatically calculated by the API. If you used to set 

  • General performance of the API has been improved in 20% range.

New Features

  • HTML to PDF API now accepts a pdf_author parameter to customize the author metadata of resulting PDF document.pdf_author

  • Now you can choose which pages to be included in your final PDF document. This parameter can contain a single page number or a range in 3-4 format.pdf_page_ranges

  • grayscale: Both APIs can create grayscale documents using grayscale=true parameter now.

  • pdf_encryption: The HTML to PDF API can now generate encrypted PDF documents. The pdf_encryption parameter can either be 40 or 128 which sets the encryption key length. 40 bit encryption will be more compatible while 128 bit files will be more secure. The encrypted file can have a user and/or owner password and also can be customized with several restrictions. Please refer to our docs for further details.

Brand New Console

We now have a brand new user console and API server online, available to all accounts across our products. This change builds on top of countless user feedback we received to make sure everything regarding to your subscription and API usage is as clear and approachable as possible.

You can now obtain more statistics about your API usage in real time, including failed requests and historical data. You can also check each and every API call, detailing the request / response parameters, any errors and metadata received. We believe this will make debugging / integration experience much pleasant.

API Version 5

We have released a major new release on the rendering engine for HTML to PDF API and Screenshot API. It is mostly backwards compatible.

New Features

  • privacy** parameter**: If you set privacy=true on your calls. This ensured that we will not store the resulting document or any immediate render for caching or future use. The captured document will be streamed directly to you and will be discarded. Note that this parameter is not compatible with as that requires us to save and host the resulting document.
  • cache_ttl** parameter**: The new API has caching disabled by default. We have removed the fresh parameter from the earlier versions. Not every call returns a fresh capture. If you wish to cache documents for repeated calls, please set cache_ttl to maximum number of seconds you wish to cache your resulting documents.

Improvements

The new API is faster and more reliable due to architectural changes. In order to minimize the call latency, we made several changes to our pipeline and you should see the results on your API calls.

Upgrade

In order to switch to the new version, you can simply change your API call url to https://restpack.io/api/html2pdf/v5/convert. If you do not need caching, there would be no more changes required.

GDPR Compliance

We have updated our privacy policy to meet the new EU data protection regulation requirements. We have also created a legal agreement promising the protection of all personally identifiable information and sensitive information that we collect and store.

Privacy Policy

Data Processing Agreement

API Version 4

We have released the new major version of our rendering engine for HTML to PDF API and Screenshot API.

V4 is completely backwards compatible and can be used by just changing the API call url to https://restpack.io/api/html2pdf/v4/convert

HTML to PDF API

Features

  • Page Headers and Footers
    One of the most requested features. We now support automatically injecting header and footer templates to generated PDF documents. You can create these segments in full HTML and customize as you wish. It is also possible to insert dynamic data such as page number, document title etc into the headers and footers.
  • Custom Page Sizes
    In addition to pdf_page parameter, now it’s possible to send pdf_width and pdf_height parameters to set up a custom page size.

Changes

  • We used to generate PDFs on CSS media. However, the API now defaults to
    media in order to generate documents as close as to how they look on a browser. You can switch to using setting

Screenshot API

Features

  • Ad / Cookie Warning Blocking
    We have two new options, block_ads and block_cookie_warnings in order to apply blocking rules to the page before conversion.

API Version 3

We have a new and exciting release of the Screenshot API with many improvements, a brand new rendering engine and new features.

In order to switch to the new version you will need to change your API url from v2 to v3, as in https://restpack.io/api/screenshot/v3/capture.

It is mostly backwards compatible so you should be able to switch without any issues.

Faster Rendering: The version 3 of screenshot API is around twice as fast compared to v2.

Better Engine: Our rendering engine now uses the latest Chromium releases, providing better standards compliance.

New Wait Modes: In previous versions the API would wait for the window load event before rendering the screenshot. Now you have an option to wait for network to become idle using wait=network parameter to ensure pages load completely even with a lot of async resources.

Shutter: If you need to control the precise moment of capture, you can use shutter=<css selector> parameter to wait for a DOM element before capture. Combined with js injection, you can control the render time as you wish.

Media Emulation: Now it’s possible to emulate print css media using emulate_media=print parameter if you wish to capture pages in printing mode.

Better Retina: While the previous version had a retina mode, it came with some caveats regarding to retina image loading, now retina=true parameter creates true retina images with device scale factor of 2.

More Metadata: Using the json=true parameter now returns details regarding to the page and server response, as well as the CDN url of the captured image as it always did.

Better Error Reporting: The new API is more transparent regarding to the errors caused by the remote server or on our end. You can work around errors more easily due to this granular error information.

Ability To Capture Error Pages: The previous API would only capture pages with status code of 200-299, now you can override this behavior using allow_failed=true parameter.