# Link Preview & URL Metadata API: Open Graph Extractor (`f0rty7even/link-preview`) Actor

Free API: turn any URL into clean link-preview metadata including title, description, Open Graph and Twitter card, favicon, canonical, and language. Powers link unfurling and preview cards. No login.

- **URL**: https://apify.com/f0rty7even/link-preview.md
- **Developed by:** [Michael Yousrie](https://apify.com/f0rty7even) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Link Preview & URL Metadata API — Open Graph Extractor

**Free.** Turn any URL into clean link-preview metadata — the data that powers link unfurling in Slack, Discord, and chat apps, and the preview cards on websites. Paste one URL or hundreds and get back **title, description, Open Graph, Twitter card, favicon, canonical URL, and language** as tidy JSON.

No login, no API key, no cost — just fast, reliable metadata.

### What it does

- **Open Graph & Twitter cards** — `og:title`, `og:description`, `og:image`, `og:site_name`, `og:type`, plus Twitter `card`/`title`/`description`/`image`.
- **Core metadata** — page `title`, meta `description`, `canonical` URL, `lang`, `charset`, `theme-color`.
- **Favicon** — resolved to an absolute URL (with sensible fallback).
- **Redirect-aware** — reports the `finalUrl` and HTTP status.
- **Batch** — pass many URLs, get one clean record each.

### Use cases

- **Link previews / unfurling** — build rich cards for a chat app, CMS, or bookmarking tool.
- **Content & social tooling** — pull OG images and titles for scheduling or dashboards.
- **QA / SEO spot-checks** — confirm a page's OG/Twitter tags render correctly.

### Input

| Field | Description |
|---|---|
| `urls` | One or more URLs to extract metadata from. |
| `maxUrls` | Safety cap on URLs processed per run. |

### Output

```json
{
  "url": "https://apify.com",
  "finalUrl": "https://apify.com",
  "statusCode": 200,
  "title": "Apify: The largest marketplace of trusted tools for AI",
  "description": "Thousands of tools to automate your business...",
  "ogImage": "https://apify.com/og-image?title=...",
  "ogSiteName": "Apify",
  "twitterCard": "summary_large_image",
  "canonical": "https://apify.com",
  "favicon": "https://apify.com/favicon.ico",
  "lang": "en"
}
```

### Need more than metadata?

This is the free, lightweight sibling of my data-extraction Actors — if you need the **full content**, not just the preview:

- **[LLM-Ready Web Extractor](https://apify.com/f0rty7even/llm-web-extractor)** — any URL or whole site → clean Markdown/JSON for LLMs & RAG.
- **[SEO Audit & Site Health Checker](https://apify.com/f0rty7even/seo-auditor)** — crawl a site for per-page SEO issues and a health score.
- **[llms.txt Generator](https://apify.com/f0rty7even/llms-txt-generator)** — make any website LLM-ready.

### Notes

- Reads **server-rendered HTML** `<head>` metadata (what social crawlers see). It does not execute JavaScript.
- Public pages only — no login or paywall bypass.

### FAQ

**Is it really free?** Yes — no per-result charge. You only ever pay Apify's standard platform usage for the run itself.

**What formats can I export?** JSON, JSONL, CSV, or Excel, or via the Apify API.

# Actor input Schema

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

One or more URLs to extract link-preview metadata from.

## `maxUrls` (type: `integer`):

Safety cap on how many URLs to process in one run.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxUrls": 100
}
```

# Actor output Schema

## `previews` (type: `string`):

One metadata record per URL. Export as JSON, JSONL, CSV, or Excel.

# 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": [
        {
            "url": "https://apify.com"
        }
    ]
};

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

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    {
      "url": "https://apify.com"
    }
  ]
}' |
apify call f0rty7even/link-preview --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=f0rty7even/link-preview",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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