API Reference

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/checkRun a Markdown-for-AI check (JSON)
OPTIONS/api/checkCORS preflight
POST/check, /:locale/checkBack-compat form submission
GET/?url=…Shareable result page (HTML)
GET/:locale?url=…Localised shareable result page
GET/sitemap.xmlSEO sitemap
GET/robots.txtrobots.txt
GET/api/openapi.yaml · .jsonThis spec, machine-readable
GET/api/docsThis 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)

FieldTypeDescription
inputstringRaw user input, unchanged.
normalisedUrlstringInput after sanitisation + new URL().
cloudflare"yes" | "no" | "unknown"Was the origin served via Cloudflare?
cloudflareSignalsstring[]Human-readable indicators (e.g. server: cloudflare).
successbooleanAt least one strategy returned valid Markdown.
winningStrategy"accept" | "suffix" | "query" | nullStrategy that succeeded, or null.
attemptsStrategyAttempt[]One entry per strategy tried, stops early on success.
reasonCodesReasonCode[]Machine-readable failure reasons.
durationMsnumberWall-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 Accept header 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