# Link Preview — Open Graph, Twitter Card & URL Metadata (`ponderable_hydrometer/link-preview`) Actor

Link preview and URL metadata scraper: get the Open Graph and Twitter Card title, description, image and site name of any URL, plus canonical URL, favicon, language and theme color. Open Graph extractor and meta tags checker that lists missing tags. No browser, no key.

- **URL**: https://apify.com/ponderable_hydrometer/link-preview.md
- **Developed by:** [Ponderable Hydrometer](https://apify.com/ponderable_hydrometer) (community)
- **Categories:** Developer tools, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Link Preview — Open Graph, Twitter Card & URL Metadata

**What a link looks like when it is shared.** Get the title, description and image that Slack, X, LinkedIn or iMessage will show, straight from the Open Graph and Twitter Card tags, plus the canonical URL, favicon, language and the preview tags a page is missing. It reads the page's HTML directly: no browser, no key.

### What you can do with it

- **Build link previews** (unfurls) for a chat, a CMS, a bookmark manager or a newsletter tool: send a URL, get title, description, image and site name.
- **Check social tags before you publish:** `missingTags` lists the Open Graph and Twitter Card tags a page should add, so you can audit a whole site or a list of landing pages in one run.
- **Collect URL metadata in bulk:** canonical URL, favicon, page language and theme colour for every link on your list.
- **Enrich a list of links** (leads, references, saved articles) with a readable title and a preview image.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `urls` | array | — | Pages to preview. A full URL or a bare domain such as `example.com`. |

Example: `{"urls": ["https://github.com/apify/crawlee", "https://apify.com"]}`

### What you get

One row per URL: `url`, `finalUrl` (after redirects), `httpStatus`, `title`, `description`, `image`, `siteName`, `canonical`, `favicon`, `lang`, `themeColor`, the raw `openGraph` and `twitterCard` tags, and `missingTags`.

`title`, `description` and `image` use the Open Graph value first, then the Twitter Card value, then the plain `<title>` or `<meta name="description">` of the page.

### Output sample

```json
{
  "url": "https://github.com/apify/crawlee",
  "finalUrl": "https://github.com/apify/crawlee",
  "httpStatus": 200,
  "title": "GitHub - apify/crawlee: Crawlee—A web scraping and browser automation library…",
  "description": "Crawlee—A web scraping and browser automation library for Node.js…",
  "image": "https://opengraph.githubassets.com/…/apify/crawlee",
  "siteName": "GitHub",
  "canonical": "https://github.com/apify/crawlee",
  "favicon": "https://github.githubassets.com/favicons/favicon.svg",
  "lang": "en",
  "themeColor": "#1e2327",
  "openGraph": {
    "title": "…",
    "type": "object"
  },
  "twitterCard": {
    "card": "summary_large_image"
  },
  "missingTags": []
}
```

### Use it from the API or an AI agent

Start a run and read the results back in one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/ponderable_hydrometer~link-preview/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://github.com/apify/crawlee"]}'
```

AI agents can call it through the Apify MCP server: `https://mcp.apify.com?tools=ponderable_hydrometer/link-preview`.

### Limits and good to know

- **No JavaScript is run.** Pages are read as plain HTML, so tags that a script adds after load are not seen. Most share bots (Slack, X, LinkedIn, Facebook) do not run JavaScript either, so this is usually the view you want.
- **Only the first 1.5 MB of each page is read.** That is far more than any `<head>` needs.
- **Pages that block automated requests** (login walls, bot protection, HTTP 4xx or 5xx) produce no row and no result fee; the run log says which URL failed and why. If no URL can be read, the run ends as FAILED.
- **`missingTags`** checks four tags: `og:title`, `og:description`, `og:image` and `twitter:card`.
- **Image and favicon URLs are made absolute.** If a page declares no icon, `favicon` falls back to `/favicon.ico` on the same host, which is not verified to exist.
- **Not an oEmbed or video player.** It returns the page's own meta tags, not embed HTML.

### FAQ

**Does it need a browser or an API key?** No. It is a plain HTTP fetch, so runs are fast and cheap.

**What if a page has no Open Graph tags?** The row still comes back, with the fallback `title` and `description` from the page and the missing tags listed in `missingTags`.

**Can I send hundreds of URLs?** Yes. URLs are read one after another; duplicates are removed first.

### Pricing

Pay per result — **$0.50 per 1,000 results** (one URL = one result), plus Apify's standard per-run start event ($0.00005 per GB of memory, so a fraction of a cent per run). No subscription.

# Actor input Schema

## `urls` (type: `array`):

Pages to preview.

## Actor input object example

```json
{
  "urls": [
    "https://github.com/apify/crawlee",
    "https://www.bbc.com/news",
    "https://apify.com"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

All rows produced by this run, as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://github.com/apify/crawlee",
        "https://www.bbc.com/news",
        "https://apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ponderable_hydrometer/link-preview").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": [
        "https://github.com/apify/crawlee",
        "https://www.bbc.com/news",
        "https://apify.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ponderable_hydrometer/link-preview").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://github.com/apify/crawlee",
    "https://www.bbc.com/news",
    "https://apify.com"
  ]
}' |
apify call ponderable_hydrometer/link-preview --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ponderable_hydrometer/link-preview"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/D3dD0s2A4rXoqmCeM/builds/bbmqenBXLpdpZCDAV/openapi.json
