Parse robots.txt
web.parse_robots_txt
Overview
You hand us the text of a robots.txt file and we split it into user-agent groups, work out whether one path is crawlable by one agent, and collect the Sitemap lines. Matching follows RFC 9309: the longest matching rule wins, and Allow beats Disallow when two rules tie on length. We only read the content you send, never the network, and the answer is crawl etiquette rather than an access control you can rely on.
Robots rules look simple and then bite: longest-match and tie-breaking are easy to get wrong by hand, and you want the same answer every time you ask.
Reliability
Same file, same agent, same path, same answer, every time, with nothing leaving the platform. A few behaviours are worth knowing before you trust the result: a rule matches as a prefix of your path, "*" matches any run of characters, and a trailing "$" anchors the end; an empty Disallow value matches nothing, so it leaves the path crawlable; a group is chosen because its token appears inside the agent name you sent, so a short token like "bot" can capture an agent you did not expect; and when no group matches and there is no "*" group, we answer allowed:true with no matchedRule. Bad input is rejected outright and retrying will not help — missing content, content over 2000000 characters, or, when strict is true, the first malformed or unrecognised directive line.
Context footprint
The response grows with the file: every group and rule comes back, so a very long robots.txt returns a correspondingly long groups array. A successful call costs 1 execution credit.
When to use it
Before you crawl a path, or when auditing crawl rules from a file you already hold. If the next step is an SEO robots check such as seo.simulate_robot_access, start from seo.parse_robots_txt instead — this twin also answers the path in the same call.
When the rules still need fetching, or when the answer would gate access to something that matters.
Scope
Non-goals
- Does not fetch robots.txt, or anything else, over the network
- Does not crawl, queue, or schedule crawls
- Does not percent-decode paths before matching them
- Does not honour Crawl-delay, Host, or other non-standard lines
- Is crawl etiquette, never an authorization or security control
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | robots.txt content to parse. |
| userAgent | string | No | User-agent token evaluated against the groups; omit it for *. |
| path | string | Yes | Origin-relative path evaluated against rules. |
| baseUrl | string | No | Optional absolute origin used to resolve sitemap values; omit it to keep them as written. |
| includeSitemaps | boolean | No | Whether sitemap declarations are returned; omit it for true. |
| strict | boolean | No | Whether malformed directives are errors; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| allowed | boolean | Yes | Whether the selected path is allowed. |
| matchedRule | object | No | Closed matched-rule receipt with directive, pattern, and source-order properties. Its documented web receipt properties are bounded to 128 entries — unconstrained RFC 8259 JSON items. |
| groups | array | Yes | Bounded array of parsed user-agent group receipts in source order. The item shape is defined by the nested schema and the array contains from 0 through 10000 items. |
| sitemaps | array | Yes | Bounded array of sitemap locations in source order. The item shape is defined by the nested schema and the array contains from 0 through 10000 items. |
| warnings | array | No | Bounded array of non-fatal safe warning strings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"web.parse_robots_txt","input":{"content":"User-agent: *\nDisallow: /private","path":"/private"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("web.parse_robots_txt", {"path":"/private/page.html","content":"User-agent: *\nDisallow: /private\n","userAgent":"SquillifyBot"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not fetch robots.txt, or anything else, over the network
- Does not crawl, queue, or schedule crawls
- Does not percent-decode paths before matching them
- Does not honour Crawl-delay, Host, or other non-standard lines
- Is crawl etiquette, never an authorization or security control
- Fetching robots.txt for a domain — bring the text with you instead
- Deciding who may reach a resource, which needs a real access control
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "web.parse_robots_txt",
"input": {
"path": "/private/page.html",
"content": "User-agent: *\nDisallow: /private\n",
"userAgent": "SquillifyBot"
}
}Examples
Disallow blocks a private path
{
"path": "/private/page.html",
"content": "User-agent: *\nDisallow: /private\n",
"userAgent": "SquillifyBot"
}{
"warnings": [],
"matchedRule": {
"directive": "Disallow",
"pattern": "/private",
"line": 2
},
"sitemaps": [],
"allowed": false,
"groups": [
{
"rules": [
{
"directive": "Disallow",
"line": 2,
"value": "/private"
}
],
"userAgents": [
"*"
]
}
]
}Longer Allow wins over shorter Disallow
{
"path": "/private/public/page",
"content": "User-agent: *\nDisallow: /private\nAllow: /private/public\n"
}{
"warnings": [],
"matchedRule": {
"directive": "Allow",
"pattern": "/private/public",
"line": 3
},
"sitemaps": [],
"allowed": true,
"groups": [
{
"rules": [
{
"directive": "Disallow",
"line": 2,
"value": "/private"
},
{
"directive": "Allow",
"line": 3,
"value": "/private/public"
}
],
"userAgents": [
"*"
]
}
]
}Recommended use cases
- Check a path is crawlable before you queue it
- Pull the sitemap URLs a site declares in its robots.txt
- Audit the crawl rules in a saved robots.txt snapshot
Avoid for
- Fetching robots.txt for a domain — bring the text with you instead
- Deciding who may reach a resource, which needs a real access control
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.