# Website Meta & Social Tags Extractor (`eichan/website-meta-social-tags-extractor`) Actor

Extract the title, meta description, canonical URL, Open Graph and Twitter Card tags, and H1 heading from one web page (optionally a few same-site pages). Built for quick SEO and social-sharing checks: paste a URL, get a clean dataset item per page.

- **URL**: https://apify.com/eichan/website-meta-social-tags-extractor.md
- **Developed by:** [Eichan Jolly](https://apify.com/eichan) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

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

## Website Meta & Social Tags Extractor

Paste in a URL and get back the tags that decide how the page looks in
search results and social shares - the title, meta description, canonical
URL, Open Graph tags, Twitter Card tags, and the H1 heading - as clean,
structured data. No scraping code, no browser, no setup.

### What it does

For each page it visits, the Actor extracts:

- **title** - the page `<title>`
- **description** - the meta description
- **canonical** - the canonical URL, if the page declares one
- **openGraph** - `og:title`, `og:description`, `og:image`, `og:type`, `og:url`, `og:site_name`
- **twitterCard** - `twitter:card`, `twitter:title`, `twitter:description`, `twitter:image`
- **h1** - the first H1 heading text (plus `h1Count`, how many H1s the page has)
- **statusCode** and **fetchedAt** - the HTTP status, and when the page was fetched

Typical uses: checking that a new page has its social tags in place before
launch, auditing a few key pages after a redesign, or feeding page metadata
into a spreadsheet or report.

### Input

| Field | What it is | Default |
| --- | --- | --- |
| Start URL | The full URL of the page to inspect, including `https://` | `https://example.com` |
| Max pages | How many pages to visit at most, following links on the **same site only**. `1` = just the start page | `1` |

Example input:

```json
{
  "startUrl": "https://example.com",
  "maxPages": 1
}
```

### Output example

One dataset item per page:

```json
{
  "url": "https://example.com/",
  "statusCode": 200,
  "title": "Example Domain",
  "description": null,
  "canonical": null,
  "openGraph": {
    "title": null,
    "description": null,
    "image": null,
    "type": null,
    "url": null,
    "siteName": null
  },
  "twitterCard": {
    "card": null,
    "title": null,
    "description": null,
    "image": null
  },
  "h1": "Example Domain",
  "h1Count": 1,
  "fetchedAt": "2026-11-01T01:20:00.000000+00:00"
}
```

A `null` simply means that tag is not present on the page - which is often
exactly what you wanted to find out.

### Limits - please read

- **Small by design.** At most 5 pages per run, all on the same site as the
  start URL. This is a checker for individual pages, not a site-wide crawler.
- **Static HTML only.** Tags are read from the page's HTML as the server
  sends it. If a site builds its tags with JavaScript in the browser, they
  may not appear here.
- **Public pages only.** No logins, no cookies, no paywalls.
- **If the start page cannot be loaded** (wrong URL, site down, HTTP error),
  the run stops and the log says why, in plain words.

### For developers

Standard-library-only Python, no SDK. On the Apify platform the Actor uses
the run's own environment variables (`APIFY_TOKEN`,
`APIFY_DEFAULT_KEY_VALUE_STORE_ID`, `APIFY_DEFAULT_DATASET_ID`) to read the
input from the key-value store API and POST each item to the dataset API.
Locally (`python3 src/main.py`) it falls back to files - input from
`key_value_stores/default/INPUT.json` and items as JSON files in
`datasets/default/` inside `APIFY_LOCAL_STORAGE_DIR` - so the same code runs
in both places.

# Actor input Schema

## `maxPages` (type: `integer`):

How many pages to visit at most, starting from the Start URL and following links on the same site only. 1 means just the start page. Capped at 5 to keep runs tiny and fast.

## `startUrl` (type: `string`):

The full URL of the page to inspect, including https:// - for example https://example.com

## Actor input object example

```json
{
  "maxPages": 1,
  "startUrl": "https://example.com"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing one item per fetched page

# 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 = {
    "maxPages": 1,
    "startUrl": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("eichan/website-meta-social-tags-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 = {
    "maxPages": 1,
    "startUrl": "https://example.com",
}

# Run the Actor and wait for it to finish
run = client.actor("eichan/website-meta-social-tags-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 '{
  "maxPages": 1,
  "startUrl": "https://example.com"
}' |
apify call eichan/website-meta-social-tags-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eichan/website-meta-social-tags-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/R6PJoQaeIj6XbLmJa/builds/ugpNQqVswqWZ2MQIe/openapi.json
