# On-Page SEO, OpenGraph, JSON-LD Schema & Metadata Auditor (`n4d.h1dr/seo-meta-audit-extractor`) Actor

Lightning-fast technical SEO extractor that parses OpenGraph, Twitter Cards, Schema.org JSON-LD, heading hierarchy, and missing alt tags without browser bloat.

- **URL**: https://apify.com/n4d.h1dr/seo-meta-audit-extractor.md
- **Developed by:** [Nadim Hider](https://apify.com/n4d.h1dr) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 processed items

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

## On-Page SEO, OpenGraph, JSON-LD Schema & Metadata Auditor

A lightweight, high-performance technical SEO auditor that analyzes web pages without the heavy overhead of headless browsers. Extracts title & meta descriptions, canonical URLs, robots directives, social OpenGraph & Twitter Cards, Schema.org JSON-LD structured data, heading hierarchies (H1-H6), and missing image alt tags.

***

### 🚀 Why Use This Actor?

Traditional SEO crawlers launch full Chromium/Puppeteer instances, eating gigabytes of RAM and taking 10–20 seconds per page. This Actor runs in milliseconds using direct HTTP parsing:

- **10x Faster & Cheaper**: Processes dozens of pages per second with negligible compute costs.
- **OpenGraph & Twitter Cards**: Validates social sharing previews (title, image, card type).
- **Schema.org Microdata Extraction**: Parses embedded JSON-LD scripts into clean, queryable JSON objects.
- **Heading Structure Audit**: Verifies clean H1-H6 hierarchy and flags missing or duplicate H1 tags.
- **Image Accessibility Check**: Counts images lacking `alt` tags to maintain WCAG accessibility standards.
- **On-Page SEO Score**: Computes an automatic 0–100 health score for instant agency reporting.

***

### 📥 Input Schema

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | Array | `["https://apify.com"]` | List of web page URLs to fetch and audit. |
| `raw_html_pages` | Array | `[]` | Optional raw HTML payloads to audit without network requests. |
| `extract_json_ld` | Boolean | `true` | Extracts and parses Schema.org `<script type="application/ld+json">`. |
| `extract_headings` | Boolean | `true` | Extracts H1-H6 outline and counts H1 occurrences. |

#### Sample Input JSON

```json
{
  "urls": [
    "https://apify.com",
    "https://github.com"
  ],
  "extract_json_ld": true,
  "extract_headings": true
}
```

***

### 📤 Output Dataset Format

```json
{
  "url": "https://apify.com",
  "title": "Apify: Full-Stack Web Scraping and Automation Platform",
  "title_length": 55,
  "meta_description": "Extract data from any website with scalable cloud Actors.",
  "canonical_url": "https://apify.com",
  "robots_meta": "index, follow",
  "open_graph": {
    "og:title": "Apify Platform",
    "og:image": "https://apify.com/og-image.png"
  },
  "twitter_card": {
    "twitter:card": "summary_large_image"
  },
  "json_ld": [
    {
      "@context": "https://schema.org",
      "@type": "SoftwareApplication",
      "name": "Apify"
    }
  ],
  "h1_count": 1,
  "headings_outline": [
    "H1: The Web Scraping Cloud Platform",
    "H2: Deploy AI Agents and Scrapers"
  ],
  "total_images": 2,
  "missing_alt_images_count": 1,
  "seo_health_score": 92.5,
  "status": "success"
}
```

***

### 💰 Pay-Per-Event (PPE) Pricing

- **Event Name**: `item-processed`
- **Cost**: Only **$0.001 per audited URL** ($1.00 per 1,000 URLs).
- Ideal for digital marketing agencies running recurring site audits, link-building outreach bots, and competitor monitoring.

***

### 🔌 API & Python Client Example

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("YOUR_USERNAME/seo-meta-audit-extractor").call(run_input={
    "urls": ["https://apify.com"]
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"URL: {item['url']} | Score: {item['seo_health_score']}/100")
```

# Actor input Schema

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

List of URLs to fetch and audit for on-page SEO.

## `raw_html_pages` (type: `array`):

Optional raw HTML snippets to audit directly (ideal for offline tests or pre-rendered pages).

## `extract_json_ld` (type: `boolean`):

Parses and returns all structured data blocks found in <script type="application/ld+json">.

## `extract_headings` (type: `boolean`):

Audits heading hierarchy and warns if multiple H1 tags or missing headings exist.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "raw_html_pages": [],
  "extract_json_ld": true,
  "extract_headings": true
}
```

# 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"
    ],
    "raw_html_pages": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("n4d.h1dr/seo-meta-audit-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"],
    "raw_html_pages": [],
}

# Run the Actor and wait for it to finish
run = client.actor("n4d.h1dr/seo-meta-audit-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"
  ],
  "raw_html_pages": []
}' |
apify call n4d.h1dr/seo-meta-audit-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,n4d.h1dr/seo-meta-audit-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/pbqo8ITpCpbgMrhRT/builds/dINaAKb1VpxKH5lYZ/openapi.json
