# Cloudflare Search for Agents & AI-Readiness Auditor (`danlopes18/agent-readiness-search-auditor`) Actor

Fast zero-browser Agent-Readiness & Search Auditor. Audits /.well-known/search (RFC 10008 HTTP QUERY), Accept: text/markdown token savings, /llms.txt, robots.txt AI bots (GPTBot/ClaudeBot), Cloudflare $0.75/1k overage risk & 4-tier Cascade BM25 search. SSRF-safe & MCP-ready.

- **URL**: https://apify.com/danlopes18/agent-readiness-search-auditor.md
- **Developed by:** [Daniel Lopes](https://apify.com/danlopes18) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 url agent-readiness audits

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/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

## Cloudflare Search for Agents & AI-Readiness Auditor (Cascade Discovery)

**Zero-browser, sub-second Apify Actor & MCP tool that audits any list of websites for Cloudflare Search for Agents (`/.well-known/search`), RFC 10008 `HTTP QUERY`, `Accept: text/markdown` token savings, `/llms.txt`, `/robots.txt` AI crawler policies, and optional 4-Tier Cascade BM25 search.**

Built for **AI engineering teams, SEO/GEO agencies, Cloudflare site operators, RAG builders, and autonomous MCP agents** (connect directly via `mcp.apify.com`).

***

### Why Use This Actor?

Most websites today still serve 200KB–500KB of HTML noise to AI agents — wasting **80%–95% of LLM input tokens**. Meanwhile, sites enabling **Cloudflare Search for Agents** without guardrails risk unexpected **$0.75/1k semantic query overages** once they pass the 500 pages/day free indexing allowance.

In **1 sub-second pass per URL** (zero headless browser, ultra-low memory, Pay-per-Event), this Actor executes **Cascade Discovery** across every target URL:

1. **`/.well-known/search` & RFC 10008 `HTTP QUERY` Probe:** Detects active Cloudflare Search for Agents endpoints, JSON manifests, OpenSearch XML, and `Allow: GET, HEAD, QUERY` method support.
2. **HTML & Frontmatter Discovery:** Extracts `<meta name="agent:endpoint">`, `agent:method`, `agent:instructions`, `<link rel="search">`, `Link` response headers, and YAML frontmatter `agent:` blocks.
3. **`Accept: text/markdown` (*Markdown for Agents*):** Checks native `Content-Type: text/markdown`, `Vary: Accept`, `x-markdown-tokens`, and calculates exact byte/token savings vs HTML.
4. **`/llms.txt` & `/llms-full.txt` Audit:** Detects curated AI documentation indexes and reports payload sizes.
5. **`/robots.txt` AI Crawler Matrix & `/sitemap.xml`:** Evaluates explicit/wildcard policies for `GPTBot`, `ClaudeBot`, `PerplexityBot`, `OAI-SearchBot`, `Google-Extended`, and `CCBot`.
6. **Cloudflare Overage Risk & Actionable Score (`0–100`, `A+–F`):** Flags unthrottled public `/.well-known/search` endpoints exposed to `$0.75/1k` query spikes and outputs prioritized fixes.
7. **Optional 4-Tier Cascade Search (`query` input):** Cascades `/.well-known/search` → `Accept: text/markdown` → `/llms.txt` → Edge HTML-to-Markdown + deterministic **BM25** chunk ranking so agents get clean chunks on **100% of websites on Day 1**.

### Built-In Security

- **DNS-verified SSRF Shield:** Resolves DNS via `node:dns/promises` before every request and re-verifies every redirect hop — blocking `localhost`, `127.0.0.1`, AWS/GCP/Azure metadata (`169.254.169.254`), RFC1918, CGNAT, IPv6 loopback/ULA, and non-HTTP(S) schemes.

***

### Example Input

```json
{
  "urls": [
    "https://blog.cloudflare.com/search-for-agents/",
    "https://danlopes18-ctrl.github.io/"
  ],
  "query": "markdown for agents",
  "checkBots": true,
  "includeMarkdownPreview": true,
  "maxChunks": 5,
  "concurrency": 5
}
```

### Example Dataset Output Item

```json
{
  "domain": "blog.cloudflare.com",
  "url": "https://blog.cloudflare.com/search-for-agents/",
  "statusCode": 200,
  "score": 80,
  "grade": "B+",
  "hasWellKnownSearch": true,
  "supportsHttpQuery": true,
  "allowedSearchMethods": ["GET", "HEAD", "QUERY"],
  "agentEndpoint": "https://blog.cloudflare.com/.well-known/search?q={query}",
  "supportsMarkdownNegotiation": true,
  "varyIncludesAccept": true,
  "hasLlmsTxt": false,
  "htmlBytes": 319853,
  "markdownBytes": 20557,
  "tokenSavingsPercent": 93.6,
  "overageRiskLevel": "high",
  "searchSourceTier": "tier1_well_known_search",
  "searchResult": {
    "query": "markdown for agents",
    "sourceTier": "tier1_well_known_search",
    "chunks": [
      {
        "rank": 1,
        "score": 1.0,
        "heading": "https://blog.cloudflare.com/markdown-for-agents",
        "text": "...",
        "estimatedTokens": 210
      }
    ],
    "totalEstimatedTokens": 630
  }
}
```

Plus an aggregate **`OUTPUT`** JSON record saved to the Key-Value Store containing run-wide adoption stats, average score, average token savings %, and domain leaderboard.

***

### Need Self-Hosted Workers & WAF Anti-Overage Guardrails?

- **Free Open-Source MCP Server (MIT):** https://github.com/danlopes18-ctrl/agent-search-mcp
- **Cloudflare Agent-Ready & Search Guardrails Kit ($29 — Free-tier `Accept: text/markdown` Worker polyfill + BM25 `/.well-known/search` Worker + WAF/Terraform anti-overage pack):** https://danlopes3.gumroad.com/l/cloudflare-agent-search-kit
- **Sub-Second REST Edge API (API.market):** https://api.market/store/danlopes18/edge-web-intel-api
- **More Zero-Dependency AI DevTools:** https://danlopes18-ctrl.github.io/

# Actor input Schema

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

List of website URLs or domains to audit for Cloudflare Search for Agents (/.well-known/search), Accept: text/markdown, /llms.txt, and AI bot readiness.

## `query` (type: `string`):

If provided, executes 4-tier Cascade Discovery search (/.well-known/search -> Accept: text/markdown -> /llms.txt -> HTML-to-Markdown + BM25) against every target URL and attaches top ranked chunks.

## `checkBots` (type: `boolean`):

Parse /robots.txt policies for GPTBot, ClaudeBot, PerplexityBot, OAI-SearchBot, Google-Extended, and CCBot, plus verify /sitemap.xml presence.

## `includeMarkdownPreview` (type: `boolean`):

Include a clean Markdown snippet (up to 2,500 chars) from native Markdown negotiation or Edge HTML-to-Markdown conversion.

## `maxChunks` (type: `integer`):

Maximum number of BM25/semantic chunks returned per URL when query is provided (1-15).

## `concurrency` (type: `integer`):

Number of target URLs to audit in parallel (1-20).

## `timeoutMs` (type: `integer`):

HTTP fetch timeout in milliseconds (2000-20000).

## Actor input object example

```json
{
  "urls": [
    "https://blog.cloudflare.com/search-for-agents/",
    "https://developers.cloudflare.com/",
    "https://danlopes18-ctrl.github.io/"
  ],
  "query": "markdown tokens search for agents",
  "checkBots": true,
  "includeMarkdownPreview": true,
  "maxChunks": 5,
  "concurrency": 5,
  "timeoutMs": 10000
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `items` (type: `string`):

No description

## `summary` (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://blog.cloudflare.com/search-for-agents/",
        "https://danlopes18-ctrl.github.io/"
    ],
    "query": "markdown for agents"
};

// Run the Actor and wait for it to finish
const run = await client.actor("danlopes18/agent-readiness-search-auditor").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://blog.cloudflare.com/search-for-agents/",
        "https://danlopes18-ctrl.github.io/",
    ],
    "query": "markdown for agents",
}

# Run the Actor and wait for it to finish
run = client.actor("danlopes18/agent-readiness-search-auditor").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://blog.cloudflare.com/search-for-agents/",
    "https://danlopes18-ctrl.github.io/"
  ],
  "query": "markdown for agents"
}' |
apify call danlopes18/agent-readiness-search-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,danlopes18/agent-readiness-search-auditor"
        }
    }
}
```

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/PBHXza9cBzd6FBS7K/builds/uChi60BSjAAkzAxRS/openapi.json
