v0.1.0API Reference

Documentation

Convert any URL to clean, structured content in one request. No SDK. No auth. No setup.

Base URL
https://markdownforagents.com
Endpoints
GET/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.

request
curl "https://markdownforagents.com/r?url=example.com"
response · text/markdown
---
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)
GET/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.

response · application/json
{
  "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" }
}
Response Headers

Both endpoints return these diagnostic headers.

HeaderExampleDescription
X-Token-Count42Estimated token count of the response body
X-Page-TypearticleDetected page category (article, product, search, listing, unknown)
X-Conversion-Strategyai-tomarkdownWhich conversion tier was used
X-Source-Formattext/htmlOriginal content-type of the upstream response
X-Generation-Ms3.2Enrichment processing time in milliseconds
Supported Formats

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)
Error Codes

Standard HTTP status codes.

  • 400Missing url parameter
  • 403SSRF blocked — private IP, localhost, or unsafe scheme
  • 413Upstream response exceeds 2 MB
  • 415Unsupported content type (e.g. video/mp4)
  • 502Upstream returned an error
Interactable Detection

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).

interactable shape
{ "ref": 1, "role": "button", "name": "Add to Cart", "affordance": "click" }
Constraints
10sFetch timeout
2 MBMax response size
No authRequired
MarkdownForAgents © 2026  ·  Home