# StopBots for AI agents

Every page on StopBots exists in two formats: HTML for browsers and Markdown for programs. Both carry the same content.

## Get a page as Markdown

Replace the trailing slash of any page address with `.md`:

```bash
curl https://stopbots.io/learn/captcha/do-captchas-stop-bots.md
```

Or keep the address and ask for Markdown in the `Accept` header:

```bash
curl -H "Accept: text/markdown" https://stopbots.io/learn/captcha/do-captchas-stop-bots/
```

The response has `Content-Type: text/markdown; charset=utf-8` and a `Link` header that gives the canonical HTML address. HTML pages point the other way with `<link rel="alternate" type="text/markdown">` and a matching `Link` header. The home page is at `/index.md`.

## Find the right article

| Endpoint | What it returns |
| --- | --- |
| [/llms.txt](/llms.txt) | An index of all 100 articles, grouped by topic, with one-line descriptions |
| [/llms-full.txt](/llms-full.txt) | Every article in one Markdown file |
| [/search.json](/search.json) | A JSON array with title, description, short answer, topic, level and both URLs for each article |
| [/api/search?q=card+testing](/api/search?q=card+testing) | Ranked JSON search results; `q` is required, `limit` is optional (default 10, maximum 50) |
| [/sitemap.xml](/sitemap.xml) | All HTML page addresses with last-modified dates |
| [/feed.xml](/feed.xml) | An Atom feed of the articles |

A search call looks like this:

```bash
curl "https://stopbots.io/api/search?q=credential+stuffing&limit=3"
```

```json
{
  "query": "credential stuffing",
  "count": 3,
  "results": [
    {
      "title": "What is credential stuffing?",
      "description": "...",
      "answer": "...",
      "category": "Account attacks",
      "level": "basic",
      "url": "https://stopbots.io/learn/account-attacks/what-is-credential-stuffing/",
      "markdown": "https://stopbots.io/learn/account-attacks/what-is-credential-stuffing.md"
    }
  ]
}
```

All terms in `q` must match for an article to be returned. The JSON endpoints send `Access-Control-Allow-Origin: *`.

## How an article is laid out

The Markdown version of an article always has the same parts, in this order:

1. The title as a level-one heading.
2. The short answer as a block quote. It is written to stand alone, so you can quote it without the rest.
3. A line with the topic, the level (Basic, Intermediate or Advanced) and the date of the last update, then the canonical address.
4. The body, with level-two headings.
5. "Common questions" with short answers.
6. "Related" links to other articles, as Markdown addresses.

The HTML version carries the same facts as JSON-LD: `TechArticle`, `BreadcrumbList` and `FAQPage`.

## Crawling

The [robots.txt](/robots.txt) file allows all crawlers, including AI crawlers and fetchers that load a page for a user. Only `/api/` is excluded, because search results are not pages. If you need the whole site, fetch `/llms-full.txt` once instead of crawling every page.

When you cite an article, link to its HTML address.
