canonical: https://jentic.com/apis/linkpreview.net/linkpreview

# LinkPreview API

LinkPreview extracts Open Graph metadata and renders link previews from any URL. Given a target URL, the API returns the page title, description, canonical URL, and a representative image, with optional fields for image dimensions, favicon, locale, and content-safety detection on higher-tier plans. Useful for chat apps, social feeds, bookmarking tools, and any product that needs to render rich previews from arbitrary user-submitted links.

## For AI agents

Generate rich link previews (title, description, image, canonical URL) for any URL so agents can render social-style cards in chat, feeds, or bookmarking flows.

## Scope

Does not handle full article extraction, screenshots, or PDF rendering - use for Open Graph link preview metadata only.

## Capabilities

- Extract Open Graph title, description, image, and canonical URL from any public URL via GET / or POST /
- Return image dimensions and favicon for richer card rendering on higher-tier plans
- Detect content safety flags on URLs to gate user-submitted links before rendering
- Surface page locale to localise preview cards for multilingual feeds
- Authenticate every request with an X-Linkpreview-API-Key header scoped to the account

## Use cases

### Chat Link Unfurling

Render rich preview cards when users paste URLs into a chat or messaging app. The LinkPreview API returns title, description, and a representative image in a single GET / call, letting the chat client display a Slack- or Discord-style unfurl. Most calls return in well under a second for cached URLs, making it suitable for in-message rendering.

Example prompt: Call GET /?q=https://example.com/article and return the title, description, and image fields formatted as a chat card.

### Bookmark and Reading-List Enrichment

Enrich saved bookmarks and reading-list items with title, description, and a thumbnail so users can scan their saved content visually. POST / accepts a JSON body with the target URL and returns the same metadata, which can be persisted alongside the bookmark record. Suitable for products that ingest dozens to thousands of bookmarks per user.

Example prompt: POST / with body {q: 'https://news.example.com/post-1'} and persist the returned title, description, and image fields with the bookmark.

### Social Feed Card Rendering

Render link cards in user-generated social feeds without scraping target pages directly. LinkPreview handles Open Graph, Twitter Card, and oEmbed parsing so the feed product gets a normalised payload regardless of how the source page exposes metadata. Reduces feed-rendering integration time from days to minutes.

Example prompt: For each new feed post, call GET /?q={post.url} and store image, title, and description for card rendering.

### AI Agent Link Summarisation

Let an AI agent summarise a URL's metadata before deciding whether to fetch the full page or hand the link to a user. Through Jentic, the agent searches for the LinkPreview operation, loads the schema, and gets a compact metadata payload it can include in chat replies. This avoids unnecessary full-page fetches while still grounding the response in the page's own description.

Example prompt: Search Jentic for 'get a link preview', load the schema, execute GET / with q=<user URL>, and use the description in the agent's reply.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/` | Get URL preview via query parameter |
| POST | `/` | Get URL preview via JSON body |

## Key resources

- **Preview** — Extract Open Graph metadata via GET / (query) or POST / (JSON body) for any public URL

## Why Jentic

- **Setup:** Wiring LinkPreview by hand means setting up its X-Linkpreview-API-key header auth, attaching it to every request against api.linkpreview.net, and handling your own error and retry logic. Through Jentic you install once, import the LinkPreview API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** LinkPreview takes the target URL in the request rather than as a resource id in the URL path, so limit the agent to the operations it needs, such as fetching preview metadata with GET / or POST /. You choose the operations it may call, so the agent is confined to link-preview reads and nothing more.
- **Credential handling:** Your LinkPreview key is stored once, encrypted, by your own Jentic One instance and injected as the X-Linkpreview-API-key header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get a link preview for a URL', and Jentic returns the matching LinkPreview operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Microlink API** — Link preview and metadata extraction with built-in screenshot and PDF rendering
- **Urlbox API** — Programmatic website screenshot and PDF rendering API
- **ApiFlash API** — Screenshot API for capturing rendered pages from URLs
- **Clearbit API** — Domain and company enrichment that complements URL-level metadata

## FAQ

### What authentication does the LinkPreview API use?

LinkPreview uses API key authentication via the X-Linkpreview-API-Key header. Through Jentic, the key is held in your Jentic One instance and injected at request time so agents never receive the raw key in their context.

### Can I extract images and titles from any URL with LinkPreview?

Yes. GET / returns title, description, image, and canonical URL for any publicly accessible URL by parsing Open Graph, Twitter Card, and oEmbed tags. POST / accepts the same query in a JSON body when you prefer not to put the URL in a query string.

### What are the rate limits for the LinkPreview API?

Rate limits are tiered by plan and are enforced server-side. Free plans are throttled tightly (typically a few requests per minute) while paid plans expand to thousands per day. Build agents to cache previews per URL rather than re-fetching on every render.

### How do I generate a link preview through Jentic?

Run pip install jentic, then search for 'get a link preview' to find GET / on linkpreview.net. Load the schema, supply q=<target URL>, and execute. The returned metadata can be passed straight into a chat card or feed renderer.

### Does LinkPreview support content safety detection?

Higher-tier plans return a content-safety flag alongside the standard metadata, which is useful for moderating user-submitted links before rendering. Check the response for the safety field on each preview and gate rendering accordingly.

### Can I limit what my agent is allowed to do with the LinkPreview API?

Yes. Because Jentic One is self-hosted by you, your own rules decide which LinkPreview operations and credentials the agent may use. The LinkPreview API takes the target URL in the request rather than as a resource id in the path, and it exposes only two read operations, GET / and POST /, so you can allow just the preview-metadata calls your agent needs. That confines the agent to fetching Open Graph title, description, image, and canonical URL, and nothing more.
