Documentation
Render API

Render API - Convert HTML to Image

The render API converts your html or svg string to a PNG image.

Auth

Follow the auth guide to add the required headers and your API key with requests.

Usage

KeyValueHelp
Endpointapi.urlmeta.org/renderShould always be accessed over https
MethodPOST
Bodyhtml or svg string

Query Parameters

KeyValueHelp
formatFormat of the body you're passing. Optional but recommended.optional Either html or svg

Content-type

Important: Always set the Content-Type header to application/xml when making a request to the Render API.

Example

To render an HTML string to an image, you can use the following example.

curl -X POST "https://api.urlmeta.org/render" \
-H "Content-Type: application/xml" \
-H "Authorization: Basic YOUR_AUTH_KEY" \
-d '<h1>Hello, World!</h1>'

Response

The API will always return JSON response. Here's the response schema returned by the Screenshot API.

{
  "result": {
    "status": "OK"
  },
  "rendered": {
    "file": "... URL of the rendered file ..."
  }
}
ℹ️

The rendered.file will only be valid for 5 minutes. After that, you'll have to request a new render. Make sure you store/download it before it expires.