Markdown for AI Tester API
Programmatic access to the same Markdown-for-AI probe that powers ai-markdown.com. OpenAPI 3.1 spec, permissive CORS, no authentication required.
Base URL
https://ai-markdown.com
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /api/check | Run a Markdown-for-AI check (JSON) |
| OPTIONS | /api/check | CORS preflight |
| POST | /check, /:locale/check | Back-compat form submission |
| GET | /?url=… | Shareable result page (HTML) |
| GET | /:locale?url=… | Localised shareable result page |
| GET | /sitemap.xml | SEO sitemap |
| GET | /robots.txt | robots.txt |
| GET | /api/openapi.yaml · .json | This spec, machine-readable |
| GET | /api/docs | This page |
Quick start
curl
curl -sG 'https://ai-markdown.com/api/check' \
--data-urlencode 'url=https://developers.cloudflare.com/workers/' | jq '.result.success,.result.winningStrategy'
JavaScript (fetch)
const r = await fetch(
'https://ai-markdown.com/api/check?url=' + encodeURIComponent('example.com')
);
const { ok, result } = await r.json();
console.log(result.success, result.winningStrategy, result.reasonCodes);
Python (requests)
import requests
r = requests.get(
'https://ai-markdown.com/api/check',
params={'url': 'https://developers.cloudflare.com/workers/'},
timeout=15,
)
data = r.json()
print(data['result']['success'], data['result']['winningStrategy'])
Response schema (CheckResult)
| Field | Type | Description |
|---|---|---|
input | string | Raw user input, unchanged. |
normalisedUrl | string | Input after sanitisation + new URL(). |
cloudflare | "yes" | "no" | "unknown" | Was the origin served via Cloudflare? |
cloudflareSignals | string[] | Human-readable indicators (e.g. server: cloudflare). |
success | boolean | At least one strategy returned valid Markdown. |
winningStrategy | "accept" | "suffix" | "query" | null | Strategy that succeeded, or null. |
attempts | StrategyAttempt[] | One entry per strategy tried, stops early on success. |
reasonCodes | ReasonCode[] | Machine-readable failure reasons. |
durationMs | number | Wall-clock duration. |
Full machine-readable schema: openapi.yaml · openapi.json
Reason codes
notCloudflare- Origin is not served through Cloudflare.
notEnabled- On Cloudflare but Markdown-for-AI is not configured.
blocked- The
Acceptheader was ignored; HTML was returned. status4xx/status5xx- Upstream returned a client / server error.
timeout- Upstream did not respond within 8 s.
invalidUrl- Input could not be parsed, or host was private / internal.
fetchFailed- Transport-level fetch error (DNS, TLS, etc.).
CORS & auth
- No authentication — public rate-limited endpoint.
Access-Control-Allow-Origin: *— callable from any browser origin.Cache-Control: no-store— never cached at the edge.- Rate limits are enforced at the Cloudflare edge — expect
429+ Managed Challenge under abuse.
SDK generation
The spec is plain OpenAPI 3.1 — generate a client with any compatible tool. Cloudflare's edge may challenge generic library user-agents, so it's simplest to download the spec first and run generators against the file:
# Download once
curl -s https://ai-markdown.com/api/openapi.yaml -o openapi.yaml
# TypeScript types via openapi-typescript
npx openapi-typescript openapi.yaml -o ./api-types.ts
# Python client via openapi-python-client
openapi-python-client generate --path openapi.yaml
# Any language via openapi-generator
openapi-generator-cli generate -i openapi.yaml -g <lang> -o ./client