Link previews are everywhere: social feeds, chat apps, and CMS platforms. They instantly enrich shared links with titles, images, and descriptions. But building this yourself is harder than it seems.
You could simply fetch the HTML and parse Open Graph tags. But you’ll quickly run into challenges:
Instead of reinventing the wheel, you can rely on a simple API call:
GET https://api.urlpreview.com/v1/preview?url=https://example.com&apiKey=YOUR_API_KEY
The API returns clean JSON:
{
"title": "Example Domain",
"description": "This domain is for use in illustrative examples in documents.",
"image": "https://example.com/og-image.jpg",
"url": "https://example.com"
}
You can render this data into any UI component—cards, embeds, or chat bubbles. Example:
response.title
response.description
response.image
Sign up for a free account and get your API key instantly. No credit card required.