# Markdown Table Generator API

> Markdown Table Generator converts structured data into properly formatted markdown tables with customizable column alignment.

**Endpoint:** `POST https://api.apiverve.com/v1/markdowntable`  
**Category:** Data Conversion  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/markdowntable

## Overview

Send column headers and rows as JSON and get a markdown table back, which makes it a quick JSON to markdown table step in a docs or report pipeline. Outputs GitHub-flavored markdown tables ready for documentation, README files, and any markdown-compatible platform. Pipes and line breaks inside cells are escaped for you, so data with odd characters does not break the layout.

Common uses are release notes generated from a database, benchmark results written into a README by a CI job, status tables posted to a chat channel, and changelogs built from an issue tracker. You can set one alignment for every column or pass a list to align each column left, center or right.

On the Free plan you get the markdown string, the headers and the column count. Paid plans also return the row count, the total cell count and the alignment that was applied to each column, which helps when you need to validate or log what the generator produced.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/markdowntable" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows":[["John Doe",30,"New York"],["Jane Smith",25,"Los Angeles"],["Bob Johnson",35,"Chicago"]],"headers":["Name","Age","City"],"alignment":"left"}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `headers` | array | No | Array of column header names. Required when rows are arrays; with object rows it picks and orders the columns, and when omitted the headers come from the objects' keys |
| `rows` | array | Yes | Array of row arrays, or an array of objects such as an API or database result (headers derived from the keys when omitted) |
| `alignment` | string | No | Column alignment: left, center, right, or array of alignments per column. default left |

## Response fields

- `markdown` — string · Generated GitHub-flavored markdown formatted table
- `columnCount` — number · Total number of columns in table
- `rowCount` — number · Total number of data rows in table · (premium)
- `cellCount` — number · Total cell count including headers · (premium)
- `headers` — array · Array of column header names from input
- `alignments` — array · Array of alignment values for each column · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "markdown": "| Name | Age | City |\n| --- | --- | --- |\n| John Doe | 30 | New York |\n| Jane Smith | 25 | Los Angeles |\n| Bob Johnson | 35 | Chicago |",
    "columnCount": 3,
    "rowCount": 3,
    "cellCount": 12,
    "headers": [
      "Name",
      "Age",
      "City"
    ],
    "alignments": [
      "left",
      "left",
      "left"
    ]
  }
}
```

## Use cases

- **Documentation Generation** — Create formatted tables for README files and technical documentation
- **Data Presentation** — Convert API responses or datasets into readable markdown tables
- **Report Building** — Generate tabular reports in markdown format for various platforms
- **Content Management** — Create consistent table formatting across documentation systems

## SDKs

- **npm** — `npm install @apiverve/markdowntable` (https://www.npmjs.com/package/@apiverve/markdowntable)
- **NuGet** — `dotnet add package APIVerve.API.MarkdownTableGenerator` (https://www.nuget.org/packages/APIVerve.API.MarkdownTableGenerator)
- **Source** — https://github.com/apiverve/markdowntable-api

## More

- Full reference: https://docs.apiverve.com/ref/markdowntable
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
