Tools / Web

Web page to markdown

Fetches a public URL and converts it to clean markdown, dropping navigation, scripts and styling. Works for HTML pages, PDFs, Word, Excel and CSV files. Returns the page title, final URL after redirects and the markdown text.

Price per call
$0.003 USDC
Endpoint
GET https://x402-tools.com/v1/markdown
Also accepts
POST with a JSON body
Payment
x402, exact scheme, USDC on Base
Returns
application/json

Parameters

NameTypeDescription
url requiredstringPublic URL to convert.
max_charsnumberTruncate the markdown to this many characters (default 100000, max 500000).

Call it from an agent

import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const paidFetch = wrapFetchWithPayment(fetch, account);

const res = await paidFetch("https://x402-tools.com/v1/markdown?url=https%3A%2F%2Fexample.com&max_chars=20000");
// costs $0.003 in USDC on Base

Without a payment the endpoint answers 402 with the price, so you can inspect it first:

curl -i "https://x402-tools.com/v1/markdown?url=https%3A%2F%2Fexample.com&max_chars=20000"

Example response

{
  "url": "https://example.com/",
  "final_url": "https://example.com/",
  "title": "Example Domain",
  "content_type": "text/html",
  "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples…",
  "characters": 182,
  "truncated": false
}

If the tool fails or your input is invalid, the payment is not settled.

Other tools