Introduction
Extract rich link previews from any URL. Zero dependencies, edge-native, under 5kb.
OpenLink is a modern link preview library built for the edge. Extract Open Graph metadata, favicons, and rich previews from any URL with a simple API.
Quick Start
Get up and running in under a minute
API Reference
Complete reference for all functions
TypeScript
Full type definitions and interfaces
Edge Runtimes
Deploy on Workers, Vercel Edge, Deno
AI Tools
Use with LLMs and AI agents
Caching
Stale-while-revalidate and TTL config
Features
- Zero dependencies - No bloat, just what you need
- Edge native - Works on Cloudflare Workers, Vercel Edge, Deno, Bun
- TypeScript - Full type safety out of the box
- Tiny - Under 5kb gzipped
- Smart caching - Built-in stale-while-revalidate support
Quick Example
import { preview } from "openlink"
const data = await preview("https://github.com")
console.log(data)
// {
// title: "GitHub",
// description: "Where the world builds software",
// image: "https://github.githubassets.com/images/...",
// favicon: "https://github.com/favicon.ico",
// siteName: "GitHub"
// }Hosted API
Don't want to self-host? Use our free API at openlink.sh with built-in caching and no rate limits.
curl "https://openlink.sh/api/preview?url=https://github.com"The hosted API includes intelligent caching, favicon extraction, and returns rich metadata for any URL.