apyhub
ARTIFICIAL INTELLIGENCE · DATA EXTRACTION

OCR Document Data Extraction API

Hosted on ApyHub

What it does

Read Data Extractor pulls text-layout parsing results from a PDF or other readable file, or from a file URL. Send a binary file to POST /file or a url to POST /url, and choose whether you want the apyhub result or the azure result with requested_service.

The service accepts optional Azure credentials when you want to run against Azure Document Intelligence. For file uploads, you can pass azure_key, azure_region, azure_endpoint, azure_account_id, and azure_access_token. For URL-based extraction, the azure object can include key, region, endpoint, account_id, and access_token.

The response is returned under data, with separate azure and apyhub objects. azure contains the raw Azure Document Intelligence parsing output, while apyhub contains the structured ApyHub Read Layout Transcription parsing output. That makes it useful when you need to compare provider output, route documents through an internal extraction pipeline, or feed parsed document content into downstream review and indexing workflows.

Use Read Data Extractor when you need programmatic access to extracted document reading data without building your own ingestion and parsing layer.

▣ ENDPOINT 01 / 02
POST
Extract read data
http://localhost:8080/apyhub/extract-read-data/file
QUICKSTARTGUIDE

Quickstart

Upload a file to extract read data.

curl -X POST "http://localhost:8080/apyhub/extract-read-data/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file" \
  -F "requested_service=apyhub" 

What you'll get back

Returns a JSON object with a data object. The data object may contain either an azure object with the raw Azure Document Intelligence parsing output, or an apyhub object with the structured ApyHub Read Layout Transcription parsing output.

{
  "data": {
    "azure": {},
    "apyhub": {}
  }
}
TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Uploads a file and returns extracted read-data parsing output. You can choose whether the response should contain Azure Document Intelligence output, ApyHub Read Layout Transcription output, or both, depending on the request fields you send.

Request Body

ParameterTypeMandatoryDescription
fileStringYesBinary file upload.
azure_keyStringYes (if azure is selected in requested_service)Azure key value.
azure_regionStringNoAzure region string.
azure_endpointStringYes (if azure is selected in requested_service)Azure endpoint URL.
azure_account_idStringYes (if azure is selected in requested_service)Azure account identifier.
requested_serviceENUMNoService to use for extraction. Allowed values: azure, apyhub. Default: apyhub.
azure_access_tokenStringNoAzure access token.

Response

Returns a JSON object with a data object field. The data object may contain azure and/or apyhub object fields with parsing output.

ParameterTypeMandatoryDescription
dataObjectNoResponse wrapper containing parsing output.
data.azureObjectNoRaw Azure Document Intelligence parsing output.
data.apyhubObjectNoStructured ApyHub Read Layout Transcription parsing output.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 02
POST
Extract read data (URL input)
http://localhost:8080/apyhub/extract-read-data/url
QUICKSTARTGUIDE

Quickstart

Send a PDF URL for parsing and let ApyHub return extracted read data.

curl -X POST "http://localhost:8080/apyhub/extract-read-data/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.docx","requested_service":"apyhub"}'

What you'll get back

Returns a JSON object with a data object field. The data object may contain an apyhub object with structured ApyHub Read Layout Transcription parsing output, and/or an azure object with raw Azure Document Intelligence parsing output.

{
  "data": {
    "apyhub": {},
    "azure": {}
  }
}
TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
azure
Custom credentials for Azure services.
Azure subscription key.
Azure service region.
Azure endpoint URL.
Azure account ID.
OAuth access token for Azure service.

About this endpoint

What it does

Extracts read data from a document at the provided URL and returns parsing output in a JSON object. You can request either the apyhub or azure service output through the request body.

Request Body

ParameterTypeMandatoryDescription
urlStringYesDocument URL to process. Must be a valid URI.
azureObjectNoCustom credentials for Azure services. See schema for nested fields.
azure.keyStringYes (if azure is selected in requested_service)Azure subscription key.
azure.regionStringNoAzure service region.
azure.endpointStringYes (if azure is selected in requested_service)Azure endpoint URL.
azure.account_idStringYes (if azure is selected in requested_service)Azure account ID.
azure.access_tokenStringNoOAuth access token for Azure service.
requested_serviceENUMNoService to use for extraction. Allowed values: azure, apyhub. Default: apyhub.

Response

Returns a JSON object with a data object field. Inside data, the response may include an azure object for raw Azure Document Intelligence parsing output and/or an apyhub object for structured ApyHub Read Layout Transcription parsing output.

ParameterTypeMandatoryDescription
dataObjectNoResponse payload containing service-specific parsing output.
data.azureObjectNoRaw Azure Document Intelligence parsing output.
data.apyhubObjectNoStructured ApyHub Read Layout Transcription parsing output.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.