Social Preview API - Extract Open Graph & Twitter Card Meta Tags
Fetches a URL and extracts Open Graph tags (og:title, og:description, og:image, og:type, og:site_name), Twitter Card tags (twitter:card, twitter:title, twitter:image, twitter:site, twitter:creator), and general HTML metadata (title, description, canonical, favicon). Returns warnings for missing or malformed tags.
When a user pastes a URL into your app, call this endpoint to fetch the Open Graph data and render a rich link preview card with title, description, and image. Works for Slack-style link unfurling.
SEO auditing for social sharing
Scan your pages to verify Open Graph and Twitter Card tags are present and correctly formatted. Catch missing og:image tags or truncated descriptions before sharing campaigns go live.
Content management system enrichment
When editors add external links to articles, auto-populate the link title, description, and thumbnail from the extracted metadata. Saves manual data entry and keeps preview cards consistent.
Frequently asked questions
What happens if the page has no Open Graph tags?
The og section returns null values for missing tags. The general section falls back to the HTML <title> and <meta name="description"> tags. A warning is added for each missing OG tag.
Does this follow redirects?
Yes. The endpoint follows up to 5 redirects and extracts metadata from the final destination URL.
Can I extract metadata from pages that require JavaScript?
No. The endpoint fetches the raw HTML response. Single-page applications that inject OG tags via JavaScript will return incomplete metadata. Server-rendered pages work correctly.
What are the common warnings returned?
Warnings include missing og:title, missing og:image, og:description longer than 200 characters, missing Twitter Card tags, and og:image URLs that return non-image content types.
Is the og:image URL validated?
The endpoint returns the og:image URL as-is from the HTML. It does not fetch the image to verify it exists or check its dimensions. Use a separate HEAD request to validate the image URL.
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.