PDF table API

PDF table API

Send a text-based PDF to Rimuleaf from your own code and get its tables back as JSON, CSV or an Excel workbook. It uses the same table engine as the website converter. 1 credit = 1 PDF file.

What it does, and what it does not

Buy credits

Credits are prepaid with Stripe Checkout. After you pay, your code (it looks like RML-XXXX-XXXX-XXXX-XXXX-XXXX) is shown on the success page and printed on your Stripe receipt. The same code works as your API key and on the website, for PDF conversions and bank CSV tidies; every file uses 1 credit, whichever way you send it. Codes last 12 months. There is no account and no subscription.

Refund policy, shown before you pay. A file that fails or finds nothing costs nothing. If a paid file or credit comes out wrong or incomplete, email us within 14 days of payment and we will put it right or refund it. An unused pack can be refunded from its success page. If the file matches its preview, a change of mind after download is not usually a ground for a refund. Your legal rights are not affected. Full policy: Refunds.

Prices are in New Zealand dollars. There is no free API tier. Credits are not spent when an extract fails or finds no tables.

Authentication

Send your code in the Authorization header on every request:

Authorization: Bearer RML-XXXX-XXXX-XXXX-XXXX-XXXX

Keep your code private. Anyone who has it can spend your credits.

Endpoints

Base address: https://rimuleaf.com

MethodPathAuthWhat it does
POST/api/v1/extractBearer codeUpload one PDF and get its tables (uses 1 credit on success)
GET/api/v1/creditsBearer codeCredits left on your code and its expiry date
GET/api/v1/healthnoneCheck that the service is awake

Extract tables

Send a multipart/form-data request with the PDF in a field named file. Optional fields:

BASE="https://rimuleaf.com"
curl -sS -X POST "$BASE/api/v1/extract" \
  -H "Authorization: Bearer RML-XXXX-XXXX-XXXX-XXXX-XXXX" \
  -F "file=@statement.pdf" -F "output=json" -F "pages=1-3"

A successful JSON answer looks like this:

{"ok": true, "pages": 3, "file_pages": 12, "n_tables": 2,
 "tables": [{"page": 1, "rows": [["Item", "Amount"], ["Rent", "450.00"]]}],
 "credits_used": 1, "credits_left": 19}

For a spreadsheet instead, ask for csv or xlsx and save the body to a file. The headers X-Credits-Left, X-Pages and X-Tables carry the counts:

curl -sS -X POST "$BASE/api/v1/extract" \
  -H "Authorization: Bearer RML-XXXX-XXXX-XXXX-XXXX-XXXX" \
  -F "file=@statement.pdf" -F "output=xlsx" -o tables.xlsx -D headers.txt

Safe retries

Add an Idempotency-Key header (32 to 128 characters: letters, digits, ., _ or -, for example a UUID without braces) so a retried request is never charged twice. A key that does not match that format is refused with 400 bad_request and nothing is charged: we never quietly ignore a malformed key, because your retries would then not be protected. If the first request with that key succeeded, a retry gets 409 already_processed and no extra credit is used. Files are not kept, so the earlier result cannot be sent again.

curl -sS -X POST "$BASE/api/v1/extract" \
  -H "Authorization: Bearer RML-XXXX-XXXX-XXXX-XXXX-XXXX" \
  -H "Idempotency-Key: 6f1c2d3e-4b5a-6978-8a9b-0c1d2e3f4a5b" \
  -F "file=@statement.pdf"

Credits and health

curl -sS "$BASE/api/v1/credits" -H "Authorization: Bearer RML-XXXX-XXXX-XXXX-XXXX-XXXX"
{"ok": true, "total": 100, "used": 1, "left": 99, "expires": "2027-12-01T13:00:00+13:00", "expired": false}

curl -sS "$BASE/api/v1/health"
{"ok": true, "engine": "rimuleaf", "ocr": false}

Errors

Errors are JSON: {"ok": false, "error": "<code>", "message": "<text>"}. No credit is used for any error.

HTTPerrorWhen
400bad_requestNo file, or a bad output or pages, or an Idempotency-Key that is not 32-128 characters of letters, digits, ., _ or -
401unauthorizedMissing, mistyped, unknown or inactive code
402no_creditsNo credits left, or the code is more than 12 months old
409already_processedThe same Idempotency-Key already succeeded
413too_largeThe upload is over 10 MB
415not_pdfThe file is not a PDF
422convert_errorLocked or damaged file, no pages, more than 50 pages, no selectable text (a scan or photo), or no tables found
422too_slowReading the file took longer than 40 seconds, so it was stopped. No credit is used; send fewer pages or a shorter file
503temporarily_unavailableAPI extraction is switched off for a while (server maintenance; the website converter keeps working). No credit is used; retry after the Retry-After seconds. GET /api/v1/health shows "extract_mode"
422too_complexThe file needed more than our memory limit to read, so it was stopped. No credit is used; send fewer pages or a simpler file. Retrying the same file will not help
429rate_limitedToo many requests, or another extract is running. Wait for the number of seconds in Retry-After
500server_errorSomething went wrong on our side

Rate limits

Hosting: cold starts and timeouts

Rimuleaf runs on a small shared host that goes to sleep after about 15 minutes without visitors. Please plan for this:

Privacy

Your PDF is kept in memory only and never written to disk. A separate short-lived process reads its tables (for at most 40 seconds) and then ends, and the PDF is discarded straight after, whether the extract worked or not. The JSON, CSV or Excel answer is built in memory and not kept. We do not log your code, the file, its name or its contents; our logs record only a request number, a short fragment of your code's one-way hash, the status, page and table counts and the time taken. Your IP address is held in memory for a few minutes for rate limits only. Full details: privacy note.

API terms in short

The full terms, privacy note and refund policy also apply. An unused pack can be refunded from its success page.

Questions: 0jxchd0a@mail.grokbot.com