AY Rank robots.txt testing API
Test whether a crawler may fetch a URL under a site's robots.txt.
Test whether a crawler may fetch a URL under a site's robots.txt.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ayrank-com:ayrank-com-robots-txt-testing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: AY Rank Free Tools robots.txt testing API
version: 1.0.0
summary: Free JSON API for AY Rank SEO and GEO tools.
description: 'Public JSON versions of the free tools at https://www.ayrank.com/tools. Every endpoint takes GET with query parameters or POST with a JSON body (max 32768 bytes). Free, no key. Rate limit: 30 requests per 60 seconds per IP, shared across all /api/v1 tools. Each success response includes a poweredBy link back to the tool page.'
termsOfService: https://www.ayrank.com/terms
contact:
name: AY Rank
url: https://www.ayrank.com
servers:
- url: https://www.ayrank.com
tags:
- name: robots.txt testing
description: Test whether a crawler may fetch a URL under a site's robots.txt.
paths:
/api/v1/robots-txt-tester:
get:
tags:
- robots.txt testing
summary: Test a URL against robots.txt
description: 'Fetches the site''s /robots.txt (up to 5 redirects, first 500 KiB) and applies RFC 9309: the group naming the user agent (case-insensitive) or else the * group, longest matching path, Allow wins a tie, * and $ wildcards, percent-encoded comparison. A 4xx robots.txt allows everything; a 5xx or no answer blocks everything. Returns allowed, the deciding line and lines that decide nothing. Public http(s) URLs on ports 80 and 443 only; a blocked or invalid URL returns 400. Free, no key. Rate limit: 30 requests per 60 seconds per IP, shared across all /api/v1 tools.'
externalDocs:
description: Use the tool in a browser
url: https://www.ayrank.com/tools/robots-txt-tester
operationId: robotsTxtTesterGet
parameters:
- name: url
in: query
required: true
description: The page to test, like https://example.com/blog/post. Path and query are matched.
schema:
type: string
- name: userAgent
in: query
required: false
description: 'robots.txt product token (letters, - and _). Default Googlebot. Presets: Googlebot, Bingbot, GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, PerplexityBot, Google-Extended, Applebot-Extended, CCBot.'
schema:
type: string
responses:
'200':
description: Result
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Reset:
$ref: '#/components/headers/X-RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/RobotsTxtTesterResponse'
'400':
$ref: '#/components/responses/BadRequest'
'429':
$ref: '#/components/responses/RateLimited'
post:
tags:
- robots.txt testing
summary: Test a URL against robots.txt
description: 'Fetches the site''s /robots.txt (up to 5 redirects, first 500 KiB) and applies RFC 9309: the group naming the user agent (case-insensitive) or else the * group, longest matching path, Allow wins a tie, * and $ wildcards, percent-encoded comparison. A 4xx robots.txt allows everything; a 5xx or no answer blocks everything. Returns allowed, the deciding line and lines that decide nothing. Public http(s) URLs on ports 80 and 443 only; a blocked or invalid URL returns 400. Free, no key. Rate limit: 30 requests per 60 seconds per IP, shared across all /api/v1 tools.'
externalDocs:
description: Use the tool in a browser
url: https://www.ayrank.com/tools/robots-txt-tester
operationId: robotsTxtTesterPost
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RobotsTxtTesterRequest'
responses:
'200':
description: Result
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Reset:
$ref: '#/components/headers/X-RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/RobotsTxtTesterResponse'
'400':
$ref: '#/components/responses/BadRequest'
'429':
$ref: '#/components/responses/RateLimited'
components:
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
X-RateLimit-Reset:
description: Seconds until the window resets.
schema:
type: integer
X-RateLimit-Remaining:
description: Requests left in the current window.
schema:
type: integer
X-RateLimit-Limit:
description: Requests allowed per window.
schema:
type: integer
responses:
BadRequest:
description: 'Invalid input: unknown field, wrong type, missing required field, value too long, or bad JSON.'
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Reset:
$ref: '#/components/headers/X-RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: Rate limit hit. Wait Retry-After seconds.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Reset:
$ref: '#/components/headers/X-RateLimit-Reset'
Retry-After:
$ref: '#/components/headers/Retry-After'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
Error:
type: object
required:
- error
- docs
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
enum:
- invalid_input
- rate_limited
message:
type: string
docs:
type: string
format: uri
RobotsTxtTesterResponse:
type: object
required:
- url
- path
- userAgent
- allowed
- robots
- result
- robotsTxt
- checkedAt
- poweredBy
properties:
url:
type: string
path:
type: string
description: Path plus query string, the part robots.txt rules match.
userAgent:
type: string
allowed:
type: boolean
robots:
type: object
description: robots.txt URL, final URL after redirects, HTTP status (null when the site did not answer), redirects followed, and tooManyRedirects.
result:
type: object
description: 'decision: { allowed, reason, rule, via, agentLines }. reason is rule, no-rule-matched, no-group, empty-file, robots-txt-path, file-unavailable (4xx), file-unreachable (5xx or no answer) or too-many-redirects. rule is { allow, pattern, line, text } of the deciding line. via is named or wildcard. Also ignored (lines that decide nothing, with line numbers), sitemaps, bytes, truncated (file over 500 KiB) and groupCount.'
robotsTxt:
type:
- string
- 'null'
description: The robots.txt body read (2xx only), up to 500 KiB.
checkedAt:
type: string
format: date-time
poweredBy:
$ref: '#/components/schemas/PoweredBy'
PoweredBy:
type: object
required:
- text
- url
properties:
text:
type: string
const: Powered by AY Rank
url:
type: string
format: uri
RobotsTxtTesterRequest:
type: object
required:
- url
additionalProperties: false
properties:
url:
type: string
maxLength: 2000
description: The page to test.
userAgent:
type: string
maxLength: 64
pattern: ^[A-Za-z_-]+$
description: robots.txt product token. Default Googlebot.
examples:
- url: https://example.com/blog/post
userAgent: GPTBot