Extract a profit and loss statement PDF to JSON
Everything below is the response the live API returned for a profit and loss statement, generated when this page was built. Not a description of what it would return — the output itself, including what it scored low on.
Who this is for
Lenders, acquirers and FP&A tools reading management accounts that arrive as a PDF attachment every month.
The job, in the words people search for: “extract revenue and cost lines from a P&L PDF”.
What makes this shape awkward
A percentage column beside two currency columns. Percentages parse as numbers, so numeric contrast fires on all three and tells you nothing about which is money — the units live in the header row or nowhere.
The measured result
| Pages read | 1 |
| Time | 5 ms (5 ms/page) |
| Labelled fields found unprompted | 3 |
| Tables | 1 (9 rows) |
| Input | profit-and-loss.pdf (28 KB — synthetic, generated from a spec in the repo; real documents of this type cannot be published) |
Fields, with a schema
Ask for the fields you want by the label printed on the page. Each answer carries the text exactly as printed (raw), the value coerced to the type you asked for, a confidence, and a bounding box you can draw on the page to check it.
curl -X POST https://api.pdfcraft.dev/v1/extract \
-H "Authorization: Bearer $PDFCRAFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": "<base64 of your profit and loss statement>",
"schema": {
"entity": "string",
"basis": "string"
}
}'What came back
| Field | raw | value | confidence |
|---|---|---|---|
entity | Halvorsen Industrial Ltd | "Halvorsen Industrial Ltd" | 60% |
basis | Management accounts, unaudited | "Management accounts, unaudited" | 60% |
Every label it found without being asked
Send no schema and you get all of these, keyed by the label as printed. Useful for discovering what a new supplier’s layout actually contains before you write a schema against it.
Entity, Period, Basis
Tables
Table 1 · 9 rows × 4 columns · page 1
Table confidence 75%. No header was promoted (confidence 10%). Nothing in the geometry distinguishes row 0 from the rows under it, and inventing a header would silently eat a row of your data.
| Revenue | 42,118 | 38,440 | 9.6 |
| Cost of sales | (26,802) | (25,110) | 6.7 |
| Gross profit | 15,316 | 13,330 | 14.9 |
First 3 of 9 rows.
What this does not do
- No OCR. This reads the PDF’s text layer. A scanned or photographed profit and loss statement has no text layer and returns
422 extraction_failedwith the page numbers that were blank — deliberately, and quickly, so you can route it somewhere that does OCR rather than waiting on a guess. - No model. Run the same file twice and you get the same bytes back. That is the trade: it cannot infer a field that is not printed, and it cannot hallucinate one either.
- Ambiguity is reported, not resolved. A date like 03/04/2026 stays a string, and a bare
$returns a null currency, because guessing wrong on either is not something you can recover from downstream.
Try it on your own profit and loss statement
The playground takes a file and shows the same JSON, with every bounding box drawn over the page. No key and no signup for the first few; a free key gives you 100 pages a month.