Skip to main content
Website and HTTP

robots.txt builder and tester API

Build, edit, and test a robots.txt file visually using our daily-refreshed verified bots directory - start by loading any domain’s live robots.txt, pasting an existing file, or picking a preset. Approve, partially restrict, or block entire bot categories or individual crawlers, test URL paths live against RFC 9309 longest-match rules, catch public-disclosure security mistakes, and save drafts in your browser to come back later.

POSTapi.middle.network/v1/tools/robots-builder
1 unit a callLive lookup

Request builder & body

Send JSON: { "input": { … } } with these fields. Fields not listed are ignored. Edit or toggle options below to build your exact query live across every language.

1 field active
  • stringrequired
    Draft or existing robots.txt contents to validate, audit for security warnings, and test against URL paths.
    Up to 131,072 characters · Example User-agent: * Allow: / User-agent: GPTBot Disallow: / Sitem...
  • stringoptional
    Optional domain label for the draft robots.txt.
    Up to 253 characters · Example "example.com"
  • list of stringsoptional
    Optional list of URLs or paths (e.g. /blog/post, /admin/) to test with RFC 9309 longest-match rules.
    Up to 20 items
  • list of stringsoptional
    Optional list of User-agent tokens to evaluate (defaults to major search, AI search, and AI training bots).
    Up to 25 items

Response

The same result shape every tool uses. status is the worst finding, summary and each finding come in plain and tech, and data holds the raw robots.txt builder and tester detail.

  • 200The test ran. RateLimit headers show what’s left today.
  • 400The input broke the schema, or the target is not valid (with suggestions when it looks like a typo).
  • 401No API key, or the key is not valid or was revoked.
  • 403The target’s owner has asked not to be tested (optedOut), or active tools are disabled on this server (activeTool).
  • 429Too many checks: per minute, per day, or at the same target.
  • 503The server is at its concurrent-run limit. Try again in a few seconds.
Request
curl -X POST https://api.middle.network/v1/tools/robots-builder \
  -H "Authorization: Bearer $MN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"text":"User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/sitemap.xml"}}'
$result = Invoke-RestMethod -Method Post `
  -Uri "https://api.middle.network/v1/tools/robots-builder" `
  -Headers @{ Authorization = "Bearer $env:MN_API_KEY" } `
  -ContentType "application/json" `
  -Body '{"input":{"text":"User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/sitemap.xml"}}'
$result.status; $result.summary.plain
const res = await fetch("https://api.middle.network/v1/tools/robots-builder", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"input":{"text":"User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/sitemap.xml"}}),
});
const result = await res.json();
console.log(result.status, result.summary.plain);
import os, requests

res = requests.post("https://api.middle.network/v1/tools/robots-builder",
    headers={"Authorization": f"Bearer {os.environ['MN_API_KEY']}"},
    json={"input": {"text": "User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/sitemap.xml"}})
result = res.json()
print(result["status"], result["summary"]["plain"])
body := bytes.NewBufferString("{\"input\":{\"text\":\"User-agent: *\\nAllow: /\\n\\nUser-agent: GPTBot\\nDisallow: /\\n\\nSitemap: https://example.com/sitemap.xml\"}}")
req, _ := http.NewRequest("POST", "https://api.middle.network/v1/tools/robots-builder", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("MN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
io.Copy(os.Stdout, res.Body)
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("MN_API_KEY"));
using var content = new StringContent("{\"input\":{\"text\":\"User-agent: *\\nAllow: /\\n\\nUser-agent: GPTBot\\nDisallow: /\\n\\nSitemap: https://example.com/sitemap.xml\"}}", Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://api.middle.network/v1/tools/robots-builder", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
{
  "input": {
    "text": "User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/sitemap.xml"
  }
}
Insomnia
200 sample
{
  "tool": "robots-builder",
  "target": "User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/sitemap.xml",
  "status": "pass",
  "summary": {
    "tech": "…",
    "plain": "…"
  },
  "findings": [
    {
      "level": "pass",
      "tech": "…",
      "plain": "…"
    }
  ],
  "data": {},
  "ms": 420,
  "at": "2026-01-01T00:00:00.000Z"
}

Put your key in MN_API_KEY. No key yet? Here’s how to get one. Need all 79 endpoints? Download the full Postman collection. More in this group: HTTP check, Redirect tracer, Bulk redirect checker, Security headers.

Try it without code

The same test runs free in your browser, no key needed.

Open the robots.txt builder and tester