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.
Get your free API key

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.pdf
sample.csv14 cols × 2k rowsstructured PDF sections
Get your key →

For 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.pdf

Authentication

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/quota

Get your free API key, instant, no approval.

Endpoints

POST/v1/renderauth required

Render 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.pdf
Response
Binary PDF (application/pdf)
GET/v1/quotaauth required

Returns 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/quota
Response
{
  "plan": "credits",
  "credits": { "remaining": 25 },
  "pro": { "monthlyCap": 500, "usedInPeriod": 0 }
}
GET/v1/health

Returns API status. No authentication required.

curl https://api.fitforpdf.com/v1/health
Response
{
  "status": "ok",
  "version": "1"
}

Render options

Pass as a JSON string in the options form field.

KeyTypeValuesDefault
modestringnormal, compact, optimizednormal
brandingbooleantrue, falsetrue
columnMapstringoff, autooff
truncateLongTextbooleantrue, falsefalse
localestringen, fren
paginationbooleantrue, falsetrue
compressbooleantrue, falsefalse

Response headers

Every /v1/render response includes these headers:

HeaderDescription
X-Request-IdUnique request identifier
X-FitForPDF-ScoreQuality score (0–100)
X-FitForPDF-Verdictexcellent, good, fair, or poor
X-FitForPDF-PlanYour current plan
X-FitForPDF-RemainingRemaining exports
X-Render-MSRender 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"
  }
}
HTTPCodeDescription
401api_key_missingNo X-FITFORPDF-KEY header
403api_key_invalidInvalid or revoked API key
402free_quota_exhaustedFree plan exports used up
402credits_exhaustedNo credits remaining
429rate_limitedRate limit exceeded (60 req/min)
413file_too_largeFile exceeds 10 MB limit
415invalid_file_typeNot 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 GitHub

API Pricing

Start free. Scale when it matters.

25 renders included. Then predictable pricing as you grow.

Free

$0

  • 25 renders
  • 60 req/min rate limit
  • fitforpdf watermark
Recommended

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

Enterprise

Custom

  • Unlimited renders
  • SLA + dedicated support
  • Custom infra

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

Instant \u2014 your key appears here in seconds. No approval, no waiting.