Extract tables from HTML and convert each one to GitHub-flavoured Markdown or CSV. Options match the browser tool. HTML with no table returns an empty list.
POST /api/v1/tools/html-table-to-markdown
Cost: 1 credit per successful request, taken from your account balance and shared by every token. A failed request is not charged.
Request body
| Field | Description |
|---|---|
html | Required. The HTML that contains tables. Max 1 MB. |
output | Required. markdown or csv. |
spanFill | Optional. repeat or blank for colspan/rowspan cells. Default repeat. |
inlineMarkdown | Optional boolean. Keep bold, italic, code and links as Markdown in Markdown output. Default true. CSV always uses plain text. |
firstRowIsHeader | Optional boolean. Override header detection. Omit to follow the extractor. |
pad | Optional boolean. Pad Markdown columns for alignment. Default true. |
delimiter | Optional CSV delimiter: comma, tab, or semicolon. Default comma. |
includeHeader | Optional boolean. Include the header row in CSV. Default true. |
Example
curl https://wapgee.com/api/v1/tools/html-table-to-markdown \
-H "Authorization: Bearer wpg_your_token" \
-H "Content-Type: application/json" \
-d '{"html":"<table><tr><th>A</th><th>B</th></tr><tr><td>1</td><td>2</td></tr></table>","output":"markdown"}'A successful call returns:
{
"success": true,
"outputFormat": "markdown",
"tableCount": 1,
"truncated": false,
"tables": [
{
"index": 1,
"caption": null,
"rowCount": 2,
"colCount": 2,
"detectedHeader": true,
"warnings": [],
"output": "| A | B |\n| --- | --- |\n| 1 | 2 |\n"
}
]
}