Overview
Scanned air waybills frequently contain two to four pages in a single PDF or TIFF file. Each page may be rotated, skewed, or scanned at a different resolution. KabyTech's multi-page pipeline detects individual pages, normalizes orientation, and merges extracted fields into a single structured result.
This tutorial walks through the three main steps: uploading the document, understanding auto-detection, and consuming the merged output. By the end you will be able to send a multi-page scan and receive a unified JSON response with all AWB fields.
Multi-page support works with PDF, TIFF, and multi-image uploads. Single-page formats like JPEG and PNG are also accepted — the API treats them as one-page documents automatically.
Step 1 — Upload the Document
The API accepts three upload methods: multipart form data, base64-encoded payloads, and public URLs. For multi-page documents, multipart is usually the simplest because you can stream the file without base64 overhead.
Below is a curl example that uploads a multi-page PDF. The response includes a job_id you can poll or receive via webhook.
curl -X POST https://api.kabytech.com/v1/parse \ -H "Authorization: Bearer $KABY_API_KEY" \ -F "file=@awb-scan-3pages.pdf" \ -F "mode=multipage"
In Python, the equivalent call uses the requests library with a files dict. The mode=multipage parameter tells the API to expect and handle multiple pages rather than treating only the first page.
import requests
resp = requests.post(
"https://api.kabytech.com/v1/parse",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": open("awb-scan-3pages.pdf", "rb")},
data={"mode": "multipage"},
)
print(resp.json())