Generate a share card for every page
Open Graph image API
Design your share card as HTML, POST it to the screenshot API at 1200×630, and get back a clean PNG: a unique og:image for every page, in one request. Your own fonts and brand render exactly as they do in the browser, and there is no browser of your own to run.
No credit card · 100 free screenshots to start
curl https://api.apiscreenshot.com/v1/screenshot \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"html": "<div style=\"width:1200px;height:630px;display:flex;align-items:center;justify-content:center;font:700 64px sans-serif;background:#0b1020;color:#fff\">Shipping faster with edge screenshots</div>",
"format": "png",
"viewport": { "width": 1200, "height": 630 }
}' \
-o og-image.pngBUY VS BUILD
Building this yourself means…
Doing it in-house is owning a browser fleet and every edge case around it. Here is the work you skip.
- Standing up and patching a headless-browser service just to rasterise a social card.
- Hand-cutting a unique image for every blog post, product or profile that ships.
- Falling back to one generic share image, so every link in the timeline looks identical.
- Wiring a background queue when the card is needed inline, on the request that builds the page.
HOW IT WORKS
One request, the asset back
Same shape every time: send the request, it renders on a managed browser engine, you get the image back to store or serve.
- 01
Send the request
POST your payload to /v1/screenshot with your API key — a URL or your own HTML, plus the options this job needs.
- 02
It renders
A managed browser engine loads the page, waits for it to settle, and captures it — no headless browser of your own to run or scale.
- 03
Get the asset
The response body is the image bytes, synchronously — write them to a file, push them to your bucket, or hand them to a diff. No queue to poll.
THE CALL
The exact request for open graph images
The parameters this job needs, ready to paste. Full reference in the docs.
- Sized for the social card. Set viewport to 1200×630 (the canonical Open Graph size) and the PNG comes back at exactly that frame — no cropping or resizing step.
- From HTML or a live URL. POST the card markup as html for a fully designed image, or pass a url to snapshot a real page — whichever fits how you build the card.
- One inline call. Capture runs synchronously and returns the image bytes, so you can generate the card on the request that builds the page instead of in a background job.
curl https://api.apiscreenshot.com/v1/screenshot \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"html": "<div style=\"width:1200px;height:630px;display:flex;align-items:center;justify-content:center;font:700 64px sans-serif;background:#0b1020;color:#fff\">Shipping faster with edge screenshots</div>",
"format": "png",
"viewport": { "width": 1200, "height": 630 }
}' \
-o og-image.pngWHY IT HOLDS UP
What actually makes this work
The concrete parts: the formats, the edge cases it handles, the way it scales. Nothing here is a number we can't show you.
Pixel-exact at the canonical size
Pass a 1200×630 viewport and the PNG comes back at exactly that frame — no cropping or resizing step before it becomes your og:image.
Your real fonts and brand
The card is your own HTML and CSS rendered by a real browser engine, so web fonts, gradients, inline SVG and your logo come out as they do on a live page.
One synchronous call
Capture returns the image bytes in the response, so you can generate the card on the request that builds the page instead of wiring a background job.
RELATED
Same API, more jobs
The one call behind open graph images powers these too.
Unfurl pasted links into rich cards
Unfurl any pasted URL into a rich preview card with a thumbnail.
View use caseTurn any URL into a preview thumbnail
Turn any URL into a clean preview thumbnail in a single call.
View use caseCapture a whole page, top to bottom
Capture an entire long page, top to bottom, in a single image.
View use caseFAQ
Open Graph images — common questions
- How do I generate an Open Graph image with an API?
- Design the card as HTML/CSS at 1200×630, then POST it to https://api.apiscreenshot.com/v1/screenshot with { "html": "...", "viewport": { "width": 1200, "height": 630 } } and your API key. You get PNG image bytes straight back — upload them to your bucket and point og:image at the URL.
- What size should the Open Graph image be?
- The canonical Open Graph size is 1200×630 pixels. Pass that as the viewport and the returned PNG matches the frame exactly, so the card renders without cropping across the major social and chat previews.
- Can I render the card from a URL instead of HTML?
- Yes — pass a url instead of html and the API snapshots that live page. For a fully designed share card most teams build the markup and pass it as html, but either input returns the same image bytes.
- Can I use my own fonts, logo and brand colours?
- Always — the image is your own HTML/CSS rendered by a real browser engine, so web fonts, gradients, inline SVG and your logo come out exactly as they do in the browser.
- Is my HTML stored on your servers?
- No. The HTML is rendered to produce the image, the bytes are streamed back in the response, and nothing of the card is persisted on our side.
- How fast is it?
- A card capture returns synchronously, fast enough to generate it on the request that builds the page. Most teams still cache the resulting image to their own CDN so the og:image URL stays stable.
Add a share card to every page
One endpoint, the asset back in one call. 100 free screenshots to start, no credit card to begin.
Cancel anytime · no long-term contract