Developer API
Render readable PDFs
from wide tables
Use the fitforpdf API to generate structured PDFs from Excel exports, CSV datasets, and database tables. Built specifically for wide business tables that break normal PDF rendering.
https://api.fitforpdf.com/v1No HTML templates. No PDF layout code.25 free renders to start. No credit card, no approval, your key is instant.
Try it in 10 seconds
curl -X POST https://api.fitforpdf.com/v1/render \
-H "X-FITFORPDF-KEY: YOUR_KEY" \
-F "file=@sample.csv" \
--output report.pdfFor AI agents
Agent-native PDF rendering
Deterministic, reproducible, and LLM-free. Discover the tool via the manifest, then call /api/agent/render with a JSON body containing file_url. No multipart boilerplate. Response is JSON with a base64 PDF plus the render verdict.
Claude (Anthropic SDK)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const tools = [{
name: "render_pdf",
description: "Render a client-ready PDF from a CSV or XLSX file URL.",
input_schema: {
type: "object",
required: ["file_url"],
properties: {
file_url: { type: "string" },
mode: { type: "string", enum: ["normal", "compact", "optimized"] }
}
}
}];
// When Claude decides to call render_pdf, hit:
// POST https://www.fitforpdf.com/api/agent/render
// Header: X-FITFORPDF-KEY: ffp_live_...
// Body: { "file_url": "...", "mode": "normal" }OpenAI function calling
import OpenAI from "openai";
const openai = new OpenAI();
const tools = [{
type: "function",
function: {
name: "render_pdf",
description: "Render a client-ready PDF from a CSV/XLSX URL.",
parameters: {
type: "object",
required: ["file_url"],
properties: {
file_url: { type: "string" },
mode: { type: "string", enum: ["normal", "compact", "optimized"] }
}
}
}
}];
const response = await openai.chat.completions.create({
model: "gpt-4o",
tools,
messages: [{ role: "user", content: "Turn this export into a PDF" }]
});LangChain (Python)
from langchain_core.tools import tool
import httpx, os
@tool
def render_pdf(file_url: str, mode: str = "normal") -> dict:
"""Render a client-ready PDF from a CSV/XLSX URL."""
r = httpx.post(
"https://www.fitforpdf.com/api/agent/render",
json={"file_url": file_url, "mode": mode},
headers={"X-FITFORPDF-KEY": os.environ["FITFORPDF_KEY"]},
timeout=60,
)
r.raise_for_status()
return r.json() # { pdf_base64, pages, verdict, score, render_id }Why fitforpdf exists
Wide tables break every PDF renderer
Standard PDF libraries, wkhtmltopdf, Puppeteer, ReportLab, were built for documents, not data. Feed them a 20-column CRM export and you get cut-off columns, microscopic text, and broken page flows that no client wants to read.
fitforpdf was built specifically for this problem. The rendering engine analyses your table structure, splits wide tables into readable sections, and produces a PDF that actually communicates the data inside it.
Typical use cases
Built for SaaS products and data-heavy workflows
SaaS reporting
Generate PDF reports from your product data on demand
CRM exports
Turn wide CRM tables into client-ready documents
Financial exports
Render financial data with clean pagination and layout
Analytics tables
Export analytics dashboards as structured PDFs
Inventory reports
Convert inventory data into readable, shareable PDFs
What makes fitforpdf different
Designed around the wide-table problem
Splits wide tables into sections
No more cut-off columns, wide tables are restructured into readable grouped sections.
Preserves key columns across sections
Identifier columns stay visible on every section so records stay linked.
Full-width text rendering
Every column gets the space it needs. No cramped cells or truncated values.
Automatic pagination
Page breaks follow record boundaries, not arbitrary row counts.
Quick start
Generate a PDF in one command:
curl -X POST \
-H "X-FITFORPDF-KEY: ffp_live_..." \
-F file=@your-data.csv \
https://api.fitforpdf.com/v1/render \
-o report.pdfAuthentication
Pass your API key in the X-FITFORPDF-KEY header. Keys are prefixed ffp_live_ and should be kept server-side only.
curl -H "X-FITFORPDF-KEY: ffp_live_..." \
https://api.fitforpdf.com/v1/quotaGet your free API key, instant, no approval.
Endpoints
/v1/renderauth requiredRender a readable PDF from a wide CSV or XLSX table (max 10 MB).
curl -X POST \
-H "X-FITFORPDF-KEY: ffp_live_..." \
-F file=@data.csv \
-F 'options={"mode":"compact","branding":false}' \
https://api.fitforpdf.com/v1/render \
-o output.pdfResponse
Binary PDF (application/pdf)/v1/quotaauth requiredReturns your current plan, usage, and remaining exports. A new self-serve key starts with 25 free render credits, the "credits" block, which counts down as you render.
curl -H "X-FITFORPDF-KEY: ffp_live_..." \
https://api.fitforpdf.com/v1/quotaResponse
{
"plan": "credits",
"credits": { "remaining": 25 },
"pro": { "monthlyCap": 500, "usedInPeriod": 0 }
}/v1/healthReturns API status. No authentication required.
curl https://api.fitforpdf.com/v1/healthResponse
{
"status": "ok",
"version": "1"
}Render options
Pass as a JSON string in the options form field.
| Key | Type | Values | Default |
|---|---|---|---|
mode | string | normal, compact, optimized | normal |
branding | boolean | true, false | true |
columnMap | string | off, auto | off |
truncateLongText | boolean | true, false | false |
locale | string | en, fr | en |
pagination | boolean | true, false | true |
compress | boolean | true, false | false |
Response headers
Every /v1/render response includes these headers:
| Header | Description |
|---|---|
X-Request-Id | Unique request identifier |
X-FitForPDF-Score | Quality score (0–100) |
X-FitForPDF-Verdict | excellent, good, fair, or poor |
X-FitForPDF-Plan | Your current plan |
X-FitForPDF-Remaining | Remaining exports |
X-Render-MS | Render time in milliseconds |
Rate limiting
60 requests per minute per API key. Rate limit state is returned in headers: X-RateLimit-Limit, X-RateLimit-Remaining, and Retry-After (on 429). Maximum 150 columns and 5,000 rows per request.
Designed for business reporting exports.
Error codes
All errors use a standard envelope:
{
"error": {
"code": "api_key_missing",
"message": "Missing X-FITFORPDF-KEY header",
"requestId": "req-123"
}
}| HTTP | Code | Description |
|---|---|---|
| 401 | api_key_missing | No X-FITFORPDF-KEY header |
| 403 | api_key_invalid | Invalid or revoked API key |
| 402 | free_quota_exhausted | Free plan exports used up |
| 402 | credits_exhausted | No credits remaining |
| 429 | rate_limited | Rate limit exceeded (60 req/min) |
| 413 | file_too_large | File exceeds 10 MB limit |
| 415 | invalid_file_type | Not a .csv or .xlsx file |
GitHub examples
Working API examples in Node.js and Python, plus the full OpenAPI 3.1 spec.
View API examples on GitHubAPI Pricing
Start free. Scale when it matters.
25 renders included. Then predictable pricing as you grow.
Starter API
$15 / month
$0.10 per render
- 150 renders / month
- No watermark
- Priority queue
Scale API
$49 / month
~$0.049 per render
- 1,000 renders / month
- Faster processing
- SLA light
Compare
How fitforpdf compares to other tools
Integrate in minutes.
One endpoint, one file upload, one PDF back.
Free API key
Get your API key
Get an instant key and make your first render in seconds, no approval, no waiting. Every key includes:
- Free renders to test your integration
- Direct access to the engineering team
- Priority feature requests

