render_html_to_url
Render HTML/CSS to an image and obtain a temporary hosted URL for use in social media, Open Graph tags, or embedding. URL valid for 24 hours.
Instructions
Render HTML (and optional CSS) to an image and return a temporary hosted URL (instead of inline bytes). Supports the same template_id + variables + preset inputs as render_html_to_image. Use this when the caller needs to reference the image elsewhere – Instagram Graph API, OpenGraph meta tags, Slack unfurls, embedding in docs/posts. URL is valid for 24 hours.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | ||
| html | No | ||
| width | No | ||
| format | No | ||
| height | No | ||
| preset | No | Named viewport size: og 1200×630, twitter-card 1200×628, facebook-post 1200×630, linkedin-post 1200×627, instagram-square 1080×1080, instagram-portrait 1080×1350, instagram-story 1080×1920, youtube-thumbnail 1280×720, pinterest-pin 1000×1500. One template, many sizes. Explicit width/height override the preset. | |
| quality | No | ||
| variables | No | Values for {{placeholders}} in the template (or in `html` if provided). Values are HTML-escaped server-side. Missing placeholders render as empty. | |
| background | No | ||
| template_id | No | ID of a template saved in the codetoimage dashboard (Templates page). Use INSTEAD of `html` – the saved HTML/CSS renders with {{placeholders}} filled from `variables`. | |
| transparent | No |