# Forest Factory API – robots.context

> Forest Factory API – robots.context is a paid API for AI agents from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-20).

Fetches and interprets the robots.txt rules for a given URL and user agent, returning crawl permission decisions, matched rules, sitemaps, and crawl delay.

## Facts

- Endpoint: POST https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/robots/context?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forest-factory-api-robots-context-cdfbf798
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__gTCiC4LTT9jlv8_42FBG

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability forest-factory-api-robots-context-cdfbf798 -d '<json body>'
```

Example prompt: Check whether 'https://example.com/blog/post-1' allows crawling by the user agent 'MyBot/1.0' — I need to know the crawl decision, any matched rule, and the crawl delay before my scraper touches it.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable interpretation of robots.txt access rules for a specific URL and user agent combination — especially when you need the matched rule, crawl delay, and sitemaps in a single call. Prefer this over manually fetching and parsing robots.txt when you need reliable caching, scoped user-agent matching, and consistent decision logic without writing your own parser.

## Known failure modes

- URL is unreachable or returns a non-200 response — robots state may be 'unavailable'
- robots.txt does not exist on the target domain — rules list will be empty and state may be 'unavailable'
- Malformed URL input returns validation error
- Payment not signed — HTTP 402 with x402 PAYMENT-REQUIRED challenge
- Rate limits or upstream timeouts may increase duration_ms or return errors

## How this service works

Machine-readable contract for active Forest paid capabilities. Unsigned paid calls return HTTP 402 with a PAYMENT-REQUIRED x402 challenge.

## Output

Returns a JSON object with: crawl decision (allowed/disallowed), matched robots.txt rule with pattern/directive/specificity, full list of rules, sitemaps declared in robots.txt, crawl delay, robots state (available/unavailable), the resolved robots.txt URL, and metadata including cache status, provider, check timestamp, and duration in milliseconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "pattern": "^https?://",
   "maxLength": 2048,
   "minLength": 1,
   "description": "Public HTTP(S) URL to inspect, resolve, or compare."
  },
  "user_agent": {
   "type": "string",
   "maxLength": 128,
   "minLength": 1,
   "description": "Public user agent value used to scope this lookup."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "rules": [],
   "status": 1,
   "decision": "allowed",
   "sitemaps": [],
   "truncated": false,
   "robots_url": "example",
   "target_url": "example",
   "user_agent": "example",
   "crawl_delay": 0,
   "matched_rule": {
    "pattern": "example",
    "directive": "allow",
    "specificity": 0
   },
   "robots_state": "available",
   "matching_agents": [],
   "rendered_javascript": false
  },
  "meta": {
   "cache": "miss",
   "provider": "safe-http",
   "checked_at": "2026-01-01T00:00:00.000Z",
   "duration_ms": 0
  },
  "version": "1",
  "capability": "robots.context"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forest-factory-api-robots-context-cdfbf798/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run](https://www.zero.xyz/host/http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/llms.txt)
