OpenLink

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.

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.

On this page