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

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

LinkPreview data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "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

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.linkpreview.net/?key=YOUR_API_KEY&q=https%3A%2F%2Fwww.github.com";
// 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

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Open Data
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →