LinkPreview API

⭐ Beginner's Pick Open Data / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

LinkPreview is an API that fetches a summary of any URL including its title, description, and preview image in JSON format. You authenticate with an API key and simply pass the target URL as a parameter. It is ideal for building link unfurlers, social sharing previews, or content aggregators.

💡

Beginner Tip

Pass the URL you want to preview as the q parameter and your API key as the key parameter in the query string. Make sure the target URL is URL-encoded to avoid parsing errors.

Available Data

LinkPreview data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from LinkPreview",
    "description": "Get JSON formatted summary with title, description and preview image for any requested URL",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

title Page title extracted from the og:title or <title> tag.
description Page description from og:description or meta description tag.
image URL of the preview image from the og:image tag.
url The final resolved URL after any redirects.

Implementation Example

const url = "https://www.linkpreview.net/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized API key is missing or incorrect.
Include your API key as the key query parameter: ?key=YOUR_API_KEY.
title and description are empty strings The target page does not have proper meta tags or the content is dynamically rendered by JavaScript.
This is a known limitation for JS-heavy sites; try pages with standard HTML meta tags for best results.
image field is null The target page has no og:image meta tag or accessible image.
Build a fallback in your UI for when the image field is null or an empty string.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Open Data
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →