Welkom Terug

Log in om toegang te krijgen tot je documenten en handtekeningen

of ga verder met e-mail
Wachtwoord vergeten?
API v1 · Stabiel

WHAT A PDF! Ontwikkelaars-API

Verwerk PDF's op schaal vanuit je applicatie. Comprimeer, voeg samen, splits en OCR via een schone REST-interface met Bearer-token-authenticatie en ratelimieten per plan.

Snelstart

Drie stappen tot je eerste API-aanroep.

  1. Maak een API-sleutel aan via Account › API-sleutels
  2. Stuur een multipart/form-data POST naar een van de v1-endpoints met een Authorization: Bearer-header.
  3. Bekijk het JSON-antwoord — geslaagde aanroepen geven een ondertekende download-URL terug die 15 minuten geldig is.

Basis-URL

https://whatapdf.com/api/v1

Authenticatie

Elk verzoek moet een Authorization-header bevatten met je API-sleutel als Bearer-token.

Authorization: Bearer pdn_live_a1b2c3d4e5f6...
Houd je live-sleutels geheim. Behandel ze als wachtwoorden. Plaats ze nooit in versiebeheer en stel ze niet bloot in client-side code.

Sleutelformaten

  • pdn_live_<32 hex> — Productiesleutel. Telt mee voor het ratelimit van je plan.
  • pdn_test_<32 hex> — Testsleutel. Zelfde ratelimit; handig om omgevingen in logs te onderscheiden.

Ratelimieten

Ratelimieten worden berekend per gebruiker, per rollend venster van 1 uur. Elk antwoord bevat X-RateLimit-*-headers zodat je je retries kunt plannen.

PlanVerzoeken / uur
Free10
Premium1,000
Business5,000
EnterpriseOnbeperkt

Response-headers

  • X-RateLimit-Limit — Het uurlijkse maximum van je plan.
  • X-RateLimit-Remaining — Resterende aanroepen in het huidige venster.
  • X-RateLimit-Reset — Unix-tijdstempel waarop het venster reset.
  • Retry-After — Wachttijd in seconden, alleen verzonden bij 429-antwoorden.

Foutmeldingen

Alle fouten worden geretourneerd als JSON met een stabiele code en een leesbaar bericht.

{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded for your plan (free: 10/hour)."
  },
  "meta": { "request_id": "8f9a2b3c1d4e5f6a" }
}

Foutcodes

CodeHTTPBetekenis
unauthorized401Ontbrekende, ongeldige of ingetrokken API-sleutel.
rate_limited429Uurlijks ratelimit voor je plan overschreden.
invalid_input400Body of parameters van het verzoek zijn ongeldig.
payload_too_large413Bestand of gecombineerde payload overschrijdt de groottelimiet van je plan.
internal_error500Onverwachte serverfout. Veilig om opnieuw te proberen met backoff.

POST /compress

Comprimeer een PDF met Ghostscript wanneer beschikbaar, met FPDI-fallback. Geeft een ondertekende download-URL terug.

POSThttps://whatapdf.com/api/v1/compress

Parameters (multipart/form-data)

NaamTypeBeschrijving
file *filePDF-bestand om te comprimeren.
levelstringCompressievoorinstelling. low, medium, high

Codevoorbeelden

curl -X POST https://whatapdf.com/api/v1/compress \
  -H "Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -F "[email protected]" \
  -F "level=medium"
const form = new FormData();
form.append('file', fileInput.files[0]);
form.append('level', 'medium');

const res = await fetch('https://whatapdf.com/api/v1/compress', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' },
  body: form,
});
const json = await res.json();
console.log(json.data.download.url);
import requests

with open('input.pdf', 'rb') as f:
    r = requests.post(
        'https://whatapdf.com/api/v1/compress',
        headers={'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'},
        files={'file': f},
        data={'level': 'medium'},
    )
print(r.json())
<?php
$ch = curl_init('https://whatapdf.com/api/v1/compress');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'],
    CURLOPT_POSTFIELDS     => [
        'file'  => new CURLFile('input.pdf', 'application/pdf'),
        'level' => 'medium',
    ],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($res);

Voorbeeldantwoord

{
  "data": {
    "filename": "report_compressed.pdf",
    "original_size": 5242880,
    "compressed_size": 2621440,
    "savings_percent": 50.0,
    "method": "ghostscript",
    "download": {
      "url": "/api/get-pdf.php?file=...&exp=...&sig=...",
      "expires_in": 900
    }
  },
  "meta": { "request_id": "8f9a2b3c1d4e5f6a" }
}

POST /merge

Voeg 2–20 PDF's samen tot één document in de volgorde van uploaden.

POSThttps://whatapdf.com/api/v1/merge

Parameters

NaamTypeBeschrijving
files[] *file[]Twee of meer PDF-bestanden (multipart array).

Codevoorbeelden

curl -X POST https://whatapdf.com/api/v1/merge \
  -H "Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -F "files[][email protected]" \
  -F "files[][email protected]" \
  -F "files[][email protected]"
const form = new FormData();
for (const f of fileInput.files) form.append('files[]', f);

const res = await fetch('https://whatapdf.com/api/v1/merge', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' },
  body: form,
});
console.log(await res.json());
import requests

files = [
    ('files[]', open('a.pdf', 'rb')),
    ('files[]', open('b.pdf', 'rb')),
    ('files[]', open('c.pdf', 'rb')),
]
r = requests.post(
    'https://whatapdf.com/api/v1/merge',
    headers={'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'},
    files=files,
)
print(r.json())
<?php
$ch = curl_init('https://whatapdf.com/api/v1/merge');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'],
    CURLOPT_POSTFIELDS     => [
        'files[0]' => new CURLFile('a.pdf', 'application/pdf'),
        'files[1]' => new CURLFile('b.pdf', 'application/pdf'),
        'files[2]' => new CURLFile('c.pdf', 'application/pdf'),
    ],
]);
echo curl_exec($ch);
curl_close($ch);

POST /split

Splits een PDF in een of meer delen op basis van paginabereiken. Elk deel krijgt zijn eigen ondertekende download-URL.

POSThttps://whatapdf.com/api/v1/split

Parameters

NaamTypeBeschrijving
file *fileBron-PDF.
ranges *stringDoor komma's gescheiden paginabereiken. Eén bereik = één uitvoerdeel. e.g. 1-3,5,7-9

Codevoorbeelden

curl -X POST https://whatapdf.com/api/v1/split \
  -H "Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -F "[email protected]" \
  -F "ranges=1-3,5,7-9"
const form = new FormData();
form.append('file', fileInput.files[0]);
form.append('ranges', '1-3,5,7-9');

const res = await fetch('https://whatapdf.com/api/v1/split', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' },
  body: form,
});
console.log(await res.json());
import requests

with open('input.pdf', 'rb') as f:
    r = requests.post(
        'https://whatapdf.com/api/v1/split',
        headers={'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'},
        files={'file': f},
        data={'ranges': '1-3,5,7-9'},
    )
for part in r.json()['data']['parts']:
    print(part['pages'], part['download']['url'])
<?php
$ch = curl_init('https://whatapdf.com/api/v1/split');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'],
    CURLOPT_POSTFIELDS     => [
        'file'   => new CURLFile('input.pdf', 'application/pdf'),
        'ranges' => '1-3,5,7-9',
    ],
]);
print_r(json_decode(curl_exec($ch), true));
curl_close($ch);

POST /ocr

Extraheer tekst uit een afbeelding met Tesseract OCR. Ondersteunt 20+ talen.

POSThttps://whatapdf.com/api/v1/ocr

Parameters

NaamTypeBeschrijving
image *fileAfbeelding om te OCR'en (PNG, JPEG, TIFF, WebP of BMP).
languagestringTesseract-taalcode. Standaard eng

Codevoorbeelden

curl -X POST https://whatapdf.com/api/v1/ocr \
  -H "Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -F "[email protected]" \
  -F "language=eng"
const form = new FormData();
form.append('image', imageInput.files[0]);
form.append('language', 'eng');

const res = await fetch('https://whatapdf.com/api/v1/ocr', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' },
  body: form,
});
const { data } = await res.json();
console.log(data.text);
import requests

with open('scan.png', 'rb') as f:
    r = requests.post(
        'https://whatapdf.com/api/v1/ocr',
        headers={'Authorization': 'Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'},
        files={'image': f},
        data={'language': 'eng'},
    )
print(r.json()['data']['text'])
<?php
$ch = curl_init('https://whatapdf.com/api/v1/ocr');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer pdn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'],
    CURLOPT_POSTFIELDS     => [
        'image'    => new CURLFile('scan.png', 'image/png'),
        'language' => 'eng',
    ],
]);
$res = json_decode(curl_exec($ch), true);
echo $res['data']['text'];
curl_close($ch);
WHAT A PDF! voor Gmail - Chrome Extensie

Open PDF bijlagen vanuit Gmail direct in WHAT A PDF!. Bewerk, onderteken en converteer je PDF's direct!

Installeer Gratis Extensie

Wait — don't miss out!

Subscribe for free PDF tips, new tools, and feature updates delivered to your inbox.

No spam ever. Unsubscribe anytime.