# 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
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 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/actors/running/actors-in-store.md#pay-per-usage

## 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 & 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(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": [
    {
      "url": "https://apify.com"
    }
  ]
}' |
apify call f0rty7even/link-preview --silent --output-dataset

```

## MCP server setup

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