The quickest way to get started with Urlbox is to use the synchronous
To generate your first render, send a
GET request to the following URL:
api-key is replaced with your Urlbox API key, which you can get by registering for an account
format is one of:
options is replaced by a query string that contains all of the options you want to set - for example:
When you send a
GET request in this way, the Urlbox API will return binary data as the response, with the
Content-Type header set to the relevant MIME type for the format requested. For example, if you requested
png format, the
Content-Type will be
image/png and response body will be the actual
PNG binary data.
This means that you can insert the request URL directly into an
<meta> tag, and things should just work.
Urlbox also accepts
HEAD requests, in case you just want to get the response status/headers without pulling down the full response body.
Let's say you want to render a
png screenshot of
google.com thumbnailed down to 300px wide - you could set an
src attribute like so:
<img src="https://api.urlbox.io/v1/api-key/png?url=google.com&thumb_width=300" alt="Urlbox API thumbnail screenshot of google.com" />
and the result would be:
© Urlbox Ltd. 2023. All rights reserved.
Registered in England and Wales.
Company Number: 08267269