Skip to content

Latest commit

 

History

History
4606 lines (2789 loc) · 134 KB

File metadata and controls

4606 lines (2789 loc) · 134 KB
id options
title Options Reference
description Options reference for Urlbox website screenshot API
warning DO NOT EDIT THIS FILE, please EDIT src/lib/options.ts instead, this file is auto-generated by src/lib/options.ts

Basic Options

url

The URL of the website you want to screenshot

Examples

url=bbc.co.uk

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/59148a4e454a2c7051488defdb8b246bdea61ace/png?url=bbc.co.uk

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=bbc.co.uk

Example POST request:

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

Example asynchronous 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

image of url=bbc.co.uk example

url=apple.com

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d61624d9b0e0a4ba3cadf90805806c38a6e4518a/png?url=apple.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com

Example POST request:

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

Example asynchronous 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

image of url=apple.com example

url=google.com

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/5ee277f206869517d00cf1951f30d48ef9c64bfe/png?url=google.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=google.com

Example POST request:

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

Example asynchronous 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

image of url=google.com example


html

The HTML you want to render

Example

html=\

Hello World\

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/e11949cc1a5d197179a8b1c363c02849f31da461/png?html=%5C%3Ch1%3EHello%20World%5C%3C%2Fh1%3E

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?html=%5C%3Ch1%3EHello%20World%5C%3C%2Fh1%3E

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"html":"\\<h1>Hello World\\</h1>"}'

Example asynchronous POST request:

curl -X POST \
https://api.urlbox.io/v1/render \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"html":"\\<h1>Hello World\\</h1>"}'

Result

image of html=<h1>Hello World</h1> example


format

The format of the render

The available values are:

png, jpeg, webp, avif, svg, pdf, html, mp4, webm, md.

Examples

format=png

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/277acac44329642f4d79dcda866e39aebd7f677d/png?url=bbc.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=bbc.com

Example POST request:

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

Example asynchronous 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":"png"}'

Result

image of format=png example

format=pdf

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/277acac44329642f4d79dcda866e39aebd7f677d/pdf?url=bbc.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=bbc.com

Example POST request:

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

Example asynchronous 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"}'

Result

image of format=pdf example


width

default: 1280

The viewport width of the browser, in pixels

Examples

width=320

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d27da41701ce087265edabe296bf7d0b65a2084c/png?url=apple.com&width=320

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&width=320

Example POST request:

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

Example asynchronous 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

image of width=320 example

width=768

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/a717eb74fdbcecdb6459d42af6a923e3e0d752d1/png?url=apple.com&width=768

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&width=768

Example POST request:

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

Example asynchronous 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

image of width=768 example

width=1280

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/e1761fa8a549ad7fc56183c0ef65922450c6fb9c/png?url=apple.com&width=1280

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&width=1280

Example POST request:

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

Example asynchronous 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

image of width=1280 example


height

default: 1024

The viewport height of the browser, in pixels

Examples

height=400

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/6edb15cd3b3a80b1cd3fbd3b46661bc1632e7d8a/png?url=apple.com&height=400

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&height=400

Example POST request:

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

Example asynchronous 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

image of height=400 example

height=800

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/9d953dccf0c2cfdbce107f6c53ff8827d8c40f25/png?url=apple.com&height=800

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&height=800

Example POST request:

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

Example asynchronous 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

image of height=800 example

height=1400

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d10c17a92fc129568b52b6e3c615be6a6085aca5/png?url=apple.com&height=1400

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&height=1400

Example POST request:

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

Example asynchronous 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

image of height=1400 example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/75b3076e5292ccd5cdb98a9c06e78bd92b4e2f31/png?url=urlbox.io&full_page=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&full_page=true

Example POST request:

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

Example asynchronous 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

image of full_page=true example


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=#playground

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/0565309e977c0d9dae721e394675aadd37e31682/png?url=urlbox.io&selector=%23playground

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&selector=%23playground

Example POST request:

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

Example asynchronous 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":"#playground"}'

Result

image of selector=#playground example


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


response_type

For GET requests, setting this option to json will change the response type of the Urlbox request to JSON.

The available values are:

json.


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/fa9abef354bc1c00d5a454aef085b2f12fad4e65/png?url=nytimes.com&block_ads=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com&block_ads=true

Example POST request:

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

Example asynchronous 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

image of block_ads=true example

block_ads=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/7c47de5a9d8ebea85dcfe018c4474d9591ec4be3/png?url=nytimes.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com

Example POST request:

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

Example asynchronous 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

image of block_ads=false example


block_urls

Block requests from specific urls from loading

Examples

block_urls=api.urlbox.io

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/ecb438e54bc2ebb504a444da49fb1818fd537a9d/png?url=urlbox.io&block_urls=api.urlbox.io

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&block_urls=api.urlbox.io

Example POST request:

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

Example asynchronous 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","block_urls":"api.urlbox.io"}'

Result

image of block_urls=api.urlbox.io example

Blocking multiple domains and using wildcard

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d477bee088d20393df10c16c0a8bb7eada5a3519/png?url=nytimes.com&block_urls=%2Afacebook%2A&block_urls=%2Afullstory%2A&block_urls=%2Acrisp%2A&block_urls=%2Aintercom%2A&block_urls=%2Agetdrip%2A&block_urls=%2Aolark%2A&block_urls=%2Aoptimizely.com%2A&block_urls=https%3A%2F%2Fshift.com%2Fimages%2F%2A&block_urls=%2Asegment.com%2A&block_urls=%2A.optimizely.com&block_urls=everesttech.net&block_urls=userzoom.com&block_urls=doubleclick.net&block_urls=googleadservices.com&block_urls=adservice.google.com%2F%2A&block_urls=connect.facebook.com&block_urls=connect.facebook.net&block_urls=sp.analytics.yahoo.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com&block_urls=%2Afacebook%2A&block_urls=%2Afullstory%2A&block_urls=%2Acrisp%2A&block_urls=%2Aintercom%2A&block_urls=%2Agetdrip%2A&block_urls=%2Aolark%2A&block_urls=%2Aoptimizely.com%2A&block_urls=https%3A%2F%2Fshift.com%2Fimages%2F%2A&block_urls=%2Asegment.com%2A&block_urls=%2A.optimizely.com&block_urls=everesttech.net&block_urls=userzoom.com&block_urls=doubleclick.net&block_urls=googleadservices.com&block_urls=adservice.google.com%2F%2A&block_urls=connect.facebook.com&block_urls=connect.facebook.net&block_urls=sp.analytics.yahoo.com

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-H 'Authorization: Bearer your-urlbox-secret' \
-H 'Content-Type: application/json' \
-d '{"url":"nytimes.com","block_urls":["*facebook*","*fullstory*","*crisp*","*intercom*","*getdrip*","*olark*","*optimizely.com*","https://shift.com/images/*","*segment.com*","*.optimizely.com","everesttech.net","userzoom.com","doubleclick.net","googleadservices.com","adservice.google.com/*","connect.facebook.com","connect.facebook.net","sp.analytics.yahoo.com"]}'

Example asynchronous 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_urls":["*facebook*","*fullstory*","*crisp*","*intercom*","*getdrip*","*olark*","*optimizely.com*","https://shift.com/images/*","*segment.com*","*.optimizely.com","everesttech.net","userzoom.com","doubleclick.net","googleadservices.com","adservice.google.com/*","connect.facebook.com","connect.facebook.net","sp.analytics.yahoo.com"]}'

Result

image of block_urls=undefined example


hide_cookie_banners

Automatically hides cookie banners from most websites

Examples

hide_cookie_banners=true

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/eb7e742c61d49276028509362a59c695a7d83ce7/png?url=bbc.co.uk&hide_cookie_banners=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=bbc.co.uk&hide_cookie_banners=true

Example POST request:

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

Example asynchronous 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

image of hide_cookie_banners=true example

hide_cookie_banners=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/59148a4e454a2c7051488defdb8b246bdea61ace/png?url=bbc.co.uk

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=bbc.co.uk

Example POST request:

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

Example asynchronous 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

image of hide_cookie_banners=false example


click_accept

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

Examples

click_accept=true

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/6289a7440552e67d274febda3636f51c39e2ffa4/png?url=bbc.co.uk&click_accept=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=bbc.co.uk&click_accept=true

Example POST request:

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

Example asynchronous 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

image of click_accept=true example

click_accept=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/59148a4e454a2c7051488defdb8b246bdea61ace/png?url=bbc.co.uk

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=bbc.co.uk

Example POST request:

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

Example asynchronous 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

image of click_accept=false example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/9b29671653b8187f14deb76bbd1e0d139123a13b/png?url=https%3A%2F%2Fdark-mode-baseline.glitch.me%2F&dark_mode=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fdark-mode-baseline.glitch.me%2F&dark_mode=true

Example POST request:

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

Example asynchronous 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

image of dark_mode=true example

dark_mode=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/709087f3836a65fdd83f9d8e569a2ae3a6d9b736/png?url=https%3A%2F%2Fdark-mode-baseline.glitch.me%2F

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fdark-mode-baseline.glitch.me%2F

Example POST request:

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

Example asynchronous 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

image of dark_mode=false example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/1140e4933928b75bbee948ab103b7e88a643e0ec/png?url=urlbox.io&retina=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&retina=true

Example POST request:

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

Example asynchronous 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

image of retina=true example

retina=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/665935172c589287eb09fbc0cffa78208939941f/png?url=urlbox.io

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io

Example POST request:

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

Example asynchronous 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

image of retina=false example


thumb_width

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

Examples

thumb_width=100

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/f0cc62693ea85d9c5685f4a9a44e827d39d5cbe6/png?url=example.com&thumb_width=100

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&thumb_width=100

Example POST request:

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

Example asynchronous 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

image of thumb_width=100 example

thumb_width=200

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/4fd3b986f19bd418143c9ddeeca264dd32ba2ed7/png?url=example.com&thumb_width=200

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&thumb_width=200

Example POST request:

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

Example asynchronous 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

image of thumb_width=200 example

thumb_width=400

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/63a49589221624368b28015ded7f8299bddc9689/png?url=example.com&thumb_width=400

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&thumb_width=400

Example POST request:

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

Example asynchronous 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

image of thumb_width=400 example


thumb_height

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

Examples

thumb_height=100

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/c203c638e3e9765b4d778095a79497afc467747d/png?url=example.com&thumb_height=100

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&thumb_height=100

Example POST request:

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

Example asynchronous 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

image of thumb_height=100 example

thumb_height=200

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/4edb67595e217b67dfb0530e3161b29c41ddd3f5/png?url=example.com&thumb_height=200

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&thumb_height=200

Example POST request:

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

Example asynchronous 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

image of thumb_height=200 example

thumb_height=400

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/df901178af16380553a57f0a096ee2e5da95bbb8/png?url=example.com&thumb_height=400

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&thumb_height=400

Example POST request:

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

Example asynchronous 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

image of thumb_height=400 example


quality

default: 80

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

Examples

quality=40

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/e72170720d6e4a7b98a56b29e1dd8375d4011799/png?url=spotify.com&quality=40

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=spotify.com&quality=40

Example POST request:

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

Example asynchronous 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

image of quality=40 example

quality=80

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/2c996a1c141db7bfb93b55389ae92632d8ab98a1/png?url=spotify.com&quality=80

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=spotify.com&quality=80

Example POST request:

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

Example asynchronous 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

image of quality=80 example

quality=100

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/7c6b184b3beadda7f6ccaef93da4238f867b1a10/png?url=spotify.com&quality=100

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=spotify.com&quality=100

Example POST request:

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

Example asynchronous 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

image of quality=100 example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/a8240a178fcea7c2473fe8e24b37f304615d416b/png?url=apple.com&download=apple.png

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=apple.com&download=apple.png

Example POST request:

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

Example asynchronous 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

image of download=apple.png example


PDF Options

Options relating to PDF document generation

pdf_page_size

default: A4

Sets the PDF page size.

Setting this option will take precedence over pdf_page_width and pdf_page_height.

The available values are:

A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Ledger, Tabloid.

Examples

pdf_page_size=A0

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/c089868c669aea2090b1d577c53f1860475e3164/pdf?url=example.com&pdf_page_size=A0

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_page_size=A0

Example POST request:

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

Example asynchronous 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

image of pdf_page_size=A0 example

pdf_page_size=A4

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d70c0c52f322d1026912a9476794db90f4641e1e/pdf?url=example.com&pdf_page_size=A4

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_page_size=A4

Example POST request:

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

Example asynchronous 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

image of pdf_page_size=A4 example

pdf_page_size=Letter

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/36fe235e092809916b4f2e5699ebc1f3b999d36c/pdf?url=example.com&pdf_page_size=Letter

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_page_size=Letter

Example POST request:

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

Example asynchronous 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

image of pdf_page_size=Letter example


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 values are:

none, default, minimum.

Examples

pdf_margin=none

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/c218a8130c77103da65620c5c69c97ce67acf434/pdf?url=example.com&pdf_margin=none

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin=none

Example POST request:

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

Example asynchronous 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

image of pdf_margin=none example

pdf_margin=default

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/dabdd091f0abecb6d221dc4d4335886d75ca8ddd/pdf?url=example.com&pdf_margin=default

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin=default

Example POST request:

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

Example asynchronous 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

image of pdf_margin=default example

pdf_margin=minimum

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/4d3250a9c5ffbcbd1181d9132736d209f34255ed/pdf?url=example.com&pdf_margin=minimum

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin=minimum

Example POST request:

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

Example asynchronous 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

image of pdf_margin=minimum example


pdf_margin_top

Sets a custom top margin on the PDF.

Example

pdf_margin_top=40

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/6554dc261a8485c5602210ac060392fdc0dec9ac/pdf?url=example.com&pdf_margin_top=40

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin_top=40

Example POST request:

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

Example asynchronous 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

image of pdf_margin_top=40 example


pdf_margin_right

Sets a custom right margin on the PDF.

Example

pdf_margin_right=100

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/08fa46516c2d447ef67bee88d88fcf77d2cb84bd/pdf?url=example.com&pdf_margin_right=100

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin_right=100

Example POST request:

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

Example asynchronous 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

image of pdf_margin_right=100 example


pdf_margin_bottom

Sets a custom bottom margin on the PDF.

Example

pdf_margin_bottom=50

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/8b22eb20b781cca1d2fbfbb75797b5a75d181d26/pdf?url=example.com&pdf_margin_bottom=50

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin_bottom=50

Example POST request:

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

Example asynchronous 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

image of pdf_margin_bottom=50 example


pdf_margin_left

Set a custom left margin on the PDF.

Example

pdf_margin_left=60

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/99d3dab5829cf0bb04db13861b0edb2a4b481ff0/pdf?url=example.com&pdf_margin_left=60

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_margin_left=60

Example POST request:

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

Example asynchronous 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

image of pdf_margin_left=60 example


pdf_auto_crop

Automatically remove white space from PDF.


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/47aff19c88a87eeec9e00f943c68bd94f5f71ba3/pdf?url=example.com&pdf_scale=0.2

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_scale=0.2

Example POST request:

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

Example asynchronous 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

image of pdf_scale=0.2 example

pdf_scale=1.2

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/ed6142bc72eaae080e355dcc8b1401e917ee9c93/pdf?url=example.com&pdf_scale=1.2

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_scale=1.2

Example POST request:

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

Example asynchronous 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

image of pdf_scale=1.2 example

pdf_scale=2

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/1c6130cae34d07611e12386ea8126e56aba009b1/pdf?url=example.com&pdf_scale=2

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_scale=2

Example POST request:

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

Example asynchronous 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

image of pdf_scale=2 example


pdf_orientation

default: portrait

Sets the orientation of the PDF.

The available values are:

portrait, landscape.

Examples

pdf_orientation=portrait

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/0f14e7117d57a6b326cd5dae583946060b6899e8/pdf?url=example.com&pdf_orientation=portrait

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_orientation=portrait

Example POST request:

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

Example asynchronous 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

image of pdf_orientation=portrait example

pdf_orientation=landscape

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/702e18cf83eb432a9271676ecfbc69ed273e6b28/pdf?url=example.com&pdf_orientation=landscape

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=example.com&pdf_orientation=landscape

Example POST request:

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

Example asynchronous 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

image of pdf_orientation=landscape example


pdf_background

default: true

Sets whether to print background images in the PDF

Examples

pdf_background=true

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/3243ad16a18fbf17329e1e0aee4f9d8de1015110/pdf?url=bbc.com&pdf_background=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=bbc.com&pdf_background=true

Example POST request:

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

Example asynchronous 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

image of pdf_background=true example

pdf_background=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/277acac44329642f4d79dcda866e39aebd7f677d/pdf?url=bbc.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=bbc.com

Example POST request:

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

Example asynchronous 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

image of pdf_background=false example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/157f8d05a0c7515482b32a901eb12075b0086a42/pdf?url=https%3A%2F%2Fkubla.fi%2Fyhteystiedot%2F&disable_ligatures=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=https%3A%2F%2Fkubla.fi%2Fyhteystiedot%2F&disable_ligatures=true

Example POST request:

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

Example asynchronous 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

image of disable_ligatures=true example

disable_ligatures=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/464b2892f6bcce9f4e8387bf69437a54a91bd033/pdf?url=https%3A%2F%2Fkubla.fi%2Fyhteystiedot%2F

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=https%3A%2F%2Fkubla.fi%2Fyhteystiedot%2F

Example POST request:

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

Example asynchronous 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

image of disable_ligatures=false example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/46da7427ec85077ffb1b296418e0b41226a25209/pdf?url=bbc.co.uk&media=screen

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=bbc.co.uk&media=screen

Example POST request:

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

Example asynchronous 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

image of media=screen example

media=print

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/8d92b9f8e0ddb3df8daae7821cc6804d1a7f8355/pdf?url=bbc.co.uk&media=print

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/pdf?url=bbc.co.uk&media=print

Example POST request:

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

Example asynchronous 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

image of media=print example


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, you could do something like unique=${Date.now()} to get a new value for unique each time it is called.


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/8815ef52c20bfdbf2e80389614a7bec2c370119e/png?url=nytimes.com&ttl=86400

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com&ttl=86400

Example POST request:

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

Example asynchronous 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

image of ttl=86400 example

1 week

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/b5b31ce180137db2e9cd0e850ddc3fdc443b90f3/png?url=nytimes.com&ttl=604800

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com&ttl=604800

Example POST request:

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

Example asynchronous 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

image of ttl=604800 example

1 month

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/147bd49d8a6297f79d163469ed0425c4cfff26a6/png?url=nytimes.com&ttl=2592000

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com&ttl=2592000

Example POST request:

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

Example asynchronous 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

image of ttl=2592000 example


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].


header

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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/f21af044899d3f6185e2f5c831f642927f3ed13e/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&header=X-My-Header%3DMyHeaderValue

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&header=X-My-Header%3DMyHeaderValue

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of header=X-My-Header=MyHeaderValue example

Setting multiple headers

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/dee4f57fde5b233c351a163ed7617512b75783fd/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&header=X-Header-1%3DvalueOfHeader1&header=X-Header-2%3DvalueOfHeader2

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&header=X-Header-1%3DvalueOfHeader1&header=X-Header-2%3DvalueOfHeader2

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"]}'

Example asynchronous 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

image of header=undefined example


cookie

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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/442e329408abc1302b9ac42fad8764f5fdbc6319/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&cookie=OptIn%3Dyes

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&cookie=OptIn%3Dyes

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of cookie=OptIn=yes example

Setting multiple cookies

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/1612225ce23701bc66a7588a913926513de6d7d6/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&cookie=OptIn%3Dyes&cookie=BestScreenshots%3Durlbox

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&cookie=OptIn%3Dyes&cookie=BestScreenshots%3Durlbox

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"]}'

Example asynchronous 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

image of cookie=undefined example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/ad5bcdf6a9071129d6b19318e03422d3a79f1ab9/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=random

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=random

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of user_agent=random example

user_agent=mobile

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d93ca172911defd7cd86c9c3b3784d93b7de5c74/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=mobile

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=mobile

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of user_agent=mobile example

user_agent=desktop

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/ac9ac53a8574ac1bdb64e3bea751c1540e5d2422/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=desktop

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=desktop

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of user_agent=desktop example

Google bot

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/13950a1db702e099a8053e9784247d4b77d958fe/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=Googlebot%2F2.1%20%28%2Bhttp%3A%2F%2Fwww.google.com%2Fbot.html%29

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=Googlebot%2F2.1%20%28%2Bhttp%3A%2F%2Fwww.google.com%2Fbot.html%29

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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)"}'

Example asynchronous 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

image of user_agent=Googlebot/2.1 (+http://www.google.com/bot.html) example

Facebook crawler

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/810f8882103ba1684f1f99eaca296cdb89ab7b17/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=facebookexternalhit%2F1.1

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=facebookexternalhit%2F1.1

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of user_agent=facebookexternalhit/1.1 example

Custom

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/8da4b2ed2f8b7317e9e2c000add31e9b6935170a/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=Mozilla%2F5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2011_2_3%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F89.0.4389.90%20Safari%2F537.36

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-is-my-user-agent&block_ads=true&user_agent=Mozilla%2F5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2011_2_3%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F89.0.4389.90%20Safari%2F537.36

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of 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 example


accept_lang

default: en-US

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

Examples

accept_lang=de-CH

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/90a819ac70c4413c818d6c7f49d72cd7098a77c9/png?url=microsoft.com&accept_lang=de-CH

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=microsoft.com&accept_lang=de-CH

Example POST request:

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

Example asynchronous 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

image of accept_lang=de-CH example

accept_lang=ko-KR

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/4039f4ab80731306bf7afc9a652536a9b63c42bc/png?url=microsoft.com&accept_lang=ko-KR

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=microsoft.com&accept_lang=ko-KR

Example POST request:

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

Example asynchronous 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

image of accept_lang=ko-KR example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/745f5ea83e82ecbcf78cc09f204844339af96bf7/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&authorization=Basic%20my_base64_auth_token

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&authorization=Basic%20my_base64_auth_token

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of authorization=Basic my_base64_auth_token example

authorization=Bearer my_bearer_token

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/7392baab4350e6e3302d20c9b953130b8aee7dab/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&authorization=Bearer%20my_bearer_token

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&full_page=true&block_ads=true&authorization=Bearer%20my_bearer_token

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of authorization=Bearer my_bearer_token example


tz

default: UTC

Sets the local timezone to use for the screenshot

Example: tz=Europe/London

Examples

tz=Europe/London

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/0c5666fcf2fd899868be3f1a4435b787a2667747/png?url=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dwhat%2Bis%2Bmy%2Btimezone&tz=Europe%2FLondon

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dwhat%2Bis%2Bmy%2Btimezone&tz=Europe%2FLondon

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of tz=Europe/London example

tz=America/New_York

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/637f052f3a1be9189fb34a8e107561e31a7ee56a/png?url=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dwhat%2Bis%2Bmy%2Btimezone&tz=America%2FNew_York

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dwhat%2Bis%2Bmy%2Btimezone&tz=America%2FNew_York

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of tz=America/New_York example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/82aaf1df38e74245b8d0c68f637f42e1f8373a39/png?url=example.com&wait_until=domloaded

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&wait_until=domloaded

Example POST request:

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

Example asynchronous 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

image of wait_until=domloaded example

wait_until=mostrequestsfinished

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/4ae28194c1c8f1d5e8cb9935d0db53a18eee06a1/png?url=example.com&wait_until=mostrequestsfinished

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&wait_until=mostrequestsfinished

Example POST request:

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

Example asynchronous 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

image of wait_until=mostrequestsfinished example

wait_until=requestsfinished

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/e306da31335b4c3b349a980adc15532f4948056b/png?url=example.com&wait_until=requestsfinished

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&wait_until=requestsfinished

Example POST request:

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

Example asynchronous 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

image of wait_until=requestsfinished example

wait_until=loaded

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/cc08f1746b0f5683d2130835fe8aaef1014958d5/png?url=example.com&wait_until=loaded

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=example.com&wait_until=loaded

Example POST request:

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

Example asynchronous 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

image of wait_until=loaded example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/3f97530c0376dddd06b5fab77c743f0eb7ca7bc0/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds

Example POST request:

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

Example asynchronous 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

image of wait_for= example

wait_for=#loaded_element

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/8ba6c5bce0580470b70a3afe8e4292e5c0f1c1ec/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds&wait_for=%23loaded_element

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds&wait_for=%23loaded_element

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of wait_for=#loaded_element example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/3f97530c0376dddd06b5fab77c743f0eb7ca7bc0/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds

Example POST request:

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

Example asynchronous 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

image of wait_to_leave= example

wait_to_leave=#loading_element

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d496a3b45d66cae433d5cbfba4576cec0e953fc5/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds&wait_to_leave=%23loading_element

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=test-site.urlbox.io%2Floads_in%2F10%2Fseconds&wait_to_leave=%23loading_element

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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"}'

Example asynchronous 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

image of wait_to_leave=#loading_element example


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=#playground

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/c4756b1ccd6d8e2357cee49d7406606dfbf0ae48/png?url=urlbox.io&scroll_to=%23playground

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&scroll_to=%23playground

Example POST request:

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

Example asynchronous 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":"#playground"}'

Result

image of scroll_to=#playground example

scroll_to=1024

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/f4058a258a7bdb421145ffd5651aab5d2937c813/png?url=urlbox.io&scroll_to=1024

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&scroll_to=1024

Example POST request:

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

Example asynchronous 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

image of scroll_to=1024 example

scroll_to=5000

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/6ad6a56bfb9a4540895f19987016283ff712a380/png?url=urlbox.io&scroll_to=5000

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&scroll_to=5000

Example POST request:

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

Example asynchronous 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

image of scroll_to=5000 example


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

Specify 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.

~> Enabling this option will prevent full_page=true and many other options, because having javascript disabled prevents Urlbox from evaluating code inside the page's context.

Examples

disable_js=true

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/d468bc7f9b2ef426cdc23770fa472fab9b13ab61/png?url=nytimes.com&disable_js=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com&disable_js=true

Example POST request:

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

Example asynchronous 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

image of disable_js=true example

disable_js=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/7c47de5a9d8ebea85dcfe018c4474d9591ec4be3/png?url=nytimes.com

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=nytimes.com

Example POST request:

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

Example asynchronous 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

image of disable_js=false example


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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/9b4e567bf2f9cffe5f2f09c4285ff7f027f2e0f7/png?url=urlbox.io&full_page=true&skip_scroll=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&full_page=true&skip_scroll=true

Example POST request:

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

Example asynchronous 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

image of skip_scroll=true example

skip_scroll=false

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/75b3076e5292ccd5cdb98a9c06e78bd92b4e2f31/png?url=urlbox.io&full_page=true

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=urlbox.io&full_page=true

Example POST request:

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

Example asynchronous 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

image of skip_scroll=false example


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

Specify a string to highlight on the page before capturing a screenshot or PDF. To highlight multiple words, separate words with a pipe character e.g. Hello|World


highlightfg

default: white

Specify the text color of the highlighted word


highlightbg

default: red

Specify 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 signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/b34b779559fcea81e39a0d8bf04201405a7a6514/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&longitude=40.7128&latitude=74.006

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&longitude=40.7128&latitude=74.006

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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}'

Example asynchronous 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

image of latitude=74.006 example


longitude

Sets the longitude used to emulate the Geolocation API

Example

longitude=40.7128

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/f202972ec1c027e8d5ad555b73b910ce4f2e2417/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&latitude=74.006&longitude=40.7128

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&latitude=74.006&longitude=40.7128

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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}'

Example asynchronous 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

image of longitude=40.7128 example


accuracy

Sets the accurate of the Geolocation API, in metres

Examples

accuracy=100

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/cc71c05bdd819f87a98f8aa04b8f3f14d2551b7a/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&latitude=74.006&longitude=40.7128&accuracy=100

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&latitude=74.006&longitude=40.7128&accuracy=100

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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}'

Example asynchronous 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

image of accuracy=100 example

accuracy=5000

Example signed URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/c935bc46e918222dab91df6f24c724d909d9e041/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&latitude=74.006&longitude=40.7128&accuracy=5000

Example unsigned URL:

https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/png?url=https%3A%2F%2Fwww.infobyip.com%2Fbrowsergeolocation.php&latitude=74.006&longitude=40.7128&accuracy=5000

Example POST request:

curl -X POST \
https://api.urlbox.io/v1/render/sync \
-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}'

Example asynchronous 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

image of accuracy=5000 example


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.

~> The extension (.png, .jpg or .pdf) will be provided automatically, and should not be included in s3_path.


s3_bucket

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


s3_endpoint

You can change the S3 endpoint URL to use an S3 compatible storage provider e.g. DigitalOcean Spaces, Minio, Wasabi, Cloudflare R2 and more.


s3_region

Sometimes the S3 region is required to be set manually.


cdn_host

If your custom bucket is fronted by a CDN, you can set the host name here.


s3_storageclass

default: standard

Sets the s3 storage class.

The available values 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