# Page Metadata Extractor: Open Graph, Twitter Cards, JSON-LD (`forgeloop/page-metadata-extractor`) Actor

Get title, description, canonical, Open Graph, Twitter Card tags, JSON-LD, favicons, feeds and hreflang for a list of URLs. Shows the social preview card and a problem list like missing og:image or invalid JSON-LD. Optional image check. Pay per page.

- **URL**: https://apify.com/forgeloop/page-metadata-extractor.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 page reads

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

## Page Metadata Extractor: Open Graph, Twitter Cards, JSON-LD

Read the metadata of a list of web pages and get back one row per URL with the title, meta description, canonical, language, robots tag, all Open Graph and Twitter Card tags, the parsed JSON-LD, favicons, feeds and hreflang links. Each row also shows the preview a social network would build from these tags and a plain list of problems, like a missing `og:image` or invalid JSON-LD.

Built for link preview checks before you share a page, SEO audits of social cards, structured data collection and enriching URL lists for AI agents. The Actor sends one plain GET request per page and reads the HTML. It does not run a browser and does not crawl.

Not affiliated with Meta, X Corp. or Schema.org. Open Graph, Twitter Cards and JSON-LD are named only as the tag formats the Actor reads.

### What it does

- **Reads the basic tags:** `<title>`, meta description, canonical URL, `<html lang>`, robots meta tag and the X-Robots-Tag header.
- **Collects all Open Graph tags** (`og:*` plus the related `article:*`, `product:*`, `fb:*` and `al:*` tags) and **all Twitter Card tags** (`twitter:*`). Tags that appear more than once, like several `og:image` tags, become arrays in document order.
- **Parses JSON-LD:** every `<script type="application/ld+json">` block is parsed and returned as an array. Blocks that are not valid JSON are listed in `jsonLdErrors` with the parser message. `schemaTypes` lists the `@type` values of the top level objects and of `@graph` entries, for example `Product`, `Organization`, `BreadcrumbList`.
- **Finds icons and links:** favicons (`icon`, `shortcut icon`, `apple-touch-icon`, `mask-icon`) with sizes and type, the web app manifest, RSS, Atom and JSON feeds, and hreflang alternates.
- **Builds the preview card:** the best title, description, image, image alt text, site name and URL, the way Facebook, LinkedIn, Slack or X pick them: Open Graph first, then Twitter tags, then the plain HTML tags. Relative image URLs are resolved.
- **Lists problems** in plain words: `og:image missing`, `og:image is relative`, `title longer than 60 characters (75)`, `meta description missing`, `twitter:card missing`, `canonical missing`, `JSON-LD invalid (1 block)`, `robots meta tag says noindex`, `page returned HTTP 404` and more.
- **Checks the preview image** on request: a HEAD request on the image (GET without body when HEAD is refused) reports the status code, content type and size, and flags images that are broken or not images.
- **Follows redirects** by hand, up to 5 hops, and reports the final URL. Reads at most 2 MB of HTML per page. Decodes the charset from the header or the meta tag.
- **Polite:** at most 2 parallel requests per host with a short pause between requests.
- **Safe:** private and local network targets like `192.168.0.1`, `10.0.0.1` or `localhost` are blocked, also when a redirect points there.

### Use cases

- **Link preview QA before sharing:** check that a blog post, product page or campaign landing page shows the right title, description and image before it goes out in a newsletter, on LinkedIn or in Slack.
- **SEO audits of social cards:** run all key pages of a site and filter for rows with problems, like missing `og:image` or titles that are too long.
- **Collecting structured data:** read the JSON-LD of product, article, event or recipe pages and see which schema types a site uses.
- **Enriching URL lists for AI agents:** turn bare URLs into a title, a description, an image and a site name for link cards, bookmarks, CRM records or agent tools.
- **Migration checks:** after a relaunch, check that canonicals, hreflang links and Open Graph tags still point to the right URLs.

### Input

| Field | Description | Default |
|---|---|---|
| URLs | A list of URLs. URLs without a scheme get `https://` | |
| URLs as text | Optional text block, one URL per line or separated by spaces. Used together with the list | |
| Check preview image | HEAD request on the preview image with status code, content type and size | off |
| Timeout | Seconds before a single request is given up, 3 to 60 | 20 |
| Parallel URLs | URLs read at the same time, 1 to 50 | 5 |
| User agent | `neutral` (forgeloop-page-metadata-extractor/0.1) or `browser` (desktop Chrome) | `neutral` |

Example, three pages with the image check:

```json
{
  "urls": [
    "https://apify.com",
    "https://github.com/apify/crawlee",
    "https://en.wikipedia.org/wiki/Open_Graph_protocol"
  ],
  "checkImages": true
}
```

Example, a pasted column of URLs with a browser user agent:

```json
{
  "urlsText": "https://www.python.org\nhttps://nodejs.org/en\nexample.com",
  "userAgent": "browser",
  "timeoutSecs": 30
}
```

### Output

One dataset item per unique URL:

```json
{
  "inputUrl": "https://en.wikipedia.org/wiki/Open_Graph_protocol",
  "finalUrl": "https://en.wikipedia.org/wiki/Open_Graph_protocol",
  "statusCode": 200,
  "title": "Open Graph protocol - Wikipedia",
  "metaDescription": null,
  "canonical": "https://en.wikipedia.org/wiki/Open_Graph_protocol",
  "lang": "en",
  "robots": "max-image-preview:standard",
  "xRobotsTag": null,
  "preview": {
    "title": "Open Graph protocol - Wikipedia",
    "description": null,
    "image": "https://upload.wikimedia.org/wikipedia/commons/7/72/Open_Graph_protocol_logo.png",
    "imageAlt": null,
    "siteName": "en.wikipedia.org",
    "url": "https://en.wikipedia.org/wiki/Open_Graph_protocol",
    "type": "website",
    "twitterCard": null
  },
  "problems": ["meta description missing", "og:description missing", "og:url missing", "twitter:card missing"],
  "openGraph": {
    "og:image": "https://upload.wikimedia.org/wikipedia/commons/7/72/Open_Graph_protocol_logo.png",
    "og:image:width": "1200",
    "og:image:height": "1200",
    "og:title": "Open Graph protocol - Wikipedia",
    "og:type": "website"
  },
  "twitter": {},
  "jsonLd": [{ "@context": "https://schema.org", "@type": "Article", "name": "Open Graph protocol" }],
  "jsonLdErrors": [],
  "schemaTypes": ["Article"],
  "favicons": [
    { "rel": "apple-touch-icon", "url": "https://en.wikipedia.org/static/apple-touch/wikipedia.png", "sizes": null, "type": null },
    { "rel": "icon", "url": "https://en.wikipedia.org/static/favicon/wikipedia.ico", "sizes": null, "type": null }
  ],
  "manifest": null,
  "feeds": [{ "format": "atom", "title": "Wikipedia Atom feed", "url": "https://en.wikipedia.org/w/index.php?title=Special:RecentChanges&feed=atom" }],
  "hreflang": [],
  "imageCheck": {
    "url": "https://upload.wikimedia.org/wikipedia/commons/7/72/Open_Graph_protocol_logo.png",
    "finalUrl": "https://upload.wikimedia.org/wikipedia/commons/7/72/Open_Graph_protocol_logo.png",
    "statusCode": 200,
    "contentType": "image/png",
    "contentLength": 12379,
    "isImage": true,
    "error": null
  },
  "contentType": "text/html; charset=UTF-8",
  "redirectCount": 0,
  "responseTimeMs": 118,
  "htmlBytes": 84882,
  "truncated": false,
  "checkedAt": "2026-11-18T20:41:34.258Z",
  "error": null
}
```

- `openGraph` and `twitter` keep the tag names as keys and the raw values as written in the page. A tag that appears more than once is an array. Relative URLs stay relative here, so you can see what the page really sends.
- `preview` holds the resolved values a social card would show. `siteName` falls back to `application-name` and then to the host name. `url` falls back to the canonical and then to the final URL.
- `jsonLd` holds the parsed objects of all valid blocks. A block with a top level array adds each element. `schemaTypes` does not include nested types like `Offer` inside a `Product`.
- `hreflang` holds `{ "lang", "url" }` pairs. `feeds` holds `{ "format", "title", "url" }` with format `rss`, `atom` or `json`.
- `imageCheck` is `null` when the image check is off or the page has no preview image.
- `problems` is a list of short texts. An empty list means the page has every tag the checks look for.
- `htmlBytes` is the size of the HTML that was read. `truncated` is `true` when the page was larger than 2 MB and only the first 2 MB were read.
- Pages that are not HTML (a PDF, an image) get the status and content type and the problem `not an HTML page (...)`. Their body is not downloaded.
- Invalid lines, blocked targets, unreachable hosts, timeouts and redirect loops return an item with `error` set, for example `Domain not found: example.invalid (ENOTFOUND)`.

Export the dataset as JSON, CSV or Excel, or read it through the Apify API. The Overview view shows the preview image, title, description, schema types and problems side by side.

### Pricing

Pay per page: 0.001 USD per fetched page, so 1.00 USD per 1,000 pages. A page counts when the server answered, also with 404 or 500. Invalid lines, duplicates, blocked private addresses, unreachable hosts, timeouts and redirect loops are free. The image check is free. Set the maximum charge in Apify to cap the cost of a run.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start.

### Limits

- The Actor reads the HTML the server sends. Pages that add their tags with JavaScript after loading show only the tags in the initial HTML. Most sites put Open Graph and JSON-LD in the initial HTML because social networks do not run JavaScript either.
- Some sites block automated requests or answer them with a captcha page (HTTP 403 or 429, or a 200 with a challenge page). The Actor reports what it gets and does not try to get around it. The `browser` user agent helps with some servers that answer unknown clients differently.
- Social networks use their own crawlers and caches. A page that passes here can still show an old preview on Facebook or LinkedIn until their cache is refreshed.
- At most 2 MB of HTML per page and at most 5 redirects. Metadata after the first 2 MB is not read.
- Microdata and RDFa are not parsed, only JSON-LD.
- At most 2 parallel requests per host. A long list of URLs on one site takes a while.

### Data source, permitted use and legal

- **Data source:** the HTML of the URLs you enter. The Actor reads the page head and the JSON-LD blocks and at most 2 MB of each page. It does not store page content beyond the metadata in the results.
- **Snapshot:** Results show the state at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Read only URLs you have a legitimate reason to check, for example your own sites, your customers' sites or links you publish. Respect the terms of use of the sites you read.
- **Your responsibility:** You choose the URLs and decide what happens with the results. If your input or the results contain personal data, you are the controller and need your own legal basis. Metadata and JSON-LD can contain names, author profiles or contact details from the pages.
- **No circumvention:** The Actor sends plain HTTP requests without login. It does not bypass access restrictions, paywalls, CAPTCHAs or rate limits.
- **Request volume:** At most 2 parallel requests per host with a short pause between requests. Do not use it to put excessive load on a site.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

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

Pages to read, one per entry. URLs without a scheme get https://, so example.com becomes https://example.com/. Fragments (#part) and duplicates are removed. Format: a list of strings like \["https://apify.com", "https://github.com/apify/crawlee"].

## `urlsText` (type: `string`):

Optional. Paste a whole column of URLs here instead, one per line or separated by spaces. Used together with the list above.

## `checkImages` (type: `boolean`):

Send a HEAD request to the preview image (og:image, or twitter:image when og:image is missing) and report its status code, content type and size. Flags images that are broken or not images. Free, but makes runs a little slower.

## `timeoutSecs` (type: `integer`):

Give up on a single request after this many seconds. A page that times out gets a free error item.

## `maxConcurrency` (type: `integer`):

How many URLs are read at the same time. Requests to one host are limited to 2 at a time anyway.

## `userAgent` (type: `string`):

Neutral identifies the Actor as forgeloop-page-metadata-extractor. Browser sends a desktop Chrome user agent, for servers that answer unknown clients differently.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://github.com/apify/crawlee",
    "https://en.wikipedia.org/wiki/Open_Graph_protocol"
  ],
  "checkImages": false,
  "timeoutSecs": 20,
  "maxConcurrency": 5,
  "userAgent": "neutral"
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://apify.com",
        "https://github.com/apify/crawlee",
        "https://en.wikipedia.org/wiki/Open_Graph_protocol"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/page-metadata-extractor").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://apify.com",
        "https://github.com/apify/crawlee",
        "https://en.wikipedia.org/wiki/Open_Graph_protocol",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/page-metadata-extractor").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://apify.com",
    "https://github.com/apify/crawlee",
    "https://en.wikipedia.org/wiki/Open_Graph_protocol"
  ]
}' |
apify call forgeloop/page-metadata-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,forgeloop/page-metadata-extractor"
        }
    }
}
```

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/k9IdcEOTCpJ29bZfD/builds/qsF0tEdDRitPAyN2e/openapi.json
