Welcome to Link Preview!
An open source API for getting link preview data.
Near perfect results with multiple fallbacks: stealth emulation of a browser & fetching images by search.
API built on Nextjs, but can be easily used in any Node.js enviroment (NOT serverless).
Try it out!
Source code - Github
GET request to /api/link-preview?url=
Requires "url" parameter to fetch link preview.
Optional boolean parameters "stealth", "search", "validate" (all default to true):
- "stealth" - includes stealth browser emulation (longer fetch but very accurate results)
- "search" - includes bing search images (longer fetch but multiple images)
- "validate" - includes "top" image that is validated (longer fetch but ensures image src exists and loads)
Response format
{
success: boolean,
result?: {
siteData?: {
url: string,
title: string,
favicon?: string,
description?: string,
image?: string,
author?: string,
siteName?: string,
largestImage?: string
},
imageSearch?: string,
imageResults?: Array<string>,
topImage?: string
},
error?: any,
errors?: Array<any>
}