OCR (documents)
Extract text from images and PDFs (including multi-page PDFs) and get markdown back.
POST https://api.norlen.io/v1/ocrAuthorization: Bearer YOUR_API_KEYRequest
Section titled “Request”multipart/form-data — send the file to process.
| Field | Type | Required | Description |
|---|---|---|---|
file | file | yes | Image (png, jpg, webp, bmp, tiff) or pdf — up to 20MB |
clean | string | no | true strips layout/detection markup; defaults to false |
curl https://api.norlen.io/v1/ocr \ -H "Authorization: Bearer $NORLEN_API_KEY" \ -F file="@document.pdf" \ -F clean="true"import requests
resp = requests.post( "https://api.norlen.io/v1/ocr", headers={"Authorization": f"Bearer {NORLEN_API_KEY}"}, files={"file": open("document.pdf", "rb")}, data={"clean": "true"},)print(resp.json()["text"])import fs from "fs";
const fd = new FormData();fd.append("file", new Blob([fs.readFileSync("document.pdf")]), "document.pdf");fd.append("clean", "true");
const resp = await fetch("https://api.norlen.io/v1/ocr", { method: "POST", headers: { Authorization: `Bearer ${process.env.NORLEN_API_KEY}` }, body: fd,});const { text } = await resp.json();console.log(text);Response
Section titled “Response”{ "text": "# Document title\n\nExtracted content as markdown..."}Multi-page PDFs are processed in sequence and concatenated into the same text.