TidyTools

Web page to Markdown

POST https://tools.yukai.uk/api/v1/markdown

Convert a URL to Markdown or text. Fetches the page (or document) and returns its main content as Markdown (default) or plain text, with a token estimate.

Cost

Credits: 18 ($0.0018) per successful call. Failed calls are free. Source price: website-screenshot-pdf-markdown/markdown.

Input

Send a JSON body (POST) or the same fields as a query string (GET).

Required: url.

FieldTypeDefaultDescription
url requiredstringPage URL. A bare domain such as example.com is accepted (https is assumed). Private, local and cloud-metadata addresses are refused.
formatstring"markdown"Output format.
renderstring"auto"auto (default): plain HTTP first, a real Chrome browser only when the site blocks plain requests or needs JavaScript. never: HTTP only. always: browser only.
removeBoilerplatebooleantrueDrop navigation, header, footer, aside and similar page chrome.
cssSelectorstringKeep only the part of the page matching this CSS selector (e.g. article).
includeLinksbooleanfalseAlso return the absolute links found on the page (up to 1,000).
maxCharsinteger200000Maximum characters in this chunk. Use startIndex or nextStartIndex to read the rest.
startIndexinteger0Character offset in the full converted content. Send 0 to receive pagination metadata, then use nextStartIndex until it is null.
timeoutMsinteger20000Page-load timeout in milliseconds.

Examples

Replace tt_live_XXXX with your key from the pricing page.

curl

curl -i -X POST "https://tools.yukai.uk/api/v1/markdown" \
  -H "Authorization: Bearer tt_live_XXXX" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'

JavaScript (fetch)

const res = await fetch("https://tools.yukai.uk/api/v1/markdown", {
  method: "POST",
  headers: { "Authorization": "Bearer tt_live_XXXX", "Content-Type": "application/json" },
  body: JSON.stringify({"url":"https://example.com"}),
});
console.log(res.status, res.headers.get("x-credits-charged"), res.headers.get("x-credits-balance"));
console.log(await res.json());

Python (requests)

import requests

r = requests.post(
    "https://tools.yukai.uk/api/v1/markdown",
    headers={"Authorization": "Bearer tt_live_XXXX"},
    json={"url": "https://example.com"},
    timeout=120,
)
print(r.status_code, r.headers.get("x-credits-charged"), r.headers.get("x-credits-balance"))
print(r.json())

Response

JSON with "success": true and the result fields; on failure {"success": false, "error": {"code", "message", "retryable"}} and no credits are used. Every answer carries x-credits-charged (credits used) and x-credits-balance (balance after the call); check the balance any time with GET https://tools.yukai.uk/v1/billing/balance.

Full field list and response schema: OpenAPI spec web-to-markdown (its servers entry is the marketplace gateway; call https://tools.yukai.uk with your key).

← All routes · Pricing