# Robots.txt Policy Evidence API (`soilair/robots-txt-policy-evidence-api`) Actor

Extract public robots.txt directives, policy hashes and declared sitemap URLs. Compare policy changes and inspect explicitly labelled Python parser evaluations.

- **URL**: https://apify.com/soilair/robots-txt-policy-evidence-api.md
- **Developed by:** [Salih Can Kurnaz](https://apify.com/soilair) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 policy observations

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

## Robots.txt Policy Evidence API

Extract public robots.txt directives, policy hashes and declared sitemap URLs. Compare policy changes and inspect explicitly labelled Python parser evaluations.

### Quick start

```json
{
  "urls": [
    "https://www.python.org/downloads/"
  ],
  "userAgents": [
    "*",
    "Googlebot",
    "GPTBot"
  ]
}
```

Download the default dataset as JSON, CSV or Excel. Read OUTPUT before relying on completeness; source availability can change. Use sources you are authorized to access.

### Documented behavior and limits

Reads the origin robots.txt and returns recognized directives with line numbers, unmodified declared sitemap addresses, a policy-text hash and target-path evaluations explicitly labelled PYTHON_ROBOTFILEPARSER. A 404/410 policy produces MISSING and a billable missing-policy observation; 403, 429, server errors or HTML responses are source errors with permission unknown. This Actor does not fetch the target page or sitemap addresses. Evaluation uses Python RobotFileParser, not a Googlebot/GPTBot implementation or complete RFC 9309 conformance validator: wildcard/end-anchor, group specificity and percent-encoding behavior can differ from actual crawlers. Treat the raw policy as evidence and the canFetch value as interpreter output, not access authorization, indexing or AI-training permission. Only syntactic directives are returned; sitemap addresses are not validated or fetched.

### Changes and snapshots

Each result includes itemKey, contentHash and observedAt. Pass SNAPSHOT.previousHashes in the next input. NO_BASELINE means no prior map; FIRST_SEEN means absent from a supplied map; UNCHANGED/CHANGED compare hashes. FIRST_SEEN does not prove newly created content. Snapshot contains only emitted rows. Missing rows are not deletions. No hidden persistence or scheduled tasks. For header observations, redirect trace is excluded from the hash; it remains in output. Other observations hash their normalized fields, excluding pagination source URL and time.

### Pricing

$0.0015 per emitted policy observation ($1.5 per 1,000), plus $0.005 Actor-start at the default 256 MB. Higher memory can multiply startup events under Apify rules. Event-only pricing includes platform usage; no paid upstream API, proxy or browser. Failed sources incur no result event, but the start event can apply. An intentional missing-policy observation is billable for the robots product. Check Store pricing before running. Budget truncation sets PARTIAL_BUDGET and complete=false.

### Network and data

Public HTTP(S), ports 80/443 only; credentials and private IPs rejected. DNS addresses are validated and pinned while TLS hostname verification stays enabled. Up to five redirects, 2 MiB decoded responses and approximately 95 seconds network budget. Site/content/spec fetches respect robots.txt; missing 404/410 policy allows access, unavailable/denied policy is an error. The robots product reads the policy file itself and never requests the evaluated page. No login, cookies, proxy, access-block workaround, external reference fetching or active security tests. All failed sources are reported; successful sources can continue. A run with no rows and source errors fails; valid empty collections/specs can succeed. Sources, redirects and their robots files are the only network targets. Inputs and output stay in your Apify run storage under platform retention; no separate customer analytics endpoint. Do not provide secrets.

### Integration and support

POST https://api.apify.com/v2/actors/soilair~robots-txt-policy-evidence-api/runs with your Apify authorization header and input JSON. Poll the returned run and retrieve its defaultDatasetId and defaultKeyValueStoreId for OUTPUT/SNAPSHOT. Configure integrations/schedules in Console if needed; the Actor creates neither. Developed with AI assistance, fixtures and public-source/cloud checks. Examples do not establish arbitrary-source compatibility. Report a run ID and expected behavior through the issue tab without credentials.

Source specification: https://www.rfc-editor.org/rfc/rfc9309.html

# Actor input Schema

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

1..10 public HTTP(S) URLs. No credentials or private hosts.

## `previousHashes` (type: `object`):

At most 2000 itemKey to lowercase SHA256 mappings from previous SNAPSHOT. No deletion inference.

## `userAgents` (type: `array`):

Python RobotFileParser evaluations; actual crawler matching can differ. Maximum five simple tokens.

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/downloads/"
  ],
  "previousHashes": {},
  "userAgents": [
    "*",
    "Googlebot",
    "GPTBot"
  ]
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `snapshot` (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://www.python.org/downloads/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("soilair/robots-txt-policy-evidence-api").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://www.python.org/downloads/"] }

# Run the Actor and wait for it to finish
run = client.actor("soilair/robots-txt-policy-evidence-api").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://www.python.org/downloads/"
  ]
}' |
apify call soilair/robots-txt-policy-evidence-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,soilair/robots-txt-policy-evidence-api"
        }
    }
}
```

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/ftPbhHxf07prRl1CW/builds/otINkYK0sIo0SE6Ul/openapi.json
