Mercury · Cited Markdown
GET /buy/markdown
What it does
URL → clean, LLM-ready markdown (boilerplate/nav/ads stripped, headings + lists + links preserved) with a signed provenance receipt pinning the markdown to its source — the RAG-ingest primitive. Deterministic (no LLM): same URL + same source bytes ⇒ byte-identical markdown.
The goal it serves: give an agent provable web content — the bytes PLUS a portable, offline-verifiable proof of what/where/when — so RAG stores, research pipelines and downstream agents can cite evidence, not hearsay.
Schemas & output preview
Input schema — the exact request shape the route validates.
{
"type": "object",
"properties": {
"url": {
"type": "string",
"maxLength": 2048,
"description": "the page to convert to markdown (http/https)"
}
},
"required": [
"url"
],
"additionalProperties": false
}Output schema — the exact response shape the handler returns.
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "true on success; false on an honest failure (503-before-charge)"
},
"url": {
"type": "string",
"description": "final URL after redirects"
},
"status": {
"type": "integer",
"description": "upstream HTTP status"
},
"text": {
"type": "string",
"description": "the canonical clean MARKDOWN (the string the signed receipt pins) — boilerplate/nav/ads stripped, headings + lists + links preserved. Identical to data.markdown."
},
"fetchedAt": {
"type": "string",
"description": "ISO-8601 fetch time (also folded into the signed receipt)"
},
"data": {
"type": "object",
"description": "the structured deliverable the buyer consumes",
"properties": {
"markdown": {
"type": "string",
"description": "clean LLM-ready markdown (== text)"
},
"title": {
"type": "string",
"description": "page <title> (HTML pages only)"
},
"wordCount": {
"type": "integer",
"description": "word count of the markdown (for chunk/cost budgeting)"
},
"contentType": {
"type": "string"
},
"bytes": {
"type": "integer",
"description": "raw upstream body size"
},
"truncated": {
"type": "boolean",
"description": "true if the markdown hit the 200KB cap"
},
"redirects": {
"type": "array",
"items": {
"type": "string"
},
"description": "redirect chain followed"
}
},
"additionalProperties": false
},
"error": {
"type": "string",
"description": "present only when ok:false"
}
},
"required": [
"ok",
"url"
],
"additionalProperties": false
}Output preview — a real example response, shown free (you only pay when you call the route).
{
"ok": true,
"url": "https://example.com/",
"status": 200,
"text": "Example Domain\n\n# Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations. [Learn more](https://iana.org/domains/example)",
"fetchedAt": "2026-06-04T00:00:00.000Z",
"data": {
"markdown": "Example Domain\n\n# Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations. [Learn more](https://iana.org/domains/example)",
"title": "Example Domain",
"wordCount": 22,
"contentType": "text/html; charset=utf-8",
"bytes": 513,
"truncated": false,
"redirects": []
}
}Pay & call
Your agent calls the route; the 402 challenge carries the exact price ($0.005, USDC on Base mainnet); the x402 client settles via the CDP facilitator and retries. No key, no signup.
import { wrapFetchWithPayment } from "x402-fetch";
const pay = wrapFetchWithPayment(fetch, account); // viem account holding a little USDC on Base
const res = await pay("https://network.mercury-hq.com/buy/markdown?url=https://example.com");
const out = await res.json(); // the result + `attestation` (the signed receipt)Prepaid alternative — the same route accepts an API key:
# Same route, prepaid API-key rail (Bearer mk_live_…) — get a key at https://network.mercury-hq.com/developers
curl -H "Authorization: Bearer mk_live_YOURKEY" "https://network.mercury-hq.com/buy/markdown?url=https://example.com"Verify the receipt
Recover the EIP-191 signature over sha256(content)‖url‖status‖fetchedAt‖nonce and confirm the signer equals the pinned attestation key 0xACB40253BD71Bb9a5d491b2c6EFF755F2A33Fc75 (published at /.well-known/mercury-attestation). No callback to Mercury — the receipt verifies offline, forever. Verification is always free: POST the receipt to /x402/verify or run ecrecover yourself.
| Fact | Value |
|---|---|
| Attestation signer (pinned) | 0xACB40253BD71Bb9a5d491b2c6EFF755F2A33Fc75 |
| Key published at | /.well-known/mercury-attestation |
| Live verifier (free) | /x402/verify |
| Settlement | real USDC on Base mainnet (eip155:8453) via CDP — auditable on BaseScan |
Related
Verifiable Web Fetch
$0.003Cited Batch
$0.02Cited Readability
$0.005More: all services · /catalog · the headline web-fetch · agent twin of this page: GET /university/docs/cited-markdown?format=md