GET /api/og/check
Edge-runtime image endpoint. Renders a 1200×630 PNG suitable for <meta property="og:image"> — branded, legible, and based on whatever data you pass.
When someone shares an OrangeCheck proof URL on Nostr, Twitter, Discord, or Slack, this endpoint is what produces the rich preview card.
GET https://ochk.io/api/og/check?addr=bc1q...&sats=125000&days=47
Query parameters
| Param | Type | Notes |
|---|---|---|
addr | string | Bitcoin address. Shown truncated. |
id | string | Attestation ID. Used when addr not supplied. |
sats | int | Sats bonded. Renders a "Bonded" column when present. |
days | int | Days unspent. Renders an "Unspent" column when present. |
All parameters are optional; the card degrades gracefully.
Output
- Format: PNG, 1200×630
- Content-Type:
image/png - Cache-Control:
public, max-age=300, s-maxage=300 - Runtime: Edge (satori-based)
Examples
Inline HTML
<meta property="og:image"
content="https://ochk.io/api/og/check?addr=bc1q...&sats=125000&days=47">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
Next.js SEO component
<Seo
title="My OrangeCheck proof"
description="..."
ogImage={`https://ochk.io/api/og/check?addr=${addr}&sats=${sats}&days=${days}`}
/>
As a badge on any page
<img
src="https://ochk.io/api/og/check?addr=bc1q..."
alt="OrangeCheck proof"
width="600"
/>
Behavior notes
- Runs on the Edge. First request compiles the image on satori; subsequent requests within the cache window return immediately.
- No data fetching. The endpoint renders the parameters you give it — it does NOT query Nostr or chain state. Pass real values from wherever you have them (e.g. a
/api/checkcall, or the signed message'sbond:extension). - Missing metrics. If
satsanddaysare omitted, the card shows only the address/ID and branding.
Customization
This endpoint renders the OrangeCheck-branded card. For a custom-styled badge that matches your own site, use the @orangecheck/react package's <OcBadge> component client-side.
Status codes
| HTTP | Meaning |
|---|---|
200 | PNG rendered. |
500 | Render failed. |
Rate limits are generous (edge-cached) and not separately enforced.