API Introduction

Welcome to version 2 of the CloudBrowser API. The CloudBrowser screenshot and PDF creation service has been exposed to our customers as a standards compliant RESTful API. A joint effort between our community and CloudBrowser has resulted in native API wrappers, bindings, and code snippets in multiple languages. Authentication is as simple as appending your API key to the request URL. Though we provide one of the most flexible rendering APIs. Please get in touch if you need any help at all!

API Status

We strive to achieve 100% reliability and availability. We're only human however, so sometimes we may fall short. For times such as those or for when the API just needs an unavoidable alterations that result in reduction of service, we will make it know through our status page. Click on the email or RSS icon in the top right corner to subscribe for updates on current investigations and future planned interruptions to service. Please keep an eye on our Twitter feed for other service-related announcements.

Sign-up for real time alerts here:
https://status.cloudbrowser-api.com/


API Regions

Our PDF and screen capture APIs are available directly in multiple regions which provides numerous benefits. Each region contains load balancers and API gateway servers in multiple geographically disparate availability zones. This distribution provides inter- and intra- region failover and redundancy allowing your app to stay operational even during major outages. Furthermore, the data processing and optional CDN storage is kept local to that region help to comply with local regulations such as GDPR. Should you require availability in a new geographic location please reach out to our team to make it happen.

Please note that all regions listed below are available from ANYWHERE around the globe with an internet connection, not just from within those regions.
https://services.<region>.v2.cloudbrowser-api.com

Substitute a region code from the table below into the URL above, overwriting the <region> placeholder.

API availability region codes
eu-central-1 Frankfurt, Germany, Europe
eu-west-2 London, United Kingdom, Europe

Exit node IP address discovery & whitelisting

The API makes use of flexible compute resources in multiple regions and availably zones to provide consistent rendering functionality on demand. For this reason, the IP addresses from behind which we access your target resources (e.g. webpages) can change frequently with demand.
We provide the option to force the render server to exit from a set of static and published CloudBrowser IP addresses (via the force_canonical_ip parameter). This will allow you to whitelist our IP addresses for access to your sensitive resources.

This endpoint provides the ability to pragmatically grab an up-to-date public IP address list, segmented per region. The region keys seen here in the demo output will correspond to the availability regions enumerated further up in this documentation.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/nodes?key=YOUR_KEY_HERE
Successful Response Body
{  
   "eu-central-1":[  
      "35.157.170.6",
      "54.93.110.98",
      "3.120.149.86"
   ],
   "eu-west-2":[  
      "3.9.171.147",
      "35.178.186.11"
   ]
}

Authentication

Authentication is performed by the use of an API key appended to the request URL. An example has been provided below to demonstrate the format the URL should take. Once authenticated, each API call will be recorded and displayed within your private API call log. If you have issues with API authentication, please do contact us.

https://services.eu-central-1.v2.cloudbrowser-api.com/?key=YOUR_KEY_HERE

In a realistic request scenario, you would also append other GET parameters such as the source that you would like to render and export.

HTTP Response Codes

The API uses standard HTTP response codes to communicate the result of an API call. We have endeavoured to match the original meaning of the HTTP response code to our adopted meaning; however the meaning may not always be clear. In such an eventuality please use the below table to understand the API response codes you receive.

In general all 2xx will respond with the rendered requested resource. All 4xx and 5xx responses indicate a stopping error, meaning your request was not processed.

HTTP Response Codes
  • Success 200

    The command was processed successfully. Check the response body for your requested resources.

  • Command unknown 400

    The end-point you have sent the request to is not valid (for example, the end point should be /image/capture rather than /nonExistentEndPoint)

  • Unauthorized 401

    The request was not authorised. This can occur when using an incorrect key or if the account has been banned.

  • Billing 402

    The request was refused due to a billing issue with the associated account, for example an unpaid invoice.

  • Command invalid
    405

    The HTTP request method used is not compatible with the selected end-point. This can occur when using POST rather than GET for example.

  • Command malformed 409

    The request has been incorrectly constructed. This can occur when omitting required parameters or providing them in the wrong type.

  • Unprocessable
    422

    Well formatted request however some technical issue is preventing the serving of the request

  • Too many requests
    429

    You have exceeded your allocated concurrent request allowance - please wait and try again.

  • Internal Server Error
    500


    The client did everything correctly, but we've had an internal issue.

Native Libraries

This section provides a list of current opensource native API bindings and libraries to help kick start your development. We fully welcome and support our community in creating pull requests and shaping the future of each library. If you have developed your own code to consume our API please let us know and we can link to it here to share it with the community!

Screenshot / Screencapture API

This end-point performs a render and screen grab of a given URL or raw HTML source and returns the result in your requested format, PNG or JPEG.

Please use the HTTP GET method to communicate with this endpoint.

https://services.eu-central-1.v2.cloudbrowser-api.com/image/capture
Request GET Parameters
source The URL to the webpage to capture OR Base64 encoded HTML. When passing Base64 encoded HTML you must URL encoded the string to avoid transport errors.
output_return_method Specifies the method used to serve the screenshot, currently the following types (i.e. acceptable values to pass) are supported:
Codes:
  • 1 = return a base64 encoded version of the image
  • 2 = return a HTTP link to the image hosted on our servers
Defaults to 1 (a base64 string).
output_file_type The desired file type of the rendered image. Acceptable values are listed below:
  • 1 = JPEG
  • 2 = PNG
Defaults to 1 (JPEG).
force_canonical_ip This option ensures the exit IP address of the rendering agent seen by the target resource is limited to the set of IP addresses returned by the IP exit node discovery endpoint. If this option is turned off no guarantee is made that the exit IP address seen by the target resource is bounded to the published set of IP addresses. The option to use the published exit IP addresses is useful when your organisation controls the target resource and would like to limit public availably to the CloudBrowser servers for security and privacy reasons.
  • 1 = Use any available exit IP address
  • 2 = Limit exit IP address to publicized set
Defaults to 2 (Limit exit IP address to publicized set).
client_width The width of the client used to render the webpage, specified in pixels (only numbers, no need for the 'px' suffix).
Defaults to 1920.
client_height The height of the client used to render the webpage, specified in pixels (only numbers, no need for the 'px' suffix).
Defaults to 1080.
client_touch This parameter controls the type of pointing device the webpage perceives, a standard pointer such as a USB mouse, or a finger for touch screen emulation, such as on tablets and smart phones.
  • 1 = Touch simulation enabled
  • 2 = Touch simulation disabled
Defaults to 2 (touch simulation disabled).
client_scale_factor This setting expects a whole or real number and sets the scale factor of the client.
Defaults to 1.
client_images This setting allows you to block or allow the download and display of external images, does not affect Base64, SVG, or other inline graphics from rendering.
  • 1 = Images enabled
  • 2 = Images disabled
Defaults to 1 (images enabled).
client_js Choose to enable or disable execution of client side JavaScript (ES6, evaluated by V8).
  • 1 = JavaScript enabled
  • 2 = JavaScript disabled
Defaults to 1 (JavaScript enabled).
block_adverts This option will attempt to block the loading of 3rd party adverts and trackers which are notorious for significantly slowing down loading times of webpages.
  • 1 = No blocking
  • 2 = Attempt to block adverts and trackers
Defaults to 2 (blocking adverts and trackers).
client_ua Pass a custom browser user agent string to impersonate any browser or device.
Defaults to one of the most common desktop user agents: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36.
inject_css Supply Base64 encoded custom CSS styles to be evaluated inline on the document. We recommend that you set a capture_timeout (e.g. 250) to allow the new CSS to be rendered. Please ensure you have URL encoded the base64 encoded string.
No Default.
inject_js Supply Base64 encoded custom JavaScript styles to be evaluated inline on the document. We recommend that you set a capture_timeout (e.g. 250) to allow the new JavaScript to be evaluated. Please ensure you have URL encoded the base64 encoded string.
No Default.
capture_quality A number between 1 and 100 (inclusive) that dictates the quality of the screen grab with 100 being best quality. This setting is only available on JPEG exports. PNG Images will always be rendered at the highest quality.
Defaults to 90 (for JPEG, PNG images are never compressed).
capture_region Supply a standard JS query selector to receive a rendered export of just that element and all of its child elements. For example:
  • By ID: #footer
  • By Class: .nav
Defaults to capturing the all visible elements in given view port and page size.
capture_region_padding Specify a padding region in pixels (px) to add a margin around the element specified by the `capture_region` parameter.
Defaults to 5 (5 pixels).
preset_device Emulate a phone or tablet's render environment with our pre-set classes to avoid the need to research and specify all the settings yourself. Settings changed by these profiles included, touch emulation, scale factor, view port height and width, and device orientation. A list of acceptable device names that you may pass to the in this parameter can be found below.
  • "Blackberry PlayBook"
  • "Blackberry PlayBook landscape"
  • "BlackBerry Z30"
  • "BlackBerry Z30 landscape"
  • "Galaxy Note 3"
  • "Galaxy Note 3 landscape"
  • "Galaxy Note II"
  • "Galaxy Note II landscape"
  • "Galaxy S III"
  • "Galaxy S III landscape"
  • "Galaxy S5"
  • "Galaxy S5 landscape"
  • "iPad"
  • "iPad landscape"
  • "iPad Mini"
  • "iPad Mini landscape"
  • "iPad Pro"
  • "iPad Pro landscape"
  • "iPhone 4"
  • "iPhone 4 landscape"
  • "iPhone 5"
  • "iPhone 5 landscape"
  • "iPhone 6"
  • "iPhone 6 landscape"
  • "iPhone 6 Plus"
  • "iPhone 6 Plus landscape"
  • "iPhone 7"
  • "iPhone 7 landscape"
  • "iPhone 7 Plus"
  • "iPhone 7 Plus landscape"
  • "iPhone 8"
  • "iPhone 8 landscape"
  • "iPhone 8 Plus"
  • "iPhone 8 Plus landscape"
  • "iPhone SE"
  • "iPhone SE landscape"
  • "iPhone X"
  • "iPhone X landscape"
  • "iPhone XR"
  • "iPhone XR landscape"
  • "JioPhone 2"
  • "JioPhone 2 landscape"
  • "Kindle Fire HDX"
  • "Kindle Fire HDX landscape"
  • "LG Optimus L70"
  • "LG Optimus L70 landscape"
  • "Microsoft Lumia 550"
  • "Microsoft Lumia 950"
  • "Microsoft Lumia 950 landscape"
  • "Nexus 10"
  • "Nexus 10 landscape"
  • "Nexus 4"
  • "Nexus 4 landscape"
  • "Nexus 5"
  • "Nexus 5 landscape"
  • "Nexus 5X"
  • "Nexus 5X landscape"
  • "Nexus 6"
  • "Nexus 6 landscape"
  • "Nexus 6P"
  • "Nexus 6P landscape"
  • "Nexus 7"
  • "Nexus 7 landscape"
  • "Nokia Lumia 520"
  • "Nokia Lumia 520 landscape"
  • "Nokia N9"
  • "Nokia N9 landscape"
  • "Pixel 2"
  • "Pixel 2 landscape"
  • "Pixel 2 XL"
  • "Pixel 2 XL landscape"
No Default (environment emulates a standard desktop computer).
capture_transparent If enabled a default white background will not be inserted by the rendering engine. Any content on the page without a background colour will be rendered transparent using the alpha channel. This setting is only available on PNG exports.
  • 1 = Transparent render enabled
  • 2 = Transparent render disabled
Defaults to 2 (non-transparent).
capture_full_page When this action is disabled only the above-the-fold content will be captured. Above-the-fold is defined by the box specified by the width & height parameters starting at the top of the page.
  • 1 = Full page render
  • 2 = Above-the-fold render
Defaults to 2 (Above-the-fold render).
capture_force_lazy_load Some webpages only load images when the portion of the page scrolls into view. This can cause issues when taking full page screenshots. Force the loading of such lazy loaded images before capturing the full-page screenshot.
  • 1 = Capture naturally
  • 2 = Force-load lazy loaded images
Defaults to 1 (capture natural page).
capture_timeout The amount of time expressed in seconds to wait before the screenshot is taken after the page and all elements have been loaded, specified in milliseconds (1 second = 1000 milliseconds).
Defaults to 500 milliseconds (0.5 seconds).
capture_close_cookie_notice Attempt to automatically close the visual blight caused by the EU mandated cookie notices, prior to exporting the rendered page. Cookie notice closing is offered on a best effort basis with no guarantee of functionality.
  • 1 = Do not Attempt to close/accept cookie notices
  • 2 = Attempt to close/accept cookie notices
Defaults to 1 (not closing cookie notices).
custom_http_header Pass the custom header you would like the rendering client to send to the target server. This value should be supplied as a string in the format "Header: value".
No Default.
custom_location_lat Specify a custom location defined by latitude and longitude to be reported by the rendering environments HTML5 geolocation API.
No Default.
custom_location_long Specify a custom location defined by latitude and longitude to be reported by the rendering environments HTML5 geolocation API.
No Default.
thumbnail_width If you wish to export a thumbnail shot rather than a full screen capture you must pass a positive integer via this parameter specifying the width of the exported thumbnail. Thumbnails are generated by rendering the source in the original viewport specified (and other settings such as inject JS, custom cookies, and so forth) and then resizing the resulting image to the desired dimensions.
If no values are passed for client_width and client_height they will be set to a multiple of thumbnail_width and thumbnail_height, rather than their current default values.
Thumbnails are not generated by default.
We recommend that the values passed for thumbnail width and height are in the same ratio as viewport width and height to avoid visual distortion of the thumbnail export.
thumbnail_height If you wish to export a thumbnail shot rather than a full screen captures you must pass a positive integer via this parameter specifying the height of the exported thumbnail. Thumbnails are generated by rendering the source in the original viewport specified (and other settings such as inject JS, custom cookies, and so forth) and then resizing the resulting image to the desired dimensions.
If no values are passed for client_width and client_height they will be set to a multiple of thumbnail_width and thumbnail_height, rather than their current default values.
Thumbnails are not generated by default.
We recommend that the values passed for thumbnail width and height are in the same ratio as viewport width and height to avoid visual distortion of the thumbnail export.

URL to Image API

This end-point performs a render and screen capture of your supplied URL and supplies the result in your requested format, PNG or JPEG.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&key=YOUR_KEY_HERE
Succesful Response Body (output_return_method=1)
{
   "base64": "iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAIABJREFUeJzs3Xl4FFXa9/FfJ4QkhCxCgIAigUDYZVM2BUUIguOoIKKyM0IEZGdYnBEYotFHBYQBUUFAGYwCj4OIgAqKKEscmQFGEBBCAAEF2RKUkJDlcMnabp6qS60yFF+vu5Li7N6VOn7rNUpftOVbXt4sX0PAEAAAAAAAAW5VfaAQAAAAAAAACFIYEFAA ... ACANAELAAAAgDQBCwAAAIA0AQsAAACANAELAAAAgDQBCwAAAIC0/wBqRycyXwTWgAAAAABJRU5ErkJggg==",
   "prefix": "data:image/png;base64,"
}
Succesful Response Body (output_return_method=2)
{
   "location": "https://eu-central-1.cloudbrowser-cdn.com/img/53585108-afae-4693-9de5-13b3d220cd8c45cb16ae-0842-4cc8-af63-77708daec9dd.jpeg"
}

HTML to Image API

This end-point performs a render and screen capture of your supplied HTML, pulling all necessary JavaScript and CSS. The API then supplies the result in your requested format, PNG or JPEG.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
Successful Response Body (output_return_method=1)
{
   "base64": "iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAIABJREFUeJzs3Xl4FFXa9/FfJ4QkhCxCgIAigUDYZVM2BUUIguOoIKKyM0IEZGdYnBEYotFHBYQBUUFAGYwCj4OIgAqKKEscmQFGEBBCAAEF2RKUkJDlcMnabp6qS60yFF+vu5Li7N6VOn7rNUpftOVbXt4sX0PAEAAAAAAAAW5VfaAQAAAAAAAACFIYEFAA ... ACANAELAAAAgDQBCwAAAIA0AQsAAACANAELAAAAgDQBCwAAAIC0/wBqRycyXwTWgAAAAABJRU5ErkJggg==",
   "prefix": "data:image/png;base64,"
}
Successful Response Body (output_return_method=2)
{
   "location": "https://eu-central-1.cloudbrowser-cdn.com/img/53585108-afae-4693-9de5-13b3d220cd8c45cb16ae-0842-4cc8-af63-77708daec9dd.png"
}

URL to Thumbnail API

This end-point performs a render and screen capture of your supplied URL and returns the result as a thumbnail image to the dimensions specified.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=http://example.com&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
Successful Response Body (output_return_method=1)
{
   "base64": "iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAIABJREFUeJzs3Xl4FFXa9/FfJ4QkhCxCgIAigUDYZVM2BUUIguOoIKKyM0IEZGdYnBEYotFHBYQBUUFAGYwCj4OIgAqKKEscmQFGEBBCAAEF2RKUkJDlcMnabp6qS60yFF+vu5Li7N6VOn7rNUpftOVbXt4sX0PAEAAAAAAAAW5VfaAQAAAAAAAACFIYEFAA ... ACANAELAAAAgDQBCwAAAIA0AQsAAACANAELAAAAgDQBCwAAAIC0/wBqRycyXwTWgAAAAABJRU5ErkJggg==",
   "prefix": "data:image/png;base64,"
}
Successful Response Body (output_return_method=2)
{
   "location": "https://eu-central-1.cloudbrowser-cdn.com/img/53585108-afae-4693-9de5-13b3d220cd8c45cb16ae-0842-4cc8-af63-77708daec9dd.png"
}

HTML to Thumbnail API

This end-point performs a render and screen capture of your supplied HTML and returns the result as a thumbnail image to the dimensions specified.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/image?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0&thumbnail_width=128&thumbnail_height=128&key=YOUR_KEY_HERE
Successful Response Body (output_return_method=1)
{
   "base64": "iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAIABJREFUeJzs3Xl4FFXa9/FfJ4QkhCxCgIAigUDYZVM2BUUIguOoIKKyM0IEZGdYnBEYotFHBYQBUUFAGYwCj4OIgAqKKEscmQFGEBBCAAEF2RKUkJDlcMnabp6qS60yFF+vu5Li7N6VOn7rNUpftOVbXt4sX0PAEAAAAAAAAW5VfaAQAAAAAAAACFIYEFAA ... ACANAELAAAAgDQBCwAAAIA0AQsAAACANAELAAAAgDQBCwAAAIC0/wBqRycyXwTWgAAAAABJRU5ErkJggg==",
   "prefix": "data:image/png;base64,"
}
Succesful Response Body (output_return_method=2)
{
   "location": "https://eu-central-1.cloudbrowser-cdn.com/img/53585108-afae-4693-9de5-13b3d220cd8c45cb16ae-0842-4cc8-af63-77708daec9dd.png"
}

PDF Export API

This end-point performs a render of your supplied URL or HTML and supplies the result as a PDF document.

Please use the HTTP GET method to communicate with this endpoint.

The contents of the header and footer fields on this end-point can accept inline CSS styles and Base64 encoded images. Please ensure URL encoding is applied to parameter values where necessary.

https://services.eu-central-1.v2.cloudbrowser-api.com/pdf
Request GET Parameters
source The URL to the webpage to capture OR Base64 encoded HTML. When passing Base64 encoded HTML you must URL encoded the string to avoid transport errors.
output_return_method Specifies the method used to serve the PDF, currently the following types (i.e. acceptable values to pass) are supported:
Codes:
  • 1 = return a Base64 encoded version of the PDF
  • 2 = return a HTTP link to the PDF hosted on our servers
Defaults to 1 (a Base64 string).
force_canonical_ip This option ensures the exit IP address of the rendering agent seen by the target resource is limited to the set of IP addresses returned by the IP exit node discovery endpoint. If this option is turned off no guarantee is made that the exit IP address seen by the target resource is bounded to the published set of IP addresses. The option to use the published exit IP addresses is useful when your organisation controls the target resource and would like to limit public availably to the CloudBrowser servers for security and privacy reasons.
  • 1 = Use any available exit IP address
  • 2 = Limit exit IP address to publicized set
Defaults to 2 (Limit exit IP address to publicized set).
client_scale_factor This setting expects a whole or real number and sets the scale factor of the client.
Defaults to 1.
client_images This setting allows you to block or allow the download and display of external images, does not affect Base64, SVG, or other inline graphics from rendering.
  • 1 = Images enabled
  • 2 = Images disabled
Defaults to 1 (images enabled).
client_js Choose to enable or disable execution of client side JavaScript (ES6, evaluated by V8).
  • 1 = JavaScript enabled
  • 2 = JavaScript disabled
Defaults to 1 (JavaScript enabled).
block_adverts This option will attempt to block the loading of 3rd party adverts and trackers which are notorious for significantly slowing down loading times of webpages.
  • 1 = No blocking
  • 2 = Attempt to block adverts and trackers
Defaults to 2 (blocking adverts and trackers).
client_ua Pass a custom browser user agent string to impersonate any browser or device.
Defaults to one of the most common desktop user agents: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36.
client_print_css Force the use of print CSS styles if supplied by the site when rendering the page for export in our remote environment.
  • 1 = Render with the standard CSS (`screen`)
  • 2 = Emulate the print environment (screenshot what you would see on a printed paper, `print`)
Defaults to 2 (using printer friendly CSS styles).
client_landscape Specify the orientation of the rendered document.
  • 1 = Render in landscape mode
  • 2 = Render in portrait mode
Defaults to 2 (delivering the export in portrait mode).
inject_css Supply Base64 encoded custom CSS styles to be evaluated inline on the document. We recommend that you set a capture_timeout (e.g. 250) to allow the new CSS to be rendered. Please ensure you have URL encoded the base64 encoded string.
No Default.
inject_js Supply Base64 encoded custom JavaScript styles to be evaluated inline on the document. We recommend that you set a capture_timeout (e.g. 250) to allow the new JavaScript to be evaluated. Please ensure you have URL encoded the base64 encoded string.
No Default.
capture_force_lazy_load Some webpages only load images when the portion of the page scrolls into view. Force the loading of such lazy loaded images before exporting the PDF.
  • 1 = Capture naturally
  • 2 = Force-load lazy loaded images
Defaults to 1 (capture page naturally).
capture_timeout The amount of time expressed in seconds to wait before the PDF is exported after the page and all elements have been loaded, specified in milliseconds. For example, 1 second = 1000 milliseconds.
Defaults to 500 milliseconds (0.5 seconds).
capture_close_cookie_notice Attempt to automatically close the visual blight caused by the EU mandated cookie notices, prior to exporting the rendered page. Cookie notice closing is offered on a best effort basis with no guarantee of functionality.
  • 1 = Do not Attempt to close/accept cookie notices
  • 2 = Attempt to close/accept cookie notices
Defaults to 1 (not closing cookie notices).
capture_export_format Specify the output PDF file dimensions using pre-set sizes conforming to common size standards - such as A4. When set, this option will override the other width and height parameters or client device emulation.
Only supply string values from the list below.
  • 'Letter' - 8.5in x 11in
  • 'Legal' - 8.5in x 14in
  • 'Tabloid' - 11in x 17in
  • 'Ledger' - 17in x 11in
  • 'A0' - 33.1in x 46.8in
  • 'A1' - 23.4in x 33.1in
  • 'A2' - 16.5in x 23.4in
  • 'A3' - 11.7in x 16.5in
  • 'A4' - 8.27in x 11.7in
  • 'A5' - 5.83in x 8.27in
  • 'A6' - 4.13in x 5.83in
Defaults to A4.
client_width The width of the client used to render the webpage, specified in pixels (only numbers, no need for the 'px' suffix). This will also be the width of the resulting PDF. If specifying this parameter, you must also specify client_height. Setting this parameter will override the setting for capture_export_format.
No default.
client_height The height of the client used to render the webpage, specified in pixels (only numbers, no need for the 'px' suffix). This will also be the width of the resulting PDF. If specifying this parameter, you must also specify client_width. Setting this parameter will override the setting for capture_export_format.
No default.
capture_template_header A template created using HTML to be rendered and displayed as a header on each page. This string can contain only valid HTML mark-up and CSS styles specified using the standard <style> tag. Images can be inserted into the template through the use of Base64 encoding. The entire template (markup, CSS, and any base64 images) must then be encoded using Base64. The final string passed to the parameter must then also be URL encoded. When passing a header template, the `capture_margin_top` parameter must be set to a positive integer equal to the desired height of your header. If no top margin a default of 75px will be supplied to ensure the header template is at least partially visible for debugging purposes. Make use of the following classes on span/div tags to inject dynamic values:
  • date - formatted print date
  • title - document title
  • url - document location
  • pageNumber - current page number
  • totalPages - total pages in the document

Example mark-up string:

                                                         
<style>
.header { font-family: "Segoe UI", Arial, sans-serif; width: 100%; text-align: center; font-size:16px; padding-bottom:10px}

.border-bottom { border-bottom: 1pt solid #eeeeee; }
</style>
<div class="border-bottom header">
	Page <span class="pageNumber"></span> / <span class="totalPages"></span>
</div>
                                                         

Defaults to no header template
capture_template_footer A template created using HTML to be rendered and displayed as a header on each page. This string can contain only valid HTML mark-up and CSS styles specified using the standard <style> tag. Images can be inserted into the template through the use of Base64 encoding. The entire template (mark-up, CSS, and any base64 images) must then be encoded using Base64. The final string passed to the parameter must then also be URL encoded. When passing a footer template, the `capture_margin_bottom` parameter must be set to a positive integer equal to the desired height of your footer. If no top margin a default of 75px will be supplied to ensure the footer template is at least partially visible for debugging purposes. Make use of the following classes on span/div tags to inject dynamic values:
  • date - formatted print date
  • title - document title
  • url - document location
  • pageNumber - current page number
  • totalPages - total pages in the document
Defaults to no footer template
capture_margin_top Specifies the amount of margin/padding on the top of the document. Pass the value in the format {<integer><unit>}, examples for all possible units:
  • 50px - (pixels)
  • 3in - (inches)
  • 5cm - (centimeter)
  • 50mm - (millimeter)
Defaults to 0px
capture_margin_right Specifies the amount of margin/padding to the right of the document. Pass the value in the format {<integer><unit>}, examples for all possible units:
  • 50px - (pixels)
  • 3in - (inches)
  • 5cm - (centimeter)
  • 50mm - (millimeter)
Defaults to 0px
capture_margin_bottom Specifies the amount of margin/padding at the bottom of the document. Pass the value in the format {<integer><unit>}, examples for all possible units:
  • 50px - (pixels)
  • 3in - (inches)
  • 5cm - (centimeter)
  • 50mm - (millimeter)
Defaults to 0px
capture_margin_left Specifies the amount of margin/padding to the left of the document. Pass the value in the format {<integer><unit>}, examples for all possible units:
  • 50px - (pixels)
  • 3in - (inches)
  • 5cm - (centimeter)
  • 50mm - (millimeter)
Defaults to 0px
custom_http_header Pass the custom header you would like the rendering client to send to the target server. This value should be supplied as a string in the format "Header: value".
No Default.

URL to PDF API

This end-point performs a render and PDF export of your supplied source and supplies the result via your selected return method.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=http://example.com&key=YOUR_KEY_HERE
Succesful Response Body (output_return_method=1)
{
   "base64": "iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAIABJREFUeJzs3Xl4FFXa9/FfJ4QkhCxCgIAigUDYZVM2BUUIguOoIKKyM0IEZGdYnBEYotFHBYQBUUFAGYwCj4OIgAqKKEscmQFGEBBCAAEF2RKUkJDlcMnabp6qS60yFF+vu5Li7N6VOn7rNUpftOVbXt4sX0PAEAAAAAAAAW5VfaAQAAAAAAAACFIYEFAA ... ACANAELAAAAgDQBCwAAAIA0AQsAAACANAELAAAAgDQBCwAAAIC0/wBqRycyXwTWgAAAAABJRU5ErkJggg==",
   "prefix": "data:application/pdf;base64,"
}
Successful Response Body (output_return_method=2)
{
   "location": "https://eu-central-1.cloudbrowser-cdn.com/doc/53585108-afae-4693-9de5-13b3d220cd8c45cb16ae-0842-4cc8-af63-77708daec9dd.pdf"
}

HTML to PDF API

This end-point performs a render and PDF export of your supplied source and supplies the result via your selected return method.

Request

https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
https://services.eu-central-1.v2.cloudbrowser-api.com/pdf?source=gICAgICAgICAgcWMuYXN5bmICAgICAMgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICBxYy5zcmMgICAgICAgICA...ICA8L2JvZHk+DQogICAgPC9odG1sPcWMuYXN5bmICAgIg0K&key=YOUR_KEY_HERE
Succesful Response Body (output_return_method=1)
{
   "base64": "iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAIABJREFUeJzs3Xl4FFXa9/FfJ4QkhCxCgIAigUDYZVM2BUUIguOoIKKyM0IEZGdYnBEYotFHBYQBUUFAGYwCj4OIgAqKKEscmQFGEBBCAAEF2RKUkJDlcMnabp6qS60yFF+vu5Li7N6VOn7rNUpftOVbXt4sX0PAEAAAAAAAAW5VfaAQAAAAAAAACFIYEFAA ... ACANAELAAAAgDQBCwAAAIA0AQsAAACANAELAAAAgDQBCwAAAIC0/wBqRycyXwTWgAAAAABJRU5ErkJggg==",
   "prefix": "data:application/pdf;base64,"
}
Successful Response Body (output_return_method=2)
{
   "location": "https://eu-central-1.cloudbrowser-cdn.com/doc/53585108-afae-4693-9de5-13b3d220cd8c45cb16ae-0842-4cc8-af63-77708daec9dd.pdf"
}