Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

ReportForge API

API StatusLicense: MITLive Site

Turn CSV and JSON data into professional HTML reports with a simple REST API.


Features

  • 4 Built-in Templates — Sales Summary, Expense Report, Inventory Status, and Invoice — ready to use out of the box
  • Responsive HTML Output — clean, print-ready reports that look great on any device or as PDF exports
  • Free Tier Available — start generating reports immediately with no credit card required
  • API Key Authentication — simple x-api-key header for authenticated tiers with higher limits

Quick Start

1. Get Your API Key

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

2. Generate a Report

curl -X POST https://reportforge-api.vercel.app/api/json-to-report \
-H "Content-Type: application/json" \
-H "x-api-key: rf_your_api_key_here" \
-d '{ "template": "sales-summary", "title": "Q1 Sales Report", "data": [ {"item": "Widgets", "amount": 1250.00, "quantity": 50}, {"item": "Gadgets", "amount": 890.50, "quantity": 30} ] }'

3. Use the HTML Output

The response contains a complete HTML document you can open in any browser, embed in an email, or print to PDF.

{
"html": "<!DOCTYPE html>...",
"meta": {
"template": "sales-summary",
"rowCount": 2,
"columns": ["item", "amount", "quantity"],
"generatedAt": "2025-01-15T10:30:00.000Z"
}
}

API Endpoints

MethodEndpointDescription
POST/api/signupGet a free API key
POST/api/json-to-reportGenerate an HTML report from a JSON array
POST/api/csv-to-reportGenerate an HTML report from raw CSV
GET/api/templatesList all available templates and their columns

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


Templates

TemplateIDRequired ColumnsOptional Columns
Sales Summarysales-summaryitem, amountdate, quantity, category, customer, region
Expense Reportexpense-reportdescription, amountdate, category, vendor, payment_method, notes
Inventory Statusinventory-statusitem, quantitysku, category, location, reorder_level, unit_price, supplier
Invoiceinvoicedescription, amountquantity, unit_price, tax_rate, date, invoice_number, client_name, client_email

Example Request and Response

Request

curl -X POST https://reportforge-api.vercel.app/api/json-to-report \
-H "Content-Type: application/json" \
-d '{ "template": "sales-summary", "title": "Monthly Sales", "data": [ {"item": "Widgets", "amount": 1250.00, "quantity": 50}, {"item": "Gadgets", "amount": 890.50, "quantity": 30}, {"item": "Sprockets", "amount": 445.75, "quantity": 15} ] }'

Response

{
"html": "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\">...</html>",
"meta": {
"template": "sales-summary",
"rowCount": 3,
"columns": ["item", "amount", "quantity"],
"generatedAt": "2025-06-15T14:22:00.000Z"
}
}

The html field contains a self-contained HTML document with inline CSS — no external dependencies required.


Code Examples

JavaScript (Node.js)

constresponse=awaitfetch('https://reportforge-api.vercel.app/api/json-to-report',{method: 'POST',headers: {'Content-Type': 'application/json'},body: JSON.stringify({data: [{item: 'Widgets',amount: 1250.00,quantity: 50},{item: 'Gadgets',amount: 890.50,quantity: 30}],template: 'sales-summary',title: 'Q1 Sales Report'})});const{ html, meta }=awaitresponse.json();console.log(`Generated report: ${meta.rowCount} rows, template: ${meta.template}`);

Python

importrequestsresponse=requests.post(
'https://reportforge-api.vercel.app/api/json-to-report',
json={
'data': [
{'item': 'Widgets', 'amount': 1250.00, 'quantity': 50},
{'item': 'Gadgets', 'amount': 890.50, 'quantity': 30}
],
'template': 'sales-summary',
'title': 'Q1 Sales Report'
}
)
data=response.json()
print(f"Generated report: {data['meta']['rowCount']} rows")

Authentication

For the free tier, no API key is required. For Starter and Business tiers, include your key in the x-api-key header:

curl -X POST https://reportforge-api.vercel.app/api/json-to-report \
-H "Content-Type: application/json" \
-H "x-api-key: rf_your_api_key_here" \
-d '{...}'

Pricing

FreeStarterBusiness
Price$0/mo$12/mo$35/mo
Reports per day20200Unlimited
TemplatesAll 4All 4All 4
API keyNot requiredIncludedIncluded
SupportCommunityEmailPriority

View pricing and subscribe →


Error Handling

All errors return a consistent JSON format:

{
"error": {
"code": "INVALID_INPUT",
"message": "Field \"data\" is required and must be an array"
}
}
HTTP StatusError CodeDescription
400INVALID_INPUTMissing or malformed fields
405INVALID_INPUTWrong HTTP method
413INPUT_TOO_LARGEInput exceeds tier size limit
429RATE_LIMITEDDaily report limit exceeded

Links

ResourceURL
Documentationreportforge-api.vercel.app/docs
Blogreportforge-api.vercel.app/blog
Status Pagereportforge-api.vercel.app/status
OpenAPI Specreportforge-api.vercel.app/openapi.json
Live Demoreportforge-api.vercel.app

Related Products

ProductDescriptionLink
DocForgeConvert documents between formats (PDF, DOCX, HTML, Markdown) with a simple APIdocforge.dev
FormForgeGenerate dynamic web forms from JSON schemas with validation and submission handlingformforge.dev

License

This project is licensed under the MIT License.

About

Free REST API for generating styled HTML reports from CSV or JSON data. 7 templates including sales, expense, inventory, and invoice.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors