Web page to clean Markdown API
Markdown of a live web page for LLM context: final URL after up to 5 validated redirects, HTTP status, content type, title, meta description, lang, Markdown (main content by default: <main>/<article>, without scripts, navigation, asides, footers), word count, token estimate, link count and truncation flag. PDF, DOCX, XLSX, OpenDocument, CSV and XML URLs are converted too; plain text is passed through. Conversion: Cloudflare Workers AI toMarkdown. DNS via Cloudflare DoH.
$0.003 per call USDC over x402 v2 on Base, Polygon, Arbitrum, Avalanche or Sei. No signup, no API key. Requests that fail or match nothing are not charged.
Endpoint
GET https://web.kit-rx.com/v1/web/markdown
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | http or https URL of the page (a bare domain is fetched as https://). Default ports only; credentials, IP addresses, localhost and private or single-label names are rejected. e.g. https://www.archives.gov/founding-docs/declaration-transcript |
max_chars | integer | no | Maximum characters of Markdown returned, 1000 to 100000. Default 20000. Longer output is cut at a line boundary and flagged truncated. e.g. 20000 |
main_only | string: true, false | no | true (default) converts only the main content (<main>, else <article>, else <body>) with scripts, styles, navigation, asides, footers and similar blocks removed; false converts the whole page (with front matter and any JSON-LD). e.g. true |
Example request
https://web.kit-rx.com/v1/web/markdown?url=https%3A%2F%2Fwww.archives.gov%2Ffounding-docs%2Fdeclaration-transcript
Without payment the server answers 402 Payment Required with the price (3000 atomic USDC) in the PAYMENT-REQUIRED header. Any x402 v2 client pays and retries automatically. A request with no parameters runs this example.
curl -i "https://web.kit-rx.com/v1/web/markdown?url=https%3A%2F%2Fwww.archives.gov%2Ffounding-docs%2Fdeclaration-transcript"
Pay from an agent
AgentCash: fetch the URL. OpenDexter MCP: x402_fetch. Kit Rx MCP server: https://web.kit-rx.com/mcp. Code:
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.BUYER_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://web.kit-rx.com/v1/web/markdown?url=https%3A%2F%2Fwww.archives.gov%2Ffounding-docs%2Fdeclaration-transcript");
console.log(await res.json());
Example response
{
"query": {
"url": "https://www.archives.gov/founding-docs/declaration-transcript",
"max_chars": 20000,
"main_only": true
},
"result": {
"final_url": "https://www.archives.gov/founding-docs/declaration-transcript",
"status": 200,
"redirect_count": 0,
"content_type": "text/html",
"format": "html",
"title": "Declaration of Independence: A Transcription | National Archives",
"description": "Note: The following text is a transcription of the Stone Engraving of the parchment Declaration of Independence (the document on display in the Rotunda at the National Archives Museum). The spelling and punctuation reflect the original.",
"lang": "en",
"content_scope": "body",
"markdown": "[Top](#page-header) \n\n[Skip to main content](#main-col) \n\n \n\n# Declaration of Independence: A Transcription\n\n[Print This Page](#)\n\n…",
"chars": 9990,
"word_count": 1554,
"token_estimate": 2498,
"truncated": false,
"links_count": 6,
"full_chars": 9990,
"converter_tokens": 2498,
"bytes": 48690,
"input_truncated": false
},
"sources": [
{
"name": "Cloudflare DNS over HTTPS (JSON API)",
"url": "https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/"
},
{
"name": "Cloudflare Workers AI toMarkdown",
"url": "https://developers.cloudflare.com/workers-ai/features/markdown-conversion/"
},
{
"name": "Live HTTP(S) fetch of the URL",
"url": "https://www.archives.gov/founding-docs/declaration-transcript"
}
],
"notes": [
"main_only: converted the page's <body> content with scripts, styles, navigation, asides, footers, headers and similar blocks removed.",
"Fetched live by the Kit Rx fetcher (User-Agent KitRx/1.0); content belongs to its publisher."
],
"attribution": [
"DNS resolved via Cloudflare 1.1.1.1 DNS-over-HTTPS."
],
"generated_at": "2026-11-15T00:30:39.211Z"
}
Kit Rx Website Security, TLS & Markdown: Website tools for AI agents: security headers grade, SSL/TLS certificate check, page and document to Markdown, site and agent-readiness checks, paid per call over x402. Machine-readable: OpenAPI, llms.txt, /.well-known/x402, agent skills.