Karatasi developer API
Free – 500 conversions a month per key. Need more? Starter and Pro plans. The same results as the website, from your own code.
- Compress a PDF under an exact size (for upload forms that say "max 200 KB").
- PDF to Word: an editable .docx that keeps the layout, or flowing text.
- Statement to Excel: a bank or mobile-money statement as a clean .xlsx, every row checked against the running balance.
One file is one conversion, whatever its number of pages. Files are converted in memory and sent straight back: nothing is stored.
1. Get a key
Get your free API key (sign in with Google; up to 2 keys). Each key is shown once: keep it secret, like a password. Send it with every request:
Authorization: Bearer kp_your_key
2. Limits
| Conversions | 500 a month for each key (they start again on the 1st, UTC) |
|---|---|
| Requests | 10 a minute for each key |
| Files | up to 10 MB and 200 pages; PDF only. Check the size before you send: a bigger file is refused only after it has been uploaded |
| Time | most files take a few seconds; allow up to a minute for big ones |
Address: https://karatasipdf.com/api/v1/ · Files are sent as multipart/form-data in a field named file.
3. Compress a PDF under a size
POST /api/v1/compress · fields: file, target_kb (kilobytes, such as 200, or with the unit, such as 500KB or 2MB; 1 KB = 1,000 bytes, as upload forms count it), optional as_pictures=true (if it cannot fit otherwise, every page becomes a picture; the words can then no longer be selected). Answer: the PDF, with X-Karatasi-Size-Before and X-Karatasi-Size-After.
curl -X POST https://karatasipdf.com/api/v1/compress \ -H "Authorization: Bearer $KARATASI_KEY" \ -F file=@report.pdf -F target_kb=200 -o report-200KB.pdf
// JavaScript (browser or Node 18+)
const form = new FormData();
form.append('file', fileBlob, 'report.pdf');
form.append('target_kb', '200');
const r = await fetch('https://karatasipdf.com/api/v1/compress', { method: 'POST', headers: { Authorization: 'Bearer ' + KARATASI_KEY }, body: form });
if (!r.ok) throw new Error((await r.json()).error.message);
const pdf = await r.blob();
# Python
import requests
r = requests.post('https://karatasipdf.com/api/v1/compress',
headers={'Authorization': 'Bearer ' + KARATASI_KEY},
files={'file': open('report.pdf', 'rb')}, data={'target_kb': 200})
r.raise_for_status()
open('report-200KB.pdf', 'wb').write(r.content)
4. PDF to Word
POST /api/v1/pdf-to-word · fields: file, optional mode = keep_layout (the default: looks like the PDF, text you can edit), flowing (paragraphs that reflow) or exact (each page as a picture), optional password. Answer: the .docx. Scanned pages come back as pictures (X-Karatasi-Scans-As-Pictures says how many); the website can read their words on your device.
curl -X POST https://karatasipdf.com/api/v1/pdf-to-word \ -H "Authorization: Bearer $KARATASI_KEY" \ -F file=@letter.pdf -F mode=keep_layout -o letter.docx
// JavaScript
const form = new FormData(); form.append('file', fileBlob, 'letter.pdf'); form.append('mode', 'flowing');
const r = await fetch('https://karatasipdf.com/api/v1/pdf-to-word', { method: 'POST', headers: { Authorization: 'Bearer ' + KARATASI_KEY }, body: form });
const docx = await r.blob();
# Python
r = requests.post('https://karatasipdf.com/api/v1/pdf-to-word', headers={'Authorization': 'Bearer ' + KARATASI_KEY},
files={'file': open('letter.pdf', 'rb')}, data={'mode': 'keep_layout'})
open('letter.docx', 'wb').write(r.content)
5. Statement to Excel
POST /api/v1/statement-to-excel · fields: file (a bank or mobile-money statement with real text), optional password (many statements are locked; the password is used for this file only and never kept). Answer: the .xlsx, with X-Karatasi-Balance-Check: passed (every row adds up), failed (some rows do not: they are marked in the sheet) or not_possible (the statement prints no running balance), and X-Karatasi-Rows.
curl -X POST https://karatasipdf.com/api/v1/statement-to-excel \ -H "Authorization: Bearer $KARATASI_KEY" \ -F file=@statement.pdf -F password=123456 -D - -o statement.xlsx
// JavaScript
const form = new FormData(); form.append('file', fileBlob, 'statement.pdf');
const r = await fetch('https://karatasipdf.com/api/v1/statement-to-excel', { method: 'POST', headers: { Authorization: 'Bearer ' + KARATASI_KEY }, body: form });
console.log(r.headers.get('X-Karatasi-Balance-Check'));
const xlsx = await r.blob();
# Python
r = requests.post('https://karatasipdf.com/api/v1/statement-to-excel', headers={'Authorization': 'Bearer ' + KARATASI_KEY},
files={'file': open('statement.pdf', 'rb')}, data={'password': '123456'})
print(r.headers['X-Karatasi-Balance-Check'])
open('statement.xlsx', 'wb').write(r.content)
6. Usage and health
GET /api/v1/usage (with your key) answers {"used":12,"limit":500,"resets":"2026-12-01"}. GET /api/v1/health answers {"ok":true,"version":"1"}. Neither counts as a conversion.
7. Errors
Every error is JSON: {"error":{"code":"...","message":"..."}}.
| 400 | something is missing or wrong in the request (no file, no target_kb, an unknown mode) |
|---|---|
| 401 | no API key, or a key that is not known (or was deleted) |
| 413 | the file is over 10 MB or 200 pages |
| 422 | the file cannot be converted: not a PDF, damaged, a password is needed or wrong, it cannot get under the size (with smallest_kb), no transactions found, or a scanned statement |
| 429 | over a limit: 10 requests a minute or 500 conversions a month. Wait for the number of seconds in Retry-After |
| 500 | our fault: try again, and write to hello@karatasipdf.com if it keeps happening |
Privacy
Files are converted in memory on Google Cloud and sent straight back. They are not stored, and no file, file name or password is logged. Karatasi keeps only a fingerprint of each key and its counts (see the privacy policy and terms).
Questions or ideas for more tools on the API: hello@karatasipdf.com.