← DocsMeridian
Recipe
OG image + title generator
Generate social preview images and optimized titles for any URL using Meridian's link preview pipeline.
Overview
This recipe walks through generating Open Graph images and extracting SEO-optimized titles from arbitrary URLs. The pipeline fetches the page, parses meta tags, renders a preview card, and returns a composited image ready for social sharing.
Prerequisites
- Meridian API key with
link:writescope - Node.js 18+ or any HTTP client
- A publicly accessible target URL
Step 1 — Submit URL
POST /api/v1/link-preview
Content-Type: application/json
Authorization: Bearer <api_key>
{
"url": "https://example.com/article",
"width": 1200,
"height": 630
}Step 2 — Poll for result
The endpoint returns a job_id. Poll the status endpoint until the image URL and title are ready.
GET /api/v1/link-preview/<job_id> Authorization: Bearer <api_key>
Step 3 — Use the output
The completed job returns og_image_url,title, anddescription. Drop the image URL into your <meta property="og:image"> tag.
Rate limits
Free tier
10/day
Pro tier
1,000/day