{"openapi":"3.1.0","info":{"title":"x402-markdown-extractor","version":"1.0.0","description":"Pay-per-call micro-APIs for AI agents — USDC on Base via the x402 protocol. 12 endpoints: web content extraction, metadata, RSS, PDF, QR, format conversion, and on-chain data (prices, balances, ENS, gas, token info). POST JSON; each route returns an x402 402 challenge until paid."},"servers":[{"url":"https://x402.valkyry.fr"}],"paths":{"/extract":{"post":{"operationId":"extract","summary":"Turn any web page into clean, LLM-ready Markdown. Fetches the URL, isolates the main article with Mozilla Readability (stripping nav, ads an","description":"Turn any web page into clean, LLM-ready Markdown. Fetches the URL, isolates the main article with Mozilla Readability (stripping nav, ads and boilerplate), and returns tidy Markdown with the page title and word count — built for AI agents, RAG pipelines, web scraping and content ingestion.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Absolute http(s) URL. Must be publicly reachable; private/loopback/metadata addresses are rejected."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"url":"https://example.com/some-article","title":"Some Article","markdown":"# Some Article\n\nClean body text…","wordCount":842,"fetchedAt":"2026-05-28T12:34:56.789Z"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/metadata":{"post":{"operationId":"metadata","summary":"Extract structured metadata from any web page: title, description, author, published date, language, OpenGraph image, canonical URL, favicon","description":"Extract structured metadata from any web page: title, description, author, published date, language, OpenGraph image, canonical URL, favicon and estimated reading time. Lightweight enrichment for AI agents and link indexing.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Absolute http(s) URL. Must be publicly reachable; private/loopback/metadata addresses are rejected."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"url":"https://example.com","title":"Example","description":"An example page","author":null,"publishedAt":null,"lang":"en","siteName":"Example","image":"https://example.com/og.png","canonical":"https://example.com","favicon":"https://example.com/favicon.ico","readingTimeMinutes":3}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/unfurl":{"post":{"operationId":"unfurl","summary":"Generate a compact link-preview card (title, description, image, site name) from a URL using OpenGraph/Twitter tags — for chat unfurls, soci","description":"Generate a compact link-preview card (title, description, image, site name) from a URL using OpenGraph/Twitter tags — for chat unfurls, social previews and agent link summaries.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Absolute http(s) URL. Must be publicly reachable; private/loopback/metadata addresses are rejected."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"url":"https://example.com","title":"Example","description":"An example page","image":"https://example.com/og.png","siteName":"Example"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/rss-to-json":{"post":{"operationId":"rss_to_json","summary":"Convert an RSS 2.0 or Atom feed URL into clean, normalized JSON (title, link, published date, summary per item). For agents monitoring news,","description":"Convert an RSS 2.0 or Atom feed URL into clean, normalized JSON (title, link, published date, summary per item). For agents monitoring news, blogs and content sources.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Absolute http(s) URL of an RSS 2.0 or Atom feed."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"feedType":"rss","title":"Example feed","itemCount":2,"items":[{"title":"Post one","link":"https://example.com/p1","published":"2026-01-01T00:00:00Z","summary":"…","id":"https://example.com/p1"}]}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/pdf-to-markdown":{"post":{"operationId":"pdf_to_markdown","summary":"Fetch a PDF by URL and extract its text as Markdown, with page count and word count. Lets AI agents read PDF documents, reports and papers. ","description":"Fetch a PDF by URL and extract its text as Markdown, with page count and word count. Lets AI agents read PDF documents, reports and papers. (Text-based PDFs; scanned/image-only PDFs are not OCR'd.)","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.003"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Absolute http(s) URL of a (text-based) PDF."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"url":"https://example.com/doc.pdf","pages":12,"wordCount":3400,"markdown":"Extracted text…"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/qr":{"post":{"operationId":"qr","summary":"Generate a QR code (PNG data-URI or SVG) for any text or URL. Simple, instant utility endpoint.","description":"Generate a QR code (PNG data-URI or SVG) for any text or URL. Simple, instant utility endpoint.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Text or URL to encode (or use 'url')"},"url":{"type":"string","description":"Alias for 'text'"},"format":{"type":"string","enum":["png","svg"],"description":"Output format (default png)"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"text":"https://example.com","format":"png","dataUrl":"data:image/png;base64,iVBORw0KGgo…"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/convert":{"post":{"operationId":"convert","summary":"Convert between common text formats: Markdown↔HTML and CSV↔JSON. Handy data-plumbing utility for agents and pipelines.","description":"Convert between common text formats: Markdown↔HTML and CSV↔JSON. Handy data-plumbing utility for agents and pipelines.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to","data"],"properties":{"from":{"type":"string","enum":["markdown","html","csv","json"]},"to":{"type":"string","enum":["markdown","html","csv","json"]},"data":{"type":"string","description":"Source content (markdown↔html or csv↔json)"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"from":"markdown","to":"html","result":"<h1>Hello</h1>"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/token-price":{"post":{"operationId":"token_price","summary":"Real-time crypto spot price for any asset (BTC, ETH, SOL, …) in USD or another currency. Live market data feed for AI trading and finance ag","description":"Real-time crypto spot price for any asset (BTC, ETH, SOL, …) in USD or another currency. Live market data feed for AI trading and finance agents.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbol"],"properties":{"symbol":{"type":"string","description":"Asset symbol, e.g. BTC, ETH, SOL"},"vs":{"type":"string","description":"Quote currency (default USD)"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"symbol":"BTC","vs":"USD","price":"64000.00","source":"coinbase"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/wallet-balance":{"post":{"operationId":"wallet_balance","summary":"On-chain native + ERC-20 token balances for any EVM address across Ethereum, Base, Arbitrum, Optimism and Polygon. For wallet-tracking and D","description":"On-chain native + ERC-20 token balances for any EVM address across Ethereum, Base, Arbitrum, Optimism and Polygon. For wallet-tracking and DeFi agents.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.003"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"EVM address (0x…)"},"network":{"type":"string","enum":["ethereum","base","arbitrum","optimism","polygon"],"description":"EVM network (default ethereum)"},"tokens":{"type":"array","items":{"type":"string"},"description":"Optional ERC-20 token contract addresses to include"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"network":"eip155:1","native":{"symbol":"ETH","decimals":18,"formatted":"1.234","wei":"1234000000000000000"},"tokens":[{"address":"0x…","symbol":"USDC","decimals":6,"formatted":"31.127137"}]}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/ens":{"post":{"operationId":"ens","summary":"Resolve an ENS name to an address, or reverse-resolve an address to its ENS name (Ethereum mainnet). Identity lookups for crypto agents.","description":"Resolve an ENS name to an address, or reverse-resolve an address to its ENS name (Ethereum mainnet). Identity lookups for crypto agents.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"ENS name to resolve → address"},"address":{"type":"string","description":"Address to reverse-resolve → name"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"query":"forward","name":"vitalik.eth","address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/gas":{"post":{"operationId":"gas","summary":"Current gas price (gwei) on Ethereum, Base, Arbitrum, Optimism or Polygon. Lets agents time and price on-chain transactions.","description":"Current gas price (gwei) on Ethereum, Base, Arbitrum, Optimism or Polygon. Lets agents time and price on-chain transactions.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"type":"string","enum":["ethereum","base","arbitrum","optimism","polygon"],"description":"EVM network (default ethereum)"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"network":"eip155:1","gasPriceGwei":"12.3","gasPriceWei":"12300000000"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}},"/token-info":{"post":{"operationId":"token_info","summary":"ERC-20 token metadata (name, symbol, decimals, total supply) for any token contract across major EVM chains. On-chain reference data for age","description":"ERC-20 token metadata (name, symbol, decimals, total supply) for any token contract across major EVM chains. On-chain reference data for agents.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"network":"eip155:8453","asset":"USDC","payTo":"0x4C34489C1f0901695320C6429Dd9C69dD51102d9"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"ERC-20 token contract address"},"network":{"type":"string","enum":["ethereum","base","arbitrum","optimism","polygon"],"description":"EVM network (default ethereum)"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"address":"0x…","network":"eip155:8453","name":"USD Coin","symbol":"USDC","decimals":6,"totalSupply":"…"}}}},"400":{"description":"Bad request — invalid or missing input"},"402":{"description":"Payment Required — x402 challenge in the PAYMENT-REQUIRED header"}}}}}}