# Meta Tags Extractor: title, description, Open Graph, hreflang (`examsens.ai/meta-tags-extractor`) Actor

Extracts the title, meta description, canonical, robots directives, Open Graph, Twitter card tags and hreflang of many pages at once, with length checks, preview image checks and a list of problems for each page.

- **URL**: https://apify.com/examsens.ai/meta-tags-extractor.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (community)
- **Categories:** SEO tools, Marketing
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 page checkeds

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

## Meta Tags Extractor: title, description, Open Graph, hreflang

Give it a list of page URLs and it returns, for each page, the tags search engines and social sites read from the page head, with length checks and a plain list of problems.

Each page is fetched once, redirects followed, and its HTML is read as served. Scripts are not run, so tags added by JavaScript after load are not seen.

For each page you get:

- Title and its length, marked `ok`, `short`, `long` or `missing` against your limits (default 30 to 60 characters)
- Meta description and its length, checked the same way (default 70 to 160 characters)
- Canonical URL, how many canonical tags the page has, and whether it points to the page itself
- Robots: the robots meta tag, `googlebot` and `bingbot` meta tags, the `X-Robots-Tag` header, and `indexable`, false when any of them says `noindex` or `none`
- Open Graph: every `og:`, `article:`, `product:` and `fb:` property. A property that appears more than once, such as several `og:image` tags, comes back as a list.
- Twitter card: every `twitter:` tag
- hreflang: every alternate link with its code and URL, plus checks for codes not in language or language-region form, the page not listing itself, no `x-default`, and one code pointing to two URLs
- Preview images: with "Check preview images" on, each `og:image` and `twitter:image` (up to four per page) is requested, with its status and content type, and flagged when it does not load as an image
- Also: the `h1` headings and their count, the `html lang` attribute, the charset, the viewport tag, the favicon, and the schema.org types found in JSON-LD blocks, including those inside `@graph`

The `issues` list flags a page set to noindex, a missing or out of range title or description, more than one title or description, a missing canonical, two different canonicals, a canonical pointing to another URL, missing required Open Graph properties, no `twitter:card`, the hreflang problems above, no `h1` or more than one, no viewport tag, no `lang` attribute, JSON-LD that is not valid JSON, and a preview image that does not load.

The Open Graph protocol names four properties as required on every page: `og:title`, `og:type`, `og:image` and `og:url` \[1]. Google reads an hreflang code as an ISO 639-1 language with an optional ISO 3166-1 Alpha 2 region, asks for each language version to list itself as well as the others, and recommends `x-default` for unmatched languages \[2].

### Duplicates across the run

The key value store holds a `SUMMARY` record listing titles and meta descriptions used by more than one page in the run, with the pages that share each one.

### Input

- URLs (required). An address without `http://` or `https://` is read as `https://`.
- Title and description length limits
- Check preview images (default on)
- Timeout per request (default 20 seconds), pages read at once (default 10), user agent

### Output

Dataset: one item per URL with `url`, `finalUrl`, `status`, `ok`, `title`, `titleCheck`, `description`, `descriptionCheck`, `canonical`, `canonicalCount`, `canonicalMatchesUrl`, `robotsMeta`, `botMetas`, `xRobotsTag`, `indexable`, `openGraph`, `twitter`, `hreflang`, `hreflangCheck`, `h1`, `h1Count`, `lang`, `charset`, `viewport`, `favicon`, `jsonLdTypes`, `previewImages`, `issues`, `issueCount` and `checkedAt`. A page that answers 400 or above, is not HTML, or cannot be reached gets an item with `ok` false and the reason in `error`. Export as JSON, CSV or Excel, or read it over the API.

### Pricing

Pay per event: one event per page read. Pages that fail and entries that are not valid URLs are reported and not charged.

### Scope and conduct

It reads only the pages you list and their preview images. It does not log in or submit anything.

### Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.

### References

\[1] The Open Graph protocol, Basic Metadata. https://ogp.me/
\[2] Google Search Central, Tell Google about localized versions of your page, sections "Supported language and region codes", "Guidelines for all methods" and "Use the x-default value for unmatched languages". https://developers.google.com/search/docs/specialty/international/localized-versions

# Actor input Schema

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

Pages to read, one per line. An address without http:// or https:// is read as https://. Redirects are followed.

## `titleMinLength` (type: `integer`):

A shorter title is flagged as short.

## `titleMaxLength` (type: `integer`):

A longer title is flagged as long.

## `descriptionMinLength` (type: `integer`):

A shorter meta description is flagged as short.

## `descriptionMaxLength` (type: `integer`):

A longer meta description is flagged as long.

## `checkPreviewImages` (type: `boolean`):

Request each og:image and twitter:image (up to four per page) and report whether it loads as an image.

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

How long to wait for each response.

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

How many pages are read at the same time.

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

The User-Agent header sent with every request. Leave empty to send Mozilla/5.0 (compatible; MetaTagsExtractor/1.0).

## Actor input object example

```json
{
  "urls": [
    "https://github.com",
    "https://www.apple.com/uk/",
    "https://example.com"
  ],
  "titleMinLength": 30,
  "titleMaxLength": 60,
  "descriptionMinLength": 70,
  "descriptionMaxLength": 160,
  "checkPreviewImages": true,
  "timeoutSecs": 20,
  "maxConcurrency": 10
}
```

# 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://github.com",
        "https://www.apple.com/uk/",
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/meta-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 = { "urls": [
        "https://github.com",
        "https://www.apple.com/uk/",
        "https://example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/meta-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 '{
  "urls": [
    "https://github.com",
    "https://www.apple.com/uk/",
    "https://example.com"
  ]
}' |
apify call examsens.ai/meta-tags-extractor --silent --output-dataset

```

## MCP server setup

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