Documentation
Convert any URL to clean, structured content in one request. No SDK. No auth. No setup.
https://markdownforagents.com /r?url={url}Returns clean Markdown with YAML frontmatter. The frontmatter carries machine-readable metadata so agents can parse title, type, and token count without reading the body.
curl "https://markdownforagents.com/r?url=example.com"
--- url: https://example.com title: "Example Domain" type: unknown tokens: 42 --- # Example Domain This domain is for use in illustrative examples... ## Actions [1] link: Learn more (click)
/map?url={url}Returns a structured PageMap JSON — interactables (buttons, forms, CTAs), metadata, images, and content stats. Useful when your agent needs to know what it can do, not just what it can read.
{
"url": "https://example.com",
"title": "Example Domain",
"page_type": "unknown",
"content": "# Example Domain\n\n...",
"interactables": [
{ "ref": 1, "role": "link", "name": "Learn more", "affordance": "click" }
],
"metadata": { "title": "Example Domain", "language": "en" },
"stats": { "tokenCount": 42, "conversionStrategy": "ai-tomarkdown" }
}Both endpoints return these diagnostic headers.
| Header | Example | Description |
|---|---|---|
X-Token-Count | 42 | Estimated token count of the response body |
X-Page-Type | article | Detected page category (article, product, search, listing, unknown) |
X-Conversion-Strategy | ai-tomarkdown | Which conversion tier was used |
X-Source-Format | text/html | Original content-type of the upstream response |
X-Generation-Ms | 3.2 | Enrichment processing time in milliseconds |
Pass any of these as the url parameter.
.htmlWeb pages.pdfPDF documents.docxWord documents.xlsxExcel spreadsheets.pptxPowerPoint files.csvCSV data.txtPlain text (passthrough).mdMarkdown (passthrough)
Standard HTTP status codes.
400Missing url parameter403SSRF blocked — private IP, localhost, or unsafe scheme413Upstream response exceeds 2 MB415Unsupported content type (e.g. video/mp4)502Upstream returned an error
The /map endpoint detects buttons, inputs, selects, and CTA links — scoped to the <main> content area. Navigation, modals, and cookie banners are excluded by design. Results are deduplicated and labeled with a ref number, role, and affordance (click, type, or select).
{ "ref": 1, "role": "button", "name": "Add to Cart", "affordance": "click" }