Skip to Content

Link preview libraries compared

Compare linkpeek with link-preview-js, open-graph-scraper, metascraper, unfurl.js, and url-metadata by use case, API shape, security, and footprint.

linkpeek does one job: it turns a URL into a typed preview card on the server, and refuses private addresses and unchecked redirects by default. If you need broader scraping, URL detection in free text, fetched oEmbed data or provider-specific rules, one of the other packages here will serve you better.

Comparing two specific packages? The pages for link-preview-js, open-graph-scraper, unfurl.js, url-metadata and metascraper put the measured numbers side by side with linkpeek and show the migration code.

Good fit

PackageGood fitTradeoff versus linkpeek
linkpeekTyped URL previews on Node.js, Bun, Deno, and fetch-based edge runtimesDeliberately not a full article or provider-rule extraction framework
link-preview-jsPreviewing a URL or finding the first URL in textBroader input API; a different result shape and runtime focus
open-graph-scraperNode-oriented Open Graph scraping with broader scraper controlsLarger install tree; edge parse-only users may prefer its separate lite package
metascraperComposable, provider-specific metadata rulesMore setup and dependencies for a much broader extraction framework
unfurl.jsRich nested metadata and fetched oEmbed data in Node.jsArchived upstream as of November 2026; not focused on a small edge-runtime preview path
url-metadataBroad page metadata in Node.jsBroader output and dependency surface than a preview-card utility

This is about fit, not a ranking. The evidence is dated, so check the linked notes before you base an architecture decision on it.

Speed and install size

Measured on November 15, 2026 with the same pages and a local server, so the numbers show library overhead rather than network latency. On large pages linkpeek is fastest because it stops after </head>; on small pages the packages are within about two milliseconds of each other. The benchmarks have every result and the method.

Clean install sizeClean npm install --ignore-scripts of the pinned published version; metascraper includes the same 7 rule packages.
Packagenode_modules
linkpeek
1.3 MB · 7 packages
unfurl.js
3.2 MB · 16 packages
link-preview-js
7.9 MB · 18 packages
url-metadata
10.4 MB · 30 packages
open-graph-scraper
11.1 MB · 27 packages
metascraper
81.1 MB · 128 packages

Result fields

Every package gives you a title, but under a different key. In the versions benchmarked, reading it looks like this:

PackageTypical title accessFetch ownership
linkpeekresult.titlepreview() fetches; parseHTML() parses existing HTML
link-preview-jsresult.titleURL and content APIs
open-graph-scraperresponse.result.ogTitleMain package fetches
metascraperresult.titleYour application supplies HTML
unfurl.jsresult.open_graph?.titleunfurl() fetches
url-metadataresult["og:title"]Main API fetches

URL fetching and security

For a public preview endpoint, parsing is the easy part. What matters is which layer checks an untrusted destination, and every redirect, before the next request goes out.

PackageSecurity consideration as of 15 November 2026
linkpeekBlocks credential-bearing input, common secret headers, private/special-use IP literals, and redirect targets by default. By default it does not resolve hostnames. The opt-in resolveHost checks DNS answers on every hop but does not pin the connection: platform fetch owns DNS, so a hostname that resolves to a private address needs egress controls.
link-preview-jsVersion 6.0.0 resolves each hostname and redirect hop, rejects private results, and pins the connection to the checked addresses in Node.js. Versions through 4.0.0 were affected by CVE-2026-43897.
open-graph-scraperSince 6.13.0 the main package only requests destinations whose resolved addresses are public and checks redirects first, with no opt-out. If you already own the fetch, compare the parse-only open-graph-scraper-lite.
metascraperThe application supplies HTML, so redirect validation, address policy, timeouts, byte limits, and credentials belong to the caller's fetch implementation.
unfurl.jsThe repository is archived; still-open PR #117 documents destination validation proposed after the last published release.
url-metadataThe Node-oriented API exposes request-filtering agent options. Review its current defaults and options against your threat model rather than assuming every runtime has the same network controls.

These are dated notes on how each package works, not security ratings. Whichever you pick, a server-side URL fetcher also benefits from rate limiting, cache controls and platform egress policy.

Migration considerations

import { preview } from "linkpeek";

const result = await preview(url);

if (result.statusCode >= 400) {
	// Render a fallback and skip caching.
}

const card = {
	title: result.title,
	description: result.description,
	image: result.image,
	url: result.canonicalUrl,
};
  • HTTP error pages resolve with their metadata and statusCode; invalid input, blocked targets, timeouts, and network failures throw.

  • Private and special-use addresses are blocked by default. Keep that default for public input and review the documented DNS-resolution limit.

  • Discovered oEmbed endpoints are returned in oEmbedUrl but are not fetched.

  • The default preset scans the head with a 30 kB ceiling. Use presets.quality when body JSON-LD or body-image fallback is worth more work.

  • Keep preview fetching on the server. Browsers block cross-site reads (CORS), and outbound requests to untrusted URLs belong in code you control.

Sources and measurements

The dated comparison notes have the latency on the same corpus, install footprints, competitor versions, known runtime constraints, security sources and the commands to reproduce it all. Rerun them before you quote the numbers later.