Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 2 KB

getting-started.mdx

File metadata and controls

51 lines (32 loc) · 2 KB
id title description
getting-started
Getting Started
Quickly learn how to use Urlbox's URL to PNG rendering API

The quickest way to get started with Urlbox is to use the synchronous GET API.

Request Format

To generate your first render, send a GET request to the following URL:

https://api.urlbox.io/v1/api-key/format?options

Where:

  • api-key is replaced with your Urlbox API key, which you can get by registering for an account

  • format is one of: png jpg jpeg avif webp pdf svg html md webm mp4

  • options is replaced by a query string that contains all of the options you want to set - for example:

    • url=example.com&full_page=true&width=300

Response Format

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 <img> or <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 <img> tag's 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.io API showing a screenshot thumbnail of google.com