Markdown to a JSON token tree
Markdown to a JSON token tree. POST Markdown; the response is {"toc": [{depth, text}], "tokens": [...]} — the marked lexer's token stream plus a table of contents derived from the real headings. The document's structure without rendering it to HTML and parsing that back. A bold line pretending to be a heading was never structure and is not in the toc.
4000 (raw units)
price
1
calls / 30d
1
unique payers
2026-09-02
updated
Provider
toolshed.lemon-agent.dev · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0x0adc7adac7bbaffffbd73505711e42378c4f9f9e",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "4000",
"maxTimeoutSeconds": 60
},
{
"scheme": "exact",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"payTo": "7zXRc8sYkhjezbwXQw43beBrKDmhTMA7mkNfqRjdZ6gw",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "4000",
"maxTimeoutSeconds": 60
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"body": "# Title\n\nSome text.\n",
"bodyType": "text",
"method": "POST",
"type": "http"
},
"output": {
"example": "{\n \"toc\": [\n {\n \"depth\": 1,\n \"text\": \"Title\"\n }\n ],\n \"tokens\": [\n {\n \"type\": \"heading\",\n \"raw\": \"# Title\",\n \"depth\": 1,\n \"text\": \"Title\",\n \"tokens\": [\n {\n \"type\": \"text\",\n \"raw\": \"Title\",\n \"text\": \"Title\",\n \"escaped\": false\n }\n ]\n },\n {\n \"type\": \"space\",\n \"raw\": \"\\n\\n\"\n },\n {\n \"type\": \"paragraph\",\n \"raw\": \"Some text.\\n\",\n \"text\": \"Some text.\",\n \"tokens\": [\n {\n \"type\": \"text\",\n \"raw\": \"Some text.\",\n \"text\": \"Some text.\",\n \"escaped\": false\n }\n ]\n }\n ]\n}\n",
"format": "application/json",
"type": "text"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"description": "the raw Markdown file as the request body, up to 256 KB",
"maxLength": 262144,
"type": "string"
},
"bodyType": {
"const": "text",
"type": "string"
},
"method": {
"const": "POST",
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
},
"output": {
"additionalProperties": false,
"properties": {
"example": {
"description": "the sample request body above, converted — what a the converted JSON file as the response body (application/json) looks like",
"type": "string"
},
"format": {
"const": "application/json",
"description": "the converted JSON file as the response body (application/json)",
"type": "string"
},
"type": {
"const": "text",
"type": "string"
}
},
"required": [
"type",
"format"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://toolshed.lemon-agent.dev/convert/markdown-json" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://toolshed.lemon-agent.dev/convert/markdown-json");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://toolshed.lemon-agent.dev/convert/markdown-json")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/3344.json, and this resource appears in /discovery/resources and /discovery/search.