Skip to Content

linkpeek vs open-graph-scraper

Compare linkpeek with open-graph-scraper: speed on large pages, install size, edge runtime support, SSRF defaults, and how to migrate ogs() to preview().

open-graph-scraper is a broad Open Graph and Twitter Card scraper for Node.js with many options. linkpeek does less on purpose: it reads the page head, returns one typed preview-card result and runs on any runtime with fetch.

Measured side by side

Same corpus, same local server, measured on November 15, 2026
Metriclinkpeek 3.0.0open-graph-scraper 6.13.0
500 kB page, median2.76 ms377 ms
Small pages, mean of medians1.25 ms1.94 ms
Clean install size1.3 MB11.1 MB
Packages installed727

open-graph-scraper 6.13 only fetches public addresses, so it cannot reach a local benchmark server. Its numbers are native fetch plus ogs({ html }). See the benchmarks for the method and every package.

Choose open-graph-scraper when

  • You need its breadth of scraped fields and options on Node.js.
  • You want resolved-address checks on Node.js built in: since 6.13 it only requests destinations whose resolved IP addresses are public. linkpeek checks DNS answers on every hop only when you pass resolveHost, and does not pin the connection.
  • You already own the fetch and only need parsing: its maintainers point edge and parse-only users to open-graph-scraper-lite.

Choose linkpeek when

  • You run on Cloudflare Workers, Vercel Edge, Deno or Bun and want fetching, redirect checks and byte limits included.
  • Your users paste links to large pages. linkpeek stops reading after </head>, which is where the gap in the table above comes from.
  • Install size matters: 7 installed packages instead of 27.
  • You want one flat, typed result with null for missing fields instead of arrays of candidates.

Migrate ogs() to preview()

// open-graph-scraper
import ogs from "open-graph-scraper";
const { result } = await ogs({ url });
const card = {
  title: result.ogTitle,
  description: result.ogDescription,
  image: result.ogImage?.[0]?.url,
};

// linkpeek
import { preview } from "linkpeek";
const card = await preview(url);
// card.title, card.description, card.image

linkpeek falls back from Open Graph to Twitter Card, Dublin Core, the document title and JSON-LD on its own, so one field holds the best value. HTTP error pages resolve with their statusCode; check it before caching. The API reference lists every field and error code.

For a public preview endpoint on Node.js, pair linkpeek with outbound network rules, as the security model explains.