Options Reference

Basic Options

url

The URL of the website you want to screenshot

Examples
url=bbc.co.uk

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk"}'

Result

Downloading image...

url=apple.com

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com"}'

Result

Downloading image...

url=google.com

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"google.com"}'

Result

Downloading image...


width

default: 1280

The viewport width of the browser, in pixels

Examples
width=320

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","width":320}'

Result

Downloading image...

width=768

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","width":768}'

Result

Downloading image...

width=1280

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","width":1280}'

Result

Downloading image...


height

default: 1024

The viewport height of the browser, in pixels

Examples
height=400

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","height":400}'

Result

Downloading image...

height=800

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","height":800}'

Result

Downloading image...

height=1400

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","height":1400}'

Result

Downloading image...


full_page

default: false

Specify whether to capture the full scrollable area of the website. For PDFs, full_page mode will attempt to capture the whole website onto one single page PDF document.

Example
full_page=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","full_page":true}'

Result

Downloading image...


selector

Take a screenshot of the element that matches this selector. By default, if the selector is not found, Urlbox will take a normal viewport screenshot. If you prefer Urlbox to fail the request when the selector is not found, pass fail_if_selector_missing=true.

Example
selector=#trynow

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","selector":"#trynow"}'

Result

Downloading image...


gpu

default: false

Enable GPU acceleration to render 3D scenes and heavy WebGL content. This is a beta feature and requires pre-approval. Please contact support to enable this feature on your account


Blocking Options

Options for blocking or dismissing certain page elements, such as cookie banners

block_ads

Blocks requests from popular advertising networks from loading

Examples
block_ads=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","block_ads":true}'

Result

Downloading image...

block_ads=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","block_ads":false}'

Result

Downloading image...


Automatically hides cookie banners from most websites

Examples
hide_cookie_banners=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk","hide_cookie_banners":true}'

Result

Downloading image...

hide_cookie_banners=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk","hide_cookie_banners":false}'

Result

Downloading image...


click_accept

Automatically clicks 'Accept' buttons, in order to dismiss popups

Examples
click_accept=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk","click_accept":true}'

Result

Downloading image...

click_accept=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk","click_accept":false}'

Result

Downloading image...


hide_selector

Comma-delimited string of CSS element selectors that are hidden by setting their style to display: none !important;. Useful for hiding pop-ups.


Customize Options

Customize the look of the page before rendering a screenshot

js

Inject (and execute) custom JavaScript on the page


css

Inject custom CSS into the page


dark_mode

default: false

Emulate dark mode on websites by setting prefers-color-scheme: dark

Examples
dark_mode=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://dark-mode-baseline.glitch.me/","dark_mode":true}'

Result

Downloading image...

dark_mode=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://dark-mode-baseline.glitch.me/","dark_mode":false}'

Result

Downloading image...


reduced_motion

Prefer less animations on websites by setting prefers-reduced-motion: reduced


Image Options

Options relating to the outputted PNG, WebP or JPEG file

retina

default: false

Take a 'retina' or high-definition screenshot, equivalent to setting a device pixel ratio of 2.0 or @2x. Please note that retina screenshots will be double the normal dimensions and will normally take slightly longer to process due to the much bigger image size.

Examples
retina=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","retina":true}'

Result

Downloading image...

retina=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","retina":false}'

Result

Downloading image...


thumb_width

The width of the generated thumbnail, in pixels. Omit for a full-size screenshot.

Examples
thumb_width=100

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","thumb_width":100}'

Result

Downloading image...

thumb_width=200

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","thumb_width":200}'

Result

Downloading image...

thumb_width=400

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","thumb_width":400}'

Result

Downloading image...


thumb_height

The height of the generated thumbnail, in pixels. Omit for a full-size screenshot.

Examples
thumb_height=100

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","thumb_height":100}'

Result

Downloading image...

thumb_height=200

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","thumb_height":200}'

Result

Downloading image...

thumb_height=400

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","thumb_height":400}'

Result

Downloading image...


quality

default: 80

The image quality of the resulting screenshot (JPEG/WebP only)

Examples
quality=40

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"spotify.com","quality":40}'

Result

Downloading image...

quality=80

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"spotify.com","quality":80}'

Result

Downloading image...

quality=100

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"spotify.com","quality":100}'

Result

Downloading image...


transparent

default: false

If a website has no background color set, the image will have a transparent background (PNG/WebP only)


max_height

For extremely lengthy websites, it may be preferable to limit the screenshot to a maximum height to prevent Urlbox from spending time scrolling and generating an enormous screenshot.


download

Pass in a filename which sets the content-disposition header on the response. E.g. download=myfilename.png This will make the Urlbox link downloadable, and will prompt the user to save the file as myfilename.png

Example
download=apple.png

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"apple.com","download":"apple.png"}'

Result

Downloading image...


PDF Options

Options relating to PDF document generation

pdf_page_size

default: A4

Sets the PDF page size. The available options are

  • A0
  • A1
  • A2
  • A3
  • A4
  • A5
  • A6
  • Legal
  • Letter
  • Ledger
  • Tabloid

Setting this option will take precedence over pdf_page_width and pdf_page_height.

Examples
pdf_page_size=A0

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"format":"pdf","url":"example.com","pdf_page_size":"A0"}'

Result

Downloading image...

pdf_page_size=A4

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"format":"pdf","url":"example.com","pdf_page_size":"A4"}'

Result

Downloading image...

pdf_page_size=Letter

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"format":"pdf","url":"example.com","pdf_page_size":"Letter"}'

Result

Downloading image...


pdf_page_width

Sets the PDF page width, in pixels


pdf_page_height

Sets the PDF page height, in pixels


pdf_margin

default: None

Sets the margin of the PDF document. The available options are

  • none
  • default
  • minimum.
Examples
pdf_margin=none

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin":"none"}'

Result

Downloading image...

pdf_margin=default

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin":"default"}'

Result

Downloading image...

pdf_margin=minimum

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin":"minimum"}'

Result

Downloading image...


pdf_margin_top

Sets a custom top margin on the PDF.

Example
pdf_margin_top=40

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin_top":40}'

Result

Downloading image...


pdf_margin_right

Sets a custom right margin on the PDF.

Example
pdf_margin_right=100

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin_right":100}'

Result

Downloading image...


pdf_margin_bottom

Sets a custom bottom margin on the PDF.

Example
pdf_margin_bottom=50

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin_bottom":50}'

Result

Downloading image...


pdf_margin_left

Set a custom left margin on the PDF.

Example
pdf_margin_left=60

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_margin_left":60}'

Result

Downloading image...


pdf_scale

default: 1

Sets the scale factor of the website content in the PDF. Valid values are numbers between 0.1 and 2

Examples
pdf_scale=0.2

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_scale":0.2}'

Result

Downloading image...

pdf_scale=1.2

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_scale":1.2}'

Result

Downloading image...

pdf_scale=2

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_scale":2}'

Result

Downloading image...


pdf_orientation

default: Portrait

Sets the orientation of the PDF. The available options are

  • portrait
  • landscape
Examples
pdf_orientation=portrait

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_orientation":"portrait"}'

Result

Downloading image...

pdf_orientation=landscape

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","format":"pdf","pdf_orientation":"landscape"}'

Result

Downloading image...


pdf_background

default: true

Sets whether to print background images in the PDF

Examples
pdf_background=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.com","format":"pdf","pdf_background":true}'

Result

Downloading image...

pdf_background=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.com","format":"pdf","pdf_background":false}'

Result

Downloading image...


disable_ligatures

Prevents ligatures from being used. Useful when rendering a PDF, and you want to extract text which contains ligatures.

Examples
disable_ligatures=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://kubla.fi/yhteystiedot/","format":"pdf","disable_ligatures":true}'

Result

Downloading image...

disable_ligatures=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://kubla.fi/yhteystiedot/","format":"pdf","disable_ligatures":false}'

Result

Downloading image...


media

default: print

By default, when generating a PDF, the print CSS media query is used. To generate a PDF using the screen CSS, set this option to screen.

Examples
media=screen

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk","format":"pdf","media":"screen"}'

Result

Downloading image...

media=print

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"bbc.co.uk","format":"pdf","media":"print"}'

Result

Downloading image...


Cache Options

Options to control how Urlbox caches your screenshots or PDF's

force

default: false

Generate a fresh screenshot or PDF, instead of getting a cached version.


unique

Pass a unique string such as a UUID, hash or timestamp, to have more control over when to generate a fresh screenshot or PDF. For example, unique=1641920461949.


ttl

default: 2592000 (30 days - this is also the maximum value)

The duration ('time to live') to keep a screenshot or PDF in the cache, in seconds.

Examples
1 day

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","ttl":86400}'

Result

Downloading image...

1 week

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","ttl":604800}'

Result

Downloading image...

1 month

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","ttl":2592000}'

Result

Downloading image...


Request Options

Options to configure the browser, before navigating to the URL

proxy

Pass in a proxy server address to make screenshot requests via that server in the format [address]:[port].

If proxy authentication is required, you can use the following format: [user]:[password]@[address]:[port].


Set a header on the request when loading the URL

Example: To set the header with key X-My-Header to the value SomeValue, you would pass header=X-My-Header%3DSomeValue.

This can be set multiple times, to set more than one header - e.g. header=X-My-Header%3DSomeValue&header=X-My-Other-Header%3DSomeOtherValue.

As with all options passed via the query string, the header value must be URL encoded - so X-My-Header=SomeValue becomes X-My-Header%3DSomeValue in order to be interpreted correctly by Urlbox.

Examples
header=X-My-Header=MyHeaderValue

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending","full_page":true,"block_ads":true,"header":"X-My-Header=MyHeaderValue"}'

Result

Downloading image...

Setting multiple headers

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending","full_page":true,"block_ads":true,"header":["X-Header-1=valueOfHeader1","X-Header-2=valueOfHeader2"]}'

Result

Downloading image...


Sets a cookie on the request when loading the URL

Example: To set the cookie with key Opt-In to the value yes, you would pass cookie=Opt-In%3Dyes.

This can be set multiple times, to set more than one cookie - e.g.cookie=Opt-In%3Dyes&cookie=Session-Id%3DMTIzNDU.

As with all options passed in the query string, the cookie value must be URL encoded - so OptIn=true becomes OptIn%3Dtrue in order to be interpreted correctly by Urlbox.

Examples
cookie=OptIn=yes

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending","full_page":true,"block_ads":true,"cookie":"OptIn=yes"}'

Result

Downloading image...

Setting multiple cookies

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending","full_page":true,"block_ads":true,"cookie":["OptIn=yes","BestScreenshots=urlbox"]}'

Result

Downloading image...


user_agent

Sets the User-Agent string for the request

The presets are:

  • random - Uses a random user-agent to help avoid bot detection
  • mobile - Uses a 'mobile-like' user-agent string
  • desktop - Uses a 'desktop' user-agent string This can be used in some cases to emulate certain device types, like mobile phones or tablets.
Examples
user_agent=random

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-is-my-user-agent","block_ads":true,"user_agent":"random"}'

Result

Downloading image...

user_agent=mobile

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-is-my-user-agent","block_ads":true,"user_agent":"mobile"}'

Result

Downloading image...

user_agent=desktop

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-is-my-user-agent","block_ads":true,"user_agent":"desktop"}'

Result

Downloading image...

Google bot

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-is-my-user-agent","block_ads":true,"user_agent":"Googlebot/2.1 (+http://www.google.com/bot.html)"}'

Result

Downloading image...

Facebook crawler

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-is-my-user-agent","block_ads":true,"user_agent":"facebookexternalhit/1.1"}'

Result

Downloading image...

Custom

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-is-my-user-agent","block_ads":true,"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"}'

Result

Downloading image...


accept_lang

default: en-US

Sets an Accept-Language header on requests to the target URL

Examples
accept_lang=de-CH

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"microsoft.com","accept_lang":"de-CH"}'

Result

Downloading image...

accept_lang=ko-KR

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"microsoft.com","accept_lang":"ko-KR"}'

Result

Downloading image...


authorization

Sets an Authorization header on requests to the target URL. Can be used to pass an auth token through to the site in order to 'login' before rendering.

Examples
authorization=Basic my_base64_auth_token

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending","full_page":true,"block_ads":true,"authorization":"Basic my_base64_auth_token"}'

Result

Downloading image...

authorization=Bearer my_bearer_token

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending","full_page":true,"block_ads":true,"authorization":"Bearer my_bearer_token"}'

Result

Downloading image...


tz

default: UTC

Sets the local timezone to use for the screenshot

Example: tz=Europe/London

Examples
tz=Europe/London

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.google.com/search?q=what+is+my+timezone","tz":"Europe/London"}'

Result

Downloading image...

tz=America/New_York

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.google.com/search?q=what+is+my+timezone","tz":"America/New_York"}'

Result

Downloading image...


Wait Options

delay

default: 0

The amount of time to wait before Urlbox takes the screenshot or PDF, in milliseconds.


timeout

default: `30000 (30 seconds)`

The amount of time to wait for the requested URL to respond, in milliseconds.


wait_until

Waits until the specified DOM event has fired before taking a screenshot or PDF

The available options are:

  • domloaded (the DOMContentLoaded event is fired)
  • mostrequestsfinished (consider navigation to be finished when there are no more than 2 network connections for at least 500 ms)
  • requestsfinished (there are no more than 0 network connections for at least 500 ms)
  • loaded (the load event is fired)
Examples
wait_until=domloaded

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","wait_until":"domloaded"}'

Result

Downloading image...

wait_until=mostrequestsfinished

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","wait_until":"mostrequestsfinished"}'

Result

Downloading image...

wait_until=requestsfinished

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","wait_until":"requestsfinished"}'

Result

Downloading image...

wait_until=loaded

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"example.com","wait_until":"loaded"}'

Result

Downloading image...


wait_for

Waits for the element specified by this selector to be present in the DOM before taking a screenshot or pdf

By default, Urlbox will take a screenshot or PDF if the wait_for element is not found after waiting for the time specified by the wait_timeout option.

If you prefer Urlbox to fail the request when the wait_for element is not found, pass fail_if_selector_missing=true

Examples
Without wait_for

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"test-site.urlbox.io/loads_in/10/seconds"}'

Result

Downloading image...

wait_for=#loaded_element

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"test-site.urlbox.io/loads_in/10/seconds","wait_for":"#loaded_element"}'

Result

Downloading image...


wait_to_leave

Waits for the element specified by this selector to be absent from the DOM before taking a screenshot or PDF.

A typical use-case would be waiting for loading spinners to be absent before taking a screenshot.

By default, Urlbox will take a screenshot or PDF if the wait_to_leave element is still present after the time specified by the wait_timeout option.

If you prefer Urlbox to fail the request when the wait_to_leave element is still present, pass fail_if_selector_present=true

Examples
Without wait_to_leave

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"test-site.urlbox.io/loads_in/10/seconds"}'

Result

Downloading image...

wait_to_leave=#loading_element

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"test-site.urlbox.io/loads_in/10/seconds","wait_to_leave":"#loading_element"}'

Result

Downloading image...


wait_timeout

default: `30000 (30 seconds)`

The amount of time to wait for the wait_for element to be available before continuing, in milliseconds


Page Options

Options to modify the page state before taking a screenshot or PDF

scroll_to

Scroll, to either an element or to a pixel offset from the top, before taking a screenshot of PDF

Examples
scroll_to=#trynow

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","scroll_to":"#trynow"}'

Result

Downloading image...

scroll_to=1024

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","scroll_to":1024}'

Result

Downloading image...

scroll_to=5000

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","scroll_to":5000}'

Result

Downloading image...


click

Specifies an element selector to click before generating a screenshot or PDF

Example: #clickme would click an element with id="clickme".

Can be used multiple times to simulate multiple sequential click events.

If the selector matches multiple elements, only the first element will be clicked.


click_all

Specifies an element selector to click before generating a screenshot or PDF

Example: .clickme would click all elements with class="clickme".

Can be used multiple times to simulate multiple sequential click events.

If the selector matches multiple elements, all elements will be clicked.


hover

Specifies an element selector to hover over before generating a screenshot or PDF

Example: #hoverme would hover over the element with id="hoverme"


bg_color

Specified a hex code or CSS color string to use as the background color

Some websites don't set a body background colour, and will show up as transparent backgrounds with PNG, or black when using JPG. Use this setting to set a background colour. If the website explicitly sets a transparent background on the html or body elements, this setting will be overridden.


disable_js

default: false

Turns off javascript on the target URL.

Examples
disable_js=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","disable_js":true}'

Result

Downloading image...

disable_js=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","disable_js":false}'

Result

Downloading image...


Full Page Options

Advanced options to control how Urlbox takes full page screenshots, when full_page=true

full_width

default: false

When full_page=true, specify whether to capture the full width of the website, for example if the site is horizontally scrolling.


allow_infinite

By default, when Urlbox detects an infinite scrolling page, it does not attempt to continue scrolling to the bottom, as this could result in infinite scrolling! If you want to override this behaviour, pass true for this option.


skip_scroll

default: false

Enabling skip_scroll will speed up renders by skipping an initial scroll through the page, which is used to trigger any lazy loading elements.

Examples
skip_scroll=true

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","full_page":true,"skip_scroll":true}'

Result

Downloading image...

skip_scroll=false

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"urlbox.io","full_page":true,"skip_scroll":false}'

Result

Downloading image...


detect_full_height

Some pages have full-height backgrounds whose heights are set to 100% of the viewport. This can cause the backgrounds to get stretched when making a full page screenshot. If you are seeing this behaviour in your full page screenshots, pass true for this option.


max_section_height

default: 4096

When Urlbox takes a full_page screenshot, the maximum height of each image section is set to 4096 pixels. If a sites height is greater than this value, Urlbox will start splitting the screenshot into sections. Sometimes it is worthwhile experimenting with this number.


scroll_increment

Sets how many pixels to scroll when scrolling the page to trigger lazy loading elements. By default, the scroll increment is set to the browser viewport height. Some pages' lazy loading elements only trigger when the scroll increment is smaller than this, however, e.g. 400px.


scroll_delay

When Urlbox decides to split a screenshot into multiple sections, the scroll delay is the time to wait between taking the screenshots of each individual section, in milliseconds. While Urlbox does detect animations, and attempts to wait for them before taking a screenshot, this option could be used to force Urlbox to wait for a certain amount of time after scrolling to the next section, to wait for things like animations to finish.


turbo

Warning This is an experimental option. Used to speed up full page screenshots, but at the expense of accuracy.


Highlighting Options

Options for highlighting a given string on the page

highlight

Specified a string to highlight on the page before capturing a screenshot or PDF


highlightfg

default: white

Specified the text color of the highlighted word


highlightbg

default: red

Specified the background color of the highlighted word


Geolocation Options

Options for the geolocation API

latitude

Sets the latitude used to emulate the Geolocation API

Example
latitude=74.006

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.infobyip.com/browsergeolocation.php","longitude":40.7128,"latitude":74.006}'

Result

Downloading image...


longitude

Sets the longitude used to emulate the Geolocation API

Example
longitude=40.7128

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.infobyip.com/browsergeolocation.php","latitude":74.006,"longitude":40.7128}'

Result

Downloading image...


accuracy

Sets the accurate of the Geolocation API, in metres

Examples
accuracy=100

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.infobyip.com/browsergeolocation.php","latitude":74.006,"longitude":40.7128,"accuracy":100}'

Result

Downloading image...

accuracy=5000

Example Urlbox GET request:

Example Urlbox POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"https://www.infobyip.com/browsergeolocation.php","latitude":74.006,"longitude":40.7128,"accuracy":5000}'

Result

Downloading image...


Storage Options

Options related to storing the screenshots in Amazon S3

use_s3

default: false

Save the screenshot directly to the S3 bucket configured on your account


s3_path

Sets the S3 path, including subdirectories and the filename, to use when saving the screenshot in your S3 bucket.


s3_bucket

Overrides the configured S3 bucket to use when saving the screenshot.


s3_storageclass

default: standard

Sets the s3 storage class.

The available options are:

  • standard
  • standard_ia
  • reduced_redundancy
  • onezone_ia
  • intelligent_tiering
  • glacier
  • deep_archive
  • outposts

Request Behaviour Options

Options to dictate how Urlbox handles certain scenarios

fail_if_selector_missing

default: false

Fails the request if the elements specified by selector or wait_for options are not found on the page after waiting for wait_timeout.


fail_if_selector_present

default: false

Fails the request if the element specified by wait_to_leave option is found on the page after waiting for wait_timeout.


fail_on_4xx

default: false

If fail_on_4xx=true and the requested URL returns a status code between 400 and 499, Urlbox will fail the request with error code 400 and the message: Failed to render. Requested URL returned a 4xx error code and fail_on_4xx was true


fail_on_5xx

default: false

If fail_on_5xx=true and the requested URL returns a status code between 500 and 599, Urlbox will fail the request with error code 400 and message: Failed to render. Requested URL returned a 5xx error code and fail_on_5xx was true

Was this page helpful?