Skip to content
POST
/api/v1/convert/table-to-csv

Markdown table → CSV API

Extract the first GFM table to CSV/TSV.

POST /api/v1/convert/table-to-csv extracts the first GFM pipe table from a markdown document and returns RFC-4180 CSV (or TSV). Round-trips with /api/v1/convert/csv-to-table.

Overview

Finds the first GFM pipe table in the document and emits CSV or TSV. Cells that contain the delimiter, quotes, or newlines are escaped per RFC 4180.

Request

Authenticate with Authorization: Bearer YOUR_API_KEY and send a JSON body containing the parameters below. Pick your language:

curl -X POST 'https://trymarkdownviewer.com/api/v1/convert/table-to-csv' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"| a | b |\n|---|---|\n| 1 | 2 |\n"}'

Body parameters

FieldTypeRequiredDescription
markdownstring
required
Markdown source.
delimiter"," | "\t"optionalField delimiter. Defaults to comma.

Response

Success responses are wrapped in a data field. Errors use { error: { code, message } } with an appropriate HTTP status — see the error reference.

{
  "data": {
    "csv": "a,b\r\n1,2\r\n",
    "rows": 2,
    "columns": 2
  }
}

Use cases

Round-trip docs ↔ spreadsheets

Round-trip a single dataset between markdown and your spreadsheet of choice.

Try in browser

Free tools that run the same logic locally — no API key, no upload.

Try it

Send a real request against your account in the API playground. Errors there link straight back to the error reference.