# URL Metadata & Link Preview API (no key) (`synthetic.ia/url-metadata-preview`) Actor

Extract OpenGraph, Twitter Card and standard meta (title, description, image, favicon, canonical, JSON-LD) for a link preview, and list a page's internal/external links and images. fetch + HTML parse, no browser, no key. Pay per query.

- **URL**: https://apify.com/synthetic.ia/url-metadata-preview.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 extracts

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## URL Metadata & Link Preview API (no key)

Turn any URL into a clean **link preview** — behind a simple HTTP API (and MCP tool). Extract **OpenGraph**, **Twitter Card** and standard **meta** (title, description, image, site name, favicon, canonical, theme color, language, JSON-LD), or list a page's **internal / external links and images**. No browser, no key — just fast HTML parsing. Pay per query.

- 🔗 **Link preview** — title, description, preview image, favicon, site name, type, canonical URL, `article:published_time`, JSON-LD structured data.
- 🗂️ **Links & images** — every link on a page, resolved to absolute URLs, deduped and split into internal vs external, plus image URLs and counts.
- 🛡️ **Safe by design** — only public http(s) URLs; localhost, private, link-local and cloud-metadata addresses are refused.
- ⚡ **No browser** — plain fetch + Cheerio: fast and cheap.
- 💵 Pay per query.

### The use case it was built for

Build rich link cards for a chat app or CMS, prefill an "unfurl" preview, audit a page's outbound links, or hand your agent a clean summary of what's at a URL — one call in, structured JSON out.

### Sample output (`metadata`, url "https://github.com")

```json
{
  "ok": true, "finalUrl": "https://github.com/", "status": 200,
  "title": "GitHub · Build and ship software…",
  "description": "Join the world's most widely adopted…",
  "siteName": "GitHub", "type": "object",
  "image": "https://github.githubassets.com/…/og-image.png",
  "favicon": "https://github.com/favicon.svg",
  "canonical": "https://github.com/", "lang": "en", "twitterCard": "summary_large_image"
}
```

### How to use

- **HTTP API (Standby):** POST or GET `/metadata`, `/links`. `GET /` returns help. Example: `GET /metadata?url=https://news.ycombinator.com`.
- **Normal run:** pass `{ operation, url, ... }`; results land in the dataset + key-value store.
- **MCP tool:** expose it to your agent via Apify's MCP server.

### Input

- **operation** — `metadata` · `links`.
- **url** — the page to inspect.
- **limit** — (links) cap the number of links. **timeoutMs** — fetch timeout.

### Pricing

**Per query** from **$0.004** (down to $0.001 on higher tiers). One call = one extraction.

### Related Actors

- **[Website Screenshot & PDF](https://apify.com/synthetic.ia/web-screenshot-pdf)** — render a page to an image or PDF.
- **[Domain & DNS Lookup](https://apify.com/synthetic.ia/domain-dns-lookup)** — DNS records, whois and IP info.

### FAQ

**Do I need a key?** No.

**Does it run JavaScript?** No — it parses the server-rendered HTML (fast and cheap). For pages that need a real browser, pair it with our Website Screenshot actor.

**Which private URLs are blocked?** Anything non-public: localhost, `10.x`, `192.168.x`, `172.16–31.x`, `169.254.x` (incl. cloud metadata) and IPv6 equivalents.

### Notes & limits

Parses up to ~5 MB of HTML per page. Some sites block automated requests or serve different HTML to bots. JSON-LD is returned as-is (up to 5 blocks).

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/url-metadata-preview/changelog.md

# Actor input Schema

## `operation` (type: `string`):

What to extract.

## `url` (type: `string`):

The public page to inspect (http/https).

## `limit` (type: `integer`):

Cap the number of links returned.

## `timeoutMs` (type: `integer`):

Max time to fetch the page (3000–45000).

## Actor input object example

```json
{
  "operation": "metadata",
  "url": "https://github.com",
  "limit": 200,
  "timeoutMs": 20000
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `runs` (type: `string`):

No description

# 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 = {
    "url": "https://github.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/url-metadata-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 = { "url": "https://github.com" }

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/url-metadata-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 '{
  "url": "https://github.com"
}' |
apify call synthetic.ia/url-metadata-preview --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthetic.ia/url-metadata-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/q6mh8qVzgQWHrXlQP/builds/DZvHHCd10y1h97msm/openapi.json
