T

Toolshed · Convert Markdown Json

by Toolshed

POSTBaseSolana

$0.004

per call · USD Coin on Base

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.

Endpoint

POST https://toolshed.lemon-agent.dev/convert/markdown-json

1

Calls / 30d

1

Unique payers / 30d

Sep 2

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://toolshed.lemon-agent.dev/convert/markdown-json", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify("# Title\n\nSome text.\n"),
});
const data = await res.json();
cURL
curl -X POST \
  "https://toolshed.lemon-agent.dev/convert/markdown-json" \
  -H "Content-Type: application/json" \
  -d '"# Title\n\nSome text.\n"' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

"{\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"

Payment details

Pay to0x0adc7adac7bbaffffbd73505711e42378c4f9f9e
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana
Schemesexact

Is this your API?

Pin it to the top of Social & Community and the homepage with a featured placement.

Get featured →

More from Toolshed & similar services