Skip to main content

Documentation

Generate beautiful Open Graph images in 4 simple steps. No server configuration required.

How It Works

Step 1. Create a Template

Use AI prompting to generate a template, pick from starter templates, or write your own HTML. Add variables like {{title}} for dynamic content.

Step 2. Get Your API Key

Create a public API key (pk_*) for frontend use. It's safe to expose in your HTML since it's rate-limited and domain-restricted.

Step 3. Add to Your Site

Use the generated URL in your og:image meta tag. Pass dynamic data using d_* query parameters.

Step 4. Images Are Cached

Generated images are cached on our global CDN for instant delivery. Use refresh=true with a secret key to regenerate.

Example Meta Tag
<meta property="og:image"
  content="https://core.snappyapi.io/v1/og?token=pk_xxx&template=abc&d_title=Hello" />

Data Flow

Here's how data flows from your website to a generated OG image:

Your Website

OG Image API

Social Cards

When a social platform crawls your page, it fetches the og:image URL. Our API renders your template with the provided data and returns a PNG image cached globally.

URL Parameters

key

API Key

Your public API key (pk_*) for authentication. Required.

template

Template ID

The unique identifier for your template. Find this in your dashboard.

d_*

Dynamic Data

Parameters prefixed with d_ replace template variables. Example: d_title=Hello replaces {{title}}

refresh

Force Regenerate

Set to true with a secret key (sk_*) to regenerate a cached image.

API Key Strategy

pk_* Public Key
  • Safe to use in frontend code
  • Rate-limited per IP
  • Domain restriction available
  • Read-only (no cache refresh)
sk_* Secret Key
  • Server-side only
  • Full API access
  • Can refresh cached images
  • Never expose in client code

Template Variables

Use double curly braces in your template HTML to create dynamic placeholders:

Template HTML
<div class="og-card">
  <h1>{{title}}</h1>
  <p>By {{author}}</p>
  <img src="{{avatar}}" />
</div>
API Request
https://api.rendercore.dev/v1/og
  ?key=pk_xxx
  &template=my-template-id
  &d_title=My%20Blog%20Post
  &d_author=Jane%20Doe
  &d_avatar=https://example.com/jane.jpg

Values are URL-encoded automatically. The API renders your template with the provided values and returns a PNG image.

Quick Tips

Image Dimensions

OG images should be 1200x630 pixels. Our templates are pre-configured to this size.

Caching

Images are cached indefinitely. Use the refresh parameter with sk_* key to update.

Testing

Use the preview feature in your dashboard to test templates before deploying.

Debugging

Check response headers for cache status and any error messages.