# Metascraper Metadata Extractor (`khadinakbar/metascraper-metadata-extractor`) Actor

Extract normalized page metadata with Metascraper rule bundles, raw meta-tag provenance, Open Graph, Twitter cards, JSON-LD, canonicals, and content hints.

- **URL**: https://apify.com/khadinakbar/metascraper-metadata-extractor.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** SEO tools, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 metadata extracteds

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?

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

## Metascraper Metadata Extractor

Metascraper Metadata Extractor turns a known list of public page URLs into one structured dataset record per page. It returns normalized title, description, author, publication date, image, logo, publisher, language, and URL alongside Open Graph, Twitter card, canonical, favicon, JSON-LD, and raw head-tag provenance for teams building preview, content, and SEO workflows.

### Best fit and focused standalone workflow

Choose this Actor when you already have page URLs and want page-authored metadata in a compact, API-ready dataset. It works as a focused standalone workflow for link-preview QA, known-URL content enrichment, and canonical-field reviews. Start with a specific page list, then pass the returned source URL, canonical URL, title, publisher, and metadata image into your CMS, QA sheet, or content pipeline for the next enrichment or review step.

### Workflow story: from URLs to a preview-ready record

A content operations team starts with a spreadsheet of article URLs. Next, it supplies those URLs to this Actor and receives one normalized record per page with the author, date, canonical URL, metadata image, and source-tag provenance. The team then compares the returned fields, feeds clean rows into its publishing workflow, and schedules a later run when it wants a fresh collection.

### Input

Pass `urls` as a plain array or `startUrls` in the Apify request-list format. The Actor accepts up to 100 distinct HTTP(S) URLs and processes 25 by default. `includeRawMetaTags` preserves grouped page-head metadata; `includeJsonLd` keeps valid JSON-LD blocks for structured-data context.

```json
{
  "urls": ["https://example.com"],
  "includeRawMetaTags": true,
  "includeJsonLd": true,
  "maxResults": 25
}
```

### Output

Each page produces one dataset item. `metadata` contains the normalized Metascraper result, while `openGraph`, `twitterCard`, and `rawMetaTags` retain page-authored provenance.

| Field            | Meaning                                                           |
| ---------------- | ----------------------------------------------------------------- |
| `metadata.title` | Normalized page title selected by Metascraper rule bundles.       |
| `canonicalUrl`   | Declared canonical link resolved against the final page URL.      |
| `openGraph`      | Page-authored `og:*` tags, including repeat values where present. |
| `twitterCard`    | Page-authored `twitter:*` tags for preview debugging.             |
| `jsonLd`         | Valid page JSON-LD blocks, capped at 20 per page.                 |
| `warnings`       | Page-level provenance notes, such as malformed JSON-LD blocks.    |

```json
{
  "sourceUrl": "https://example.com/",
  "finalUrl": "https://example.com/",
  "statusCode": 200,
  "metadata": {
    "title": "Example Domain",
    "description": null,
    "author": null,
    "publishedAt": null,
    "image": null,
    "logo": null,
    "publisher": null,
    "language": "en",
    "url": "https://example.com/"
  },
  "canonicalUrl": null,
  "openGraph": {},
  "twitterCard": {},
  "warnings": []
}
```

### Pricing

The Actor uses Pay per Event plus platform usage. The `metadata-extracted` event is $0.004 for each successful persisted metadata record and Actor start is $0.00005. A 25-page collection has an event-cost cap of $0.10005 before platform usage. Review the live Pricing tab before a production workflow because it is the current source of truth for event and platform-usage charges.

### Run through the API

```bash
export APIFY_TOKEN="your-apify-token"
curl "https://api.apify.com/v2/acts/khadinakbar~metascraper-metadata-extractor/run-sync-get-dataset-items?token=${APIFY_TOKEN}" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com"],"includeRawMetaTags":true,"includeJsonLd":true,"maxResults":1}'
```

### AI agent prompt

> Use Metascraper Metadata Extractor for these supplied public page URLs. Return the title, canonical URL, normalized image, publisher, Open Graph tags, JSON-LD, and warnings. Read the dataset results after completion, retain source URL provenance, report the terminal outcome, and keep the collection within the stated per-record cost and page scope.

The terminal `OUTPUT` and `RUN_SUMMARY` records provide outcome and dataset-readback context. A supplied page list is the full scope of a run, so agents can control collection size and event cost with `maxResults`.

### Best-results guidance

Provide canonical public pages with complete HTML head sections and use the final URL, status code, warnings, and source-tag groups together when reviewing a record. For recurring checks, schedule the same bounded URL list and compare the fresh dataset against the prior collection in your own workflow.

### Builder's note

I built this Actor around Metascraper’s official, composable rule bundles because a normalized result alone can hide the field source that a QA or ingestion team needs to inspect. My design keeps both layers: a concise normalized record for downstream use and raw tag provenance for an informed follow-up decision.

### Responsible use

Use this Actor for public pages your organization is authorized to access, with applicable laws, site terms, and internal data policies guiding each collection.

# Actor input Schema

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

Public HTTP or HTTPS page URLs to inspect, such as 'https://example.com/article'. Provide a plain list when calling from an agent or API. Up to 100 distinct URLs are accepted and duplicates are removed. This is not a sitemap or domain crawler; use startUrls only as an equivalent Apify-style input.

## `startUrls` (type: `array`):

Alternative Apify request-list input using objects like {"url":"https://example.com"}. It is merged with the urls list and is useful in the Console. Up to 100 distinct URLs are accepted after merging. This does not discover or crawl links beyond the supplied pages.

## `maxResults` (type: `integer`):

Maximum number of distinct supplied pages to fetch, from 1 to 100. The default is 25 so an agent has a predictable cost cap. URLs after this limit are skipped and reported in the run summary. This is not a pagination setting because the Actor does not follow page links.

## `includeRawMetaTags` (type: `boolean`):

Include page-authored head metadata grouped by its name, property, or http-equiv key. The default true preserves provenance for audits and debugging. Set false for a smaller response that contains only normalized Metascraper fields. This does not return page text, cookies, scripts, or form data.

## `includeJsonLd` (type: `boolean`):

Include valid JSON-LD values from application/ld+json script blocks, capped at 20 blocks per page. The default true is useful for structured-data checks. Invalid JSON-LD is counted in warnings rather than evaluated or repaired. This is not schema validation or rich-result eligibility testing.

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

Maximum time allowed for one page request, from 5 to 60 seconds. The default 30 seconds covers ordinary public pages while preventing stuck runs. Raise it only for known slow pages. This does not control the overall Actor run timeout.

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

Number of supplied pages to fetch in parallel, from 1 to 10. The default 5 is conservative for sites that rate limit metadata reads. Lower it for a single domain or fragile target. This is not a request rate guarantee because response times vary.

## `useApifyProxy` (type: `boolean`):

Route public page requests through Apify Proxy when enabled. The default false uses the Actor container network and avoids proxy usage costs. Enable only for targets that need an allowed geography or routinely rate-limit direct requests. This setting does not bypass logins, paywalls, or access controls.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy configuration, such as a group or country code, used only when Use Apify Proxy is enabled. Leave the default empty object for direct requests. This setting is advanced and never exposes a proxy password in output. It is not a generic arbitrary proxy URL field.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "startUrls": [
    {
      "url": "https://example.com"
    }
  ],
  "maxResults": 25,
  "includeRawMetaTags": true,
  "includeJsonLd": true,
  "timeoutSecs": 30,
  "maxConcurrency": 5,
  "useApifyProxy": false,
  "proxyConfiguration": {}
}
```

# Actor output Schema

## `metadata` (type: `string`):

No description

## `downloadCsv` (type: `string`):

No description

## `output` (type: `string`):

No description

## `runSummary` (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://example.com"
    ],
    "startUrls": [
        {
            "url": "https://example.com"
        }
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/metascraper-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://example.com"
  ],
  "startUrls": [
    {
      "url": "https://example.com"
    }
  ]
}' |
apify call khadinakbar/metascraper-metadata-extractor --silent --output-dataset

```

## MCP server setup

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