# AI Crawlability Preflight (`iam_not_real/ai-crawlability-preflight`) Actor

Deterministic crawl/indexability, canonical, and JSON-LD preflight for public web pages.

- **URL**: https://apify.com/iam\_not\_real/ai-crawlability-preflight.md
- **Developed by:** [SUTHEE KOSITWONGSAKUL](https://apify.com/iam_not_real) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 completed page preflights

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

## AI Crawlability Preflight

A small deterministic Apify Actor that checks obvious crawl/indexability blockers, canonical signals, and JSON-LD parsing state for **1–100 public HTTP/HTTPS page URLs**.

It is designed as a machine-readable preflight utility for workflows. It does not call an LLM or any paid/external API.

### What it returns

One default-dataset row per completed URL preflight, including:

- input URL, final URL, redirect chain, final HTTP status, fetch state, Content-Type, and bounded-body state;
- wildcard (`User-agent: *`) `robots.txt` path allowance plus robots fetch evidence;
- page-level `<meta name="robots">` directives and `noindex` detection;
- canonical URL plus `self|different|missing|invalid` status;
- JSON-LD block count, parseable block count, extracted `@type` values, and stable parse-error details;
- deterministic `PASS|WARN|BLOCK` classification with stable reason codes.

Observed facts are stored separately from the derived `preflight` classification so downstream consumers can use the raw evidence directly.

### Input

```json
{
  "urls": [
    "https://example.com/",
    "https://example.com/product"
  ],
  "reportFormat": "none"
}
```

- `urls` — required array, 1–100 absolute public `http`/`https` URLs.
- `reportFormat` — `none` or `markdown`; default `none`.

When `reportFormat` is `markdown`, the Actor writes a deterministic `REPORT.md` to the run's default Key-Value Store. It contains counts and reason-code tables only; it contains no LLM recommendations.

### Output example

```json
{
  "url": "https://example.com/product",
  "finalUrl": "https://example.com/product",
  "httpStatus": 200,
  "fetchStatus": "ok",
  "contentType": "text/html; charset=utf-8",
  "redirectChain": ["https://example.com/product"],
  "bodyTruncated": false,
  "fetchError": null,
  "robots": {
    "robotsUrl": "https://example.com/robots.txt",
    "robotsHttpStatus": 200,
    "robotsFetchStatus": "ok",
    "robotsTxtFound": true,
    "wildcardAllowed": true,
    "robotsFetchError": null,
    "metaRobots": ["follow", "index"],
    "noindex": false,
    "htmlAnalyzed": true
  },
  "canonical": {
    "url": "https://example.com/product",
    "raw": "https://example.com/product",
    "status": "self",
    "count": 1,
    "analyzed": true
  },
  "jsonLd": {
    "blockCount": 1,
    "parseableBlockCount": 1,
    "types": ["Product"],
    "parseErrors": [],
    "missing": false,
    "analyzed": true
  },
  "preflight": {
    "status": "PASS",
    "blockers": [],
    "warnings": []
  }
}
```

### Classification and reason codes

`BLOCK` is produced if any blocker exists. Otherwise `WARN` is produced if any warning exists. Otherwise the row is `PASS`.

Blockers:

- `FETCH_ERROR`
- `HTTP_NON_2XX`
- `ROBOTS_DISALLOW`
- `META_NOINDEX`

Warnings:

- `CANONICAL_DIFFERENT`
- `CANONICAL_MISSING`
- `CANONICAL_INVALID`
- `JSONLD_MISSING`
- `JSONLD_PARSE_ERROR`
- `ROBOTS_FETCH_ERROR`
- `NON_HTML_CONTENT`
- `BODY_TRUNCATED`

The work-order-required MVP reason codes are therefore all covered: `HTTP_NON_2XX`, `ROBOTS_DISALLOW`, `META_NOINDEX`, `CANONICAL_DIFFERENT`, `CANONICAL_MISSING`, `JSONLD_MISSING`, `JSONLD_PARSE_ERROR`, and `FETCH_ERROR`.

### Fetch-state semantics

- `ok` — an HTTP response was obtained (including non-2xx responses other than the explicit blocked statuses below).
- `blocked` — the final page response was HTTP 401, 403, or 429.
- `error` — no final HTTP response was obtained because of a transport, DNS, URL-safety, timeout, or redirect failure.

`HTTP_NON_2XX` remains the deterministic blocker for all final non-2xx HTTP responses.

### Public-target safety

Before each page request and each redirect target, the Actor:

- requires absolute HTTP/HTTPS;
- rejects credential-bearing URLs;
- resolves the hostname and rejects any non-global/private/loopback/link-local target.

Every page, redirect, and `robots.txt` fetch is also enforced at TCP connection time. The custom HTTPX/httpcore backend resolves immediately before opening the socket, rejects the entire DNS answer set if any address is non-global, and connects to the exact validated public IP. The original hostname remains the HTTP origin and TLS SNI/certificate-validation name, closing the prior DNS-validation/connection TOCTOU gap without weakening TLS validation.

### Deliberate non-claims

This Actor **does not**:

- measure visibility, citations, rankings, or share of voice in ChatGPT, Gemini, Perplexity, or any other AI engine;
- produce a GEO/SEO score or predict citation probability;
- provide consulting, manual audits, content writing, or recommendations;
- validate Google rich-result eligibility or the semantic correctness of every Schema.org property;
- crawl sitemaps or discover site-wide URLs;
- execute JavaScript or render pages in a browser;
- authenticate to private pages or use external proxy/API services in this MVP.

It reports deterministic evidence from direct HTTP responses only.

### Pay per Event

This Actor uses the custom paid event `page-preflight` at **USD 0.005** for each charge-eligible completed page-preflight result.

Charge eligibility is deterministic:

- fetched HTTP results that produce a bounded page-preflight row emit exactly one `page-preflight`;
- `BODY_TRUNCATED` remains chargeable because the bounded fetched result is delivered;
- URL-safety, DNS, connection, redirect, network, and timeout failures are still returned as diagnostic evidence but do not emit the custom `page-preflight` event.

Apify manages the Actor Start event separately. The Actor code does not manually charge that event. Current Store pricing should be treated as authoritative for the final amount shown before a run.

# Actor input Schema

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

Public absolute HTTP/HTTPS page URLs to preflight.

## `reportFormat` (type: `string`):

Optionally write a deterministic Markdown run summary to REPORT.md in the default Key-Value Store.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "reportFormat": "none"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `markdownReport` (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/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("iam_not_real/ai-crawlability-preflight").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/"] }

# Run the Actor and wait for it to finish
run = client.actor("iam_not_real/ai-crawlability-preflight").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/"
  ]
}' |
apify call iam_not_real/ai-crawlability-preflight --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,iam_not_real/ai-crawlability-preflight"
        }
    }
}

```

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/ILUkBD9jPYfcdQg93/builds/mDEVzjXrl5XBL6FR9/openapi.json
