
Link Preview JS
Extract titles, descriptions, images, and other Open Graph link information with link-preview-js.

About Link Preview JS
Link Preview JS is an open source library for extracting link information, such as titles, descriptions, images, and videos, from web pages. It works by fetching a page's HTML, parsing it, and reading the OpenGraph tags. It is published as an npm package and runs on Node.js servers and on mobile runtimes such as React Native and Cordova. The getLinkPreview function accepts a URL or a block of text, and returns data for the first valid HTTP or HTTPS link it finds. The getPreviewFromContent function accepts a response object that has already been fetched.
The library has clear limits. It only returns useful data when the target page has OpenGraph tags, and it will usually fail when the page has none. If a target site redirects to a login page, the preview will parse that login page instead. Some sites redirect to sign-up or consent screens, and developers need to work around those themselves, for example by changing the user-agent header. Browsers block cross-origin requests, so the library cannot run from a web page in a browser. The maintainer warns against fetching content directly from a user's device, because this exposes the device to potentially malicious links.
Key features
- Extracts title, description, images, and videos from OpenGraph tags
- Accepts a URL or text containing a URL and returns data for the first valid link
- Accepts a pre-fetched response object through getPreviewFromContent
- Node.js entry point includes resolveDNSHost SSRF and DNS-rebinding protection
- Mobile entry point supports React Native, Cordova, and other non-Node runtimes
- Mobile entry point has no undici or node:net dependency
- Open source, with source code and a license in the repository
- Separate Node.js and mobile entry points for different runtimes
- Node.js variant includes SSRF and DNS-rebinding protection
- Previews usually fail for pages that have no OpenGraph tags
- Previews fail when a target site redirects to a login page
- Browsers block cross-origin requests, so it cannot run directly from a web page
Link Preview JS at a glance
- Category
- Development › Developer Tools
- Type
- Open-source project
- Pricing
- Not confirmed. Check the site
- Open source
- Yes · Source code
- Language
- English
- Last checked
- Oct 6, 2026 · Online when checked
- Listed
- Oct 5, 2026
Guides for Developer Tools
Link Preview JS alternatives
Tools and sites you could use instead, ranked by how closely they match.
Tesseract provides an open-source OCR engine for extracting text from images, with its main repository hosted on GitHub.
The anneal project is a Go machine learning compiler with graph rewriting, autodiff, and a WebGPU backend.
IWE turns Markdown files into a queryable knowledge graph with editor, command-line, and agent memory tools.
Awesome CLI provides a command-line tool for browsing and exploring Awesome lists.
Images of source code and terminal output can be generated with Freeze.
Jupytext lets users represent Jupyter notebooks as Markdown documents or Julia, Python, and R scripts.
Popular in Developer Tools
Well-known listings from the same topic.
Link Preview JS FAQ
Can this library be called from a page running in a browser?
What happens if a website has no OpenGraph tags?
What happens if a target site redirects to a login page?
Tell us and an editor will check it.
Claim the listing and suggest updates yourself. An editor checks every claim first.













