# Robots.txt Check (`web.robots`)

Fetch and parse a site's robots.txt: rule groups, sitemaps, whether a path is allowed for a user agent, and which AI crawlers are blocked.

- **Route:** `POST /v1/run/web.robots`
- **Price:** $0.0005 per request ($0.50 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs network checks (`netcheck`) · failover: no
- **Measured latency:** p50 192 ms · p95 192 ms · p99 192 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `url` | string | yes |  | Any URL of the site |
| `user_agent` | string | no | "Googlebot" | User agent to test |
| `path` | string | no | "/" | Path to test |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `exists` | True when a robots.txt is served. |
| `groups` | User-agent groups with allow, disallow and crawl-delay. |
| `sitemaps` | Declared sitemaps. |
| `test` | Whether the user agent may fetch the path. |
| `ai_crawlers` | Whether each AI crawler may fetch the home page. |
| `blocks_all_crawlers` | True when * is disallowed from /. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/web.robots \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.wikipedia.org","user_agent":"GPTBot","path":"/wiki/Main_Page"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('web.robots', {'url': 'https://www.wikipedia.org', 'user_agent': 'GPTBot', 'path': '/wiki/Main_Page'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run web.robots '{"url":"https://www.wikipedia.org","user_agent":"GPTBot","path":"/wiki/Main_Page"}'
```

Quote first (free, validates input): `POST /v1/quote/web.robots` with the same body.
