Resolve402 / services

Document to Markdown

GET / POST /api/doc-to-markdown · $0.005 per call (USDC on Base or Solana, x402)

Convert a document (PDF, DOCX, HTML, TXT) or an image into clean Markdown for an LLM, with tables extracted as rows and OCR (French, English) for scanned PDFs and images. Give a public URL (?url=) or POST the file (multipart or raw binary, max 10 MB). Returns markdown, tables, pages, chars and source type. Charged only if text is found. Nothing stored.

Problem solved

You have a PDF, Word file, web page or scan and need its text and tables as clean Markdown for an LLM, without running a parser yourself.

Use cases

Input

GET /api/doc-to-markdown?url=<public document URL> | POST /api/doc-to-markdown (multipart file field, or raw binary body)

ParameterWhereTypeDescription
urlquerystringPublic http(s) URL of a PDF, DOCX, HTML, TXT or image (PNG, JPEG, WebP, TIFF) document (max 10 MB, 10 s fetch). Alternative: POST the file as multipart/form-data (field 'file') or as a raw binary body.
filePOST filefilePOST alternative: multipart/form-data file field, or raw binary body (application/pdf, application/octet-stream, text/html...)

Output

Returns markdown, tables [{page?, rows}] (also inlined as GFM tables in markdown), pages (PDF only), chars, source_type (pdf | docx | html | txt | markdown | image), truncated (Markdown cut at 400,000 characters), and ocr {engine, languages, pages_ocr, pages_skipped, mean_confidence} when OCR ran. 422 no_text = nothing readable, not charged.

Price

$0.005 per call. Charged only if text is found: 422 no_text (blank or unreadable document) and conversion errors are not charged.

Example

GET https://resolve402.dev/api/doc-to-markdown?url=https%3A%2F%2Fwww.w3.org%2FWAI%2FER%2Ftests%2Fxhtml%2Ftestfiles%2Fresources%2Fpdf%2Fdummy.pdf
{
  "markdown": "# Quarterly report\n\nRevenue grew 12%…",
  "tables": [
    {
      "page": 2,
      "rows": [
        [
          "Region",
          "Revenue"
        ],
        [
          "EU",
          "1.2M"
        ]
      ]
    }
  ],
  "pages": 3,
  "chars": 4210,
  "source_type": "pdf",
  "truncated": false
}

Bazaar discovery example served in the production 402 (the response illustrates the shape, not the dummy.pdf content).

Sources

Limits

Use it

All services