OERENA

Documentation · API Reference

Extract a document

OERENA Document Intelligence API reference and integration guidance.

Extract a document

MethodPOST
Endpointhttps://api.oerena.com/v1/documents/extract
AuthenticationBearer OERENA API key
Content-Typemultipart/form-data
Form fieldfile (exactly one file)
Supported MIME typesapplication/pdf, image/jpeg, image/png
Maximum upload10 MiB (10,485,760 bytes)
Current page ceiling10 pages per document
Image validationJPEG/PNG magic bytes and a 25-million-pixel maximum are checked

The service rejects malformed multipart bodies, extra fields or files, unsupported MIME types, disguised file content, encrypted PDFs, oversized uploads, and documents above the enforced page limit.

cURL

curl -X POST "https://api.oerena.com/v1/documents/extract" \
  -H "Authorization: Bearer YOUR_OERENA_API_KEY" \
  -F "file=@document.pdf"

Node.js

import { readFile } from "node:fs/promises";

const file = await readFile("./document.pdf");
const form = new FormData();
form.append("file", new Blob([file], { type: "application/pdf" }), "document.pdf");

const response = await fetch("https://api.oerena.com/v1/documents/extract", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.OERENA_API_KEY}` },
  body: form,
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.request_id}: ${result.error?.message}`);
console.log(result.data.document.text);

Python

import os
import requests

with open("document.pdf", "rb") as document:
    response = requests.post(
        "https://api.oerena.com/v1/documents/extract",
        headers={"Authorization": f"Bearer {os.environ['OERENA_API_KEY']}"},
        files={"file": ("document.pdf", document, "application/pdf")},
        timeout=60,
    )
result = response.json()
if not response.ok:
    raise RuntimeError(f"{result.get('request_id')}: {result['error']['message']}")
print(result["data"]["document"]["text"])