Quickstart
Make your first request in a minute.
Subscribe on RapidAPI1. Get access
Subscribe to the Link Preview API on RapidAPI and use the code snippets on its API page: they include everything your requests need. The examples here show only the paths and parameters, with this base URL:
export BASE_URL="https://link-preview-url-unfurling-open-graph-metadata4.p.rapidapi.com"2. Preview a URL
curl -X POST "$BASE_URL/link-preview/v1/preview" \
-H "content-type: application/json" \
-d '{"url":"https://github.com"}'{
"success": true,
"data": {
"url": "https://github.com/",
"resolvedUrl": "https://github.com/",
"domain": "github.com",
"title": "GitHub · Change is constant. GitHub keeps you ahead.",
"description": "Join the world's most widely adopted, AI-powered developer platform...",
"icon": "https://github.githubassets.com/favicons/favicon.svg",
"image": { "url": "https://images.ctfassets.net/.../OG_image.jpg", "width": 1200, "height": 630, "alt": null, "source": "og:image" },
"type": "website",
"fetch": { "method": "http", "statusCode": 200, "cacheStatus": "miss" }
}
}The response above is shortened. See Response fields for every field.
3. Tune the request
{
"url": "https://example.com/article",
"options": {
"renderJs": "auto",
"includeImages": true,
"includeArticle": true,
"includeStructuredData": false,
"cache": true,
"allowPartial": true
}
}| Option | Default | Meaning |
|---|---|---|
renderJs | auto | When to render the page: auto (only when needed), never, or always. See Page rendering. |
includeImages | true | Include the preview image. |
includeArticle | true | Include author, publishedAt, modifiedAt and article. |
includeStructuredData | false | Add raw Open Graph, Twitter and JSON-LD under structuredData. |
cache | true | Use a cached preview when available. false always fetches fresh. |
allowPartial | true | When a site blocks access, return a partial preview instead of BOT_BLOCKED. |