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
- Works on digital, text-based PDFs only: if you can select and copy the words in a PDF viewer, it should work.
- There is no OCR. Scans and photos of pages are rejected with
convert_error, and no credit is used. - Results are not checked by a person and come with no accuracy promise. Ruled and simple tables usually come out well; complex, nested or borderless layouts can be incomplete or wrong. Check the output before you rely on it, and do not use it as the only basis for legal, tax or financial decisions.
- Limits per file: 10 MB, 50 pages and 40 seconds of reading time (see below).
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
| Method | Path | Auth | What it does |
|---|---|---|---|
| POST | /api/v1/extract | Bearer code | Upload one PDF and get its tables (uses 1 credit on success) |
| GET | /api/v1/credits | Bearer code | Credits left on your code and its expiry date |
| GET | /api/v1/health | none | Check that the service is awake |
Extract tables
Send a multipart/form-data request with the PDF in a field named file. Optional fields:
output:json(default),csvorxlsx.pages: a 1-based page list such as1-3,7. Only those pages are read, but it is still 1 credit per file, and the whole file must be within the 50-page limit.
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.
| HTTP | error | When |
|---|---|---|
| 400 | bad_request | No file, or a bad output or pages, or an Idempotency-Key that is not 32-128 characters of letters, digits, ., _ or - |
| 401 | unauthorized | Missing, mistyped, unknown or inactive code |
| 402 | no_credits | No credits left, or the code is more than 12 months old |
| 409 | already_processed | The same Idempotency-Key already succeeded |
| 413 | too_large | The upload is over 10 MB |
| 415 | not_pdf | The file is not a PDF |
| 422 | convert_error | Locked or damaged file, no pages, more than 50 pages, no selectable text (a scan or photo), or no tables found |
| 422 | too_slow | Reading the file took longer than 40 seconds, so it was stopped. No credit is used; send fewer pages or a shorter file |
| 503 | temporarily_unavailable | API 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" |
| 422 | too_complex | The 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 |
| 429 | rate_limited | Too many requests, or another extract is running. Wait for the number of seconds in Retry-After |
| 500 | server_error | Something went wrong on our side |
Rate limits
- Per code: 30 extracts every 10 minutes, and one extract at a time.
- Per IP address: 60 API requests every 10 minutes, including failed ones.
- The API reads one PDF at a time (the website has its own, separate slot), so you may get
429withRetry-Afterwhile another API file is being read.
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:
- The first request after a quiet spell can take about a minute, and may get an HTML loading page instead of JSON. Retry until you get a JSON, CSV or Excel answer, for up to about 2 minutes.
- Each file has a hard limit of 40 seconds of reading time. A file that takes longer is stopped and gets
422too_slow, and no credit is used. A file that needs more memory than our limit gets422too_complex, also with no credit used. Set your client's timeout to at least 120 seconds end to end (wake-up, a possible wait for the slot, plus the extract). - Long or dense files (many pages packed with small text) are the slowest and can hit the limit. Splitting a long document and sending only the pages you need (with
pages) helps.
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 API is provided as is, with no promise of uptime or of accurate results.
- Acceptable use: lawful use only, only files you have a right to process, no malware, no sharing or publishing your code, and no overloading the service or getting around the limits.
- We may switch off a code that is used for abuse.
- This summary is not legal advice and does not limit any rights you have under the Consumer Guarantees Act 1993 where it applies.
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