Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1 Commit

Repository files navigation

API StatusLicense: MIT

DocForge API

Fast, stateless document format conversion. Convert between Markdown, HTML, CSV, JSON, and YAML with a single API call.

Base URL:https://docforge-api.vercel.app


Quick Start

curl -X POST https://docforge-api.vercel.app/api/md-to-html \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World\n\nThis is **bold**."}'

Response:

{
"html": "<h1>Hello World</h1>\n<p>This is <strong>bold</strong>.</p>",
"meta": { "wordCount": 5, "headings": ["Hello World"] }
}

No API key required for the free tier (500 requests/day).


Endpoints

POST /api/md-to-html

Convert Markdown to sanitized HTML with metadata extraction.

Request:

{
"markdown": "# Title\n\nParagraph with **bold** and *italic*.\n\n- Item 1\n- Item 2"
}

Response:

{
"html": "<h1>Title</h1>\n<p>Paragraph with <strong>bold</strong> and <em>italic</em>.</p>\n<ul>\n<li>Item 1</li>\n<li>Item 2</li>\n</ul>",
"meta": {
"wordCount": 8,
"headings": ["Title"]
}
}

POST /api/csv-to-json

Parse CSV or TSV into a JSON array of objects. Handles quoted fields and custom delimiters.

Request:

{
"csv": "name,email,role\nAlice,alice@example.com,admin\nBob,bob@example.com,user"
}

Response:

{
"data": [
{ "name": "Alice", "email": "alice@example.com", "role": "admin" },
{ "name": "Bob", "email": "bob@example.com", "role": "user" }
],
"meta": { "rowCount": 2, "columns": ["name", "email", "role"] }
}

Optional parameters:

  • delimiter (string) -- Custom delimiter character. Default: ,
  • headers (boolean) -- Whether the first row contains headers. Default: true

POST /api/json-to-csv

Convert an array of JSON objects to CSV. Auto-detects all columns across rows.

Request:

{
"data": [
{ "name": "Alice", "email": "alice@example.com", "role": "admin" },
{ "name": "Bob", "email": "bob@example.com", "role": "user" }
]
}

Response:

{
"csv": "name,email,role\nAlice,alice@example.com,admin\nBob,bob@example.com,user",
"meta": { "rowCount": 2, "columns": ["name", "email", "role"] }
}

POST /api/yaml-json

Bidirectional YAML/JSON conversion. Specify the direction in the request body.

YAML to JSON:

{
"input": "name: DocForge\nversion: 1.0.0\nfeatures:\n - fast\n - reliable",
"direction": "yaml-to-json"
}

Response:

{
"output": {
"name": "DocForge",
"version": "1.0.0",
"features": ["fast", "reliable"]
}
}

JSON to YAML:

{
"input": { "name": "DocForge", "version": "1.0.0" },
"direction": "json-to-yaml"
}

Response:

{
"output": "name: DocForge\nversion: 1.0.0\n"
}

Authentication

The free tier requires no API key. Just send requests to any endpoint.

For higher rate limits, sign up for an API key:

curl -X POST https://docforge-api.vercel.app/api/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'

You will receive an API key. Include it in subsequent requests:

curl -X POST https://docforge-api.vercel.app/api/md-to-html \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"markdown": "# Hello"}'

Rate Limits

PlanRequests/DayInput LimitPrice
Free500100 KB$0
Pro50,0005 MB$9/mo
Team500,00025 MB$29/mo

Rate limit headers are included in every response:

X-RateLimit-Limit: 500
X-RateLimit-Remaining: 499
X-RateLimit-Reset: 1709164800

Code Examples

Full working examples are in the examples/ directory.

JavaScript (Node.js)

constresponse=awaitfetch('https://docforge-api.vercel.app/api/md-to-html',{method: 'POST',headers: {'Content-Type': 'application/json'},body: JSON.stringify({markdown: '# Hello World\n\nThis is **bold**.'}),});constdata=awaitresponse.json();console.log(data.html);

Python

importrequestsresponse=requests.post(
'https://docforge-api.vercel.app/api/md-to-html',
json={'markdown': '# Hello World\n\nThis is **bold**.'}
)
data=response.json()
print(data['html'])

cURL

curl -X POST https://docforge-api.vercel.app/api/md-to-html \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World\n\nThis is **bold**."}'

Go

package main
import (
"bytes""encoding/json""fmt""net/http""io"
)
funcmain() {
body, _:=json.Marshal(map[string]string{
"markdown": "# Hello World\n\nThis is **bold**.",
})
resp, err:=http.Post(
"https://docforge-api.vercel.app/api/md-to-html",
"application/json",
bytes.NewBuffer(body),
)
iferr!=nil {
panic(err)
}
deferresp.Body.Close()
result, _:=io.ReadAll(resp.Body)
fmt.Println(string(result))
}

Pricing

PlanPriceRequests/DayInput LimitSupport
Free$0500100 KBCommunity
Pro$9/mo50,0005 MBPriority
Team$29/mo500,00025 MBSLA

Subscribe to Pro | Subscribe to Team


Links


Performance

  • Sub-50ms response times (p99)
  • Zero cold starts -- stateless serverless functions
  • No AI overhead -- pure computation, no LLM calls
  • 99.9% uptime SLA for paid plans

License

MIT

About

Free REST API for converting between Markdown, HTML, CSV, JSON, and YAML. 500 requests/day free tier, no signup required.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors