Use Case

Convert PDF to JSON API

Turn any public PDF URL into JSON with a single API call. Get the text of every page, the PDF's own metadata, and the page count - from both inline and auto-download PDFs.

Why is PDF to JSON so hard?

Getting text out of a PDF means bundling a parser into your service, keeping it patched, and handling the memory spikes that big files cause. It is not hard, but it is one more thing to run.

It gets worse when the PDF isn't served inline. Many enterprise systems, government portals, and document management platforms serve PDFs as auto-downloads - triggered by redirects, tokens, or JavaScript. Your HTTP client never sees the file.

PDFPipe takes both off your plate. Send us any public URL. We auto-detect whether it's inline or an attachment, fetch the PDF (using headless Chromium for downloads), read its text layer page by page, and return JSON. Scanned PDFs have no text layer, so they come back empty - there is no OCR.

How it works

One POST request. We handle the rest.

1. Send a request

curl
curl -X POST https://api.pdfpipe.dev/v1/convert \
  -H "Authorization: Bearer pk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/invoice.pdf",
    "format": "json",
    "returnMethod": "inline"
  }'

2. Get the response

JSON response
{
  "requestId": "req_a1b2c3...",
  "status": "complete",
  "format": "json",
  "pagesProcessed": 3,
  "creditsUsed": 1,
  "contentType": "application/json",
  "content": "{\"pages\":[{\"pageNumber\":1,\"text\":\"...\"}],...}"
}

Predictable JSON output

The same shape for every PDF: an array of pages, each with its number and text, the document's Info dictionary as metadata, the total page count, and an extraction timestamp. No tables, coordinates, or fonts - if you need fields pulled out, feed the page text to your own parser or an LLM.

  • Per-page text with 1-based page numbers
  • Document metadata straight from the PDF (Title, Author, CreationDate, ...)
  • Total page count and extractedAt timestamp
  • Optional pages parameter to select a range (max 100 pages)
  • Consistent schema across all PDFs
Sample JSON output
{
  "pages": [
    {
      "pageNumber": 1,
      "text": "Invoice #2026-0142\nDate: February 15, 2026\n\nItem  Qty  Price\nAPI Credits  1000  $49.00\nPriority Support  1  $29.00\n\nTotal: $78.00"
    },
    {
      "pageNumber": 2,
      "text": "Payment terms\nNet 30..."
    },
    {
      "pageNumber": 3,
      "text": "..."
    }
  ],
  "metadata": {
    "Title": "Invoice #2026-0142",
    "Author": "Acme Corp",
    "Producer": "Acrobat Distiller 21.0",
    "CreationDate": "D:20260215100000Z"
  },
  "totalPages": 3,
  "extractedAt": "2026-08-23T12:00:01.840Z"
}
Node.js
const response = await fetch(
  "https://api.pdfpipe.dev/v1/convert",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer pk_...",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      url: "https://example.com/invoice.pdf",
      format: "json",
      returnMethod: "inline",
    }),
  }
);

const data = await response.json();
const pdf = JSON.parse(data.content);

console.log(pdf.metadata.Title, pdf.totalPages);
for (const page of pdf.pages) {
  console.log(page.pageNumber, page.text.slice(0, 80));
}

Works with any language

PDFPipe is a standard REST API. If your language can make HTTP requests, it can use PDFPipe. No SDK required - there is an official TypeScript/Node.js SDK (pdfpipe-sdk) and an MCP server if you want them.

JavaScriptPythonGoRubyPHPJavaC#curl

Start converting PDFs to JSON today

Free tier includes 300 requests per month. No credit card required.