While Reducto has a lot of capabilities, the most basic workflow is uploading a document and getting the parsed output for it. The easiest way to access our APIs is through our SDKs, available in Python and Node.js/Javascript.

Need help finding your API Key? Find them in your account under “API Keys” at app.reducto.ai.

Using the Reducto SDKs

1

Install the SDK

pip install reductoai
2

Parse a Document

from pathlib import Path
from reducto import Reducto

client = Reducto()
upload = client.upload(file=Path("sample.pdf"))
result = client.parse.run(document_url=upload)

print(result)
3

[Optional] Parsing with Configurations

Reducto’s APIs offer a wide range of configurations that customize for your use case. Check out our API Reference or “Configurations” section for more.

from pathlib import Path
from reducto import Reducto

client = Reducto()
upload = client.upload(file=Path("sample.pdf"))
result = client.parse.run(
  document_url=upload,
  options={ # Sample configurations
    "ocr_mode": "agentic",
    "extraction_mode": "ocr",
    "chunking": {
        "chunk_mode": "variable",
    }
  },
  advanced_options={
    "ocr_system": "multilingual",
    "page_range": {
        "start": 1,
        "end": 10,
    },
    "table_output_format": "ai_json",
    "merge_tables": True,
  },
  experimental_options={
    "enable_checkboxes": True,
    "return_figure_images": False,
    "rotate_pages": True,
  }
)

print(result)

Using the REST API Endpoint

All endpoints have an API playground you can explore and use to get sample code.

import requests

url = "https://platform.reducto.ai/parse"

payload = {
    "options": {
      "ocr_mode": "agentic",
    },
    "advanced_options": {
      "page_range": {
        "start": 1,
        "end": 10,
      },
    },
    "priority": True
}
headers = {
    "Authorization": "Bearer REDUCTO_API_KEY",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)