apyhub
ARTIFICIAL INTELLIGENCE · DATA EXTRACTION

Document Extraction

What it does

Document Extraction lets you send a PDF or other document by URL or file upload and get extracted document data back. Choose the extraction backend with requested_service, either azure or apyhub.

Use POST /url when the document is already hosted online. Send url and requested_service, and include the optional azure object when you need Azure-specific settings such as key, region, endpoint, account_id, or access_token. Use POST /file when you want to upload the document directly as binary data. That endpoint accepts file, requested_service, and the optional Azure fields azure_key and azure_endpoint.

The response is consistent across both endpoints: a data object containing an azure object when requested_service is azure, or an apyhub object when requested_service is apyhub. The service returns the extraction result in whichever backend object you requested.

Use Document Extraction when you need to turn invoices, forms, statements, or scanned reports into machine-readable data without writing your own document parsing pipeline. It fits ingestion workflows, records processing, and any app that needs document content pulled from a URL or upload.

▣ ENDPOINT 01 / 02
POST
Document Extraction via URL
https://api.eu.apyverse.com/apyhub/document-extraction/url

QUICKSTART

GUIDE

Quickstart

Send a document URL and choose which extraction service to use.

curl -X POST "https://api.eu.apyverse.com/apyhub/document-extraction/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.pdf",
    "requested_service": "azure"
  }'

What you'll get back

Returns a JSON object with a top-level data object. The data object contains an azure object when requested_service is azure, or an apyhub object when requested_service is apyhub.

{
  "data": {
    "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

About this endpoint

What it does

Extracts document data from a file available at a URL. You choose the extraction service with requested_service, and the response returns a data object containing the result under either azure or apyhub.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe document URL to extract from. Must be a URI.
requested_serviceENUMYesThe extraction backend to use: azure or apyhub.
azureObjectNoAzure-specific connection details used when requested_service is azure.
azure.keyStringNoAzure key.
azure.regionStringNoAzure region.
azure.endpointStringNoAzure endpoint. Must be a URI.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoAzure access token.

Response

Returns a JSON object with a data object field. The data object contains either an azure object or an apyhub object, depending on the requested service.

ParameterTypeMandatoryDescription
dataObjectYesWrapper object for the extraction result.
data.azureObjectNoPresent when requested_service is azure.
data.apyhubObjectNoPresent when requested_service is apyhub.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
POST
Document Extraction via file upload
https://api.eu.apyverse.com/apyhub/document-extraction/file

QUICKSTART

GUIDE

Quickstart

Upload a document file and ask the API to extract it with the Azure or ApyHub service.

curl -X POST "https://api.eu.apyverse.com/apyhub/document-extraction/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "requested_service=azure"

What you'll get back

Returns a JSON object with a data object. Inside data, the API may return an azure object when requested_service is azure, or an apyhub object when requested_service is apyhub.

{
  "data": {
    "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.
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 document file and runs document extraction using the requested service. The response returns a JSON object containing a data object with the extraction result under either azure or apyhub, depending on the requested service.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe document file to upload. Binary file content (format: binary).
azure_keyStringNoAzure key used when requested_service is azure.
azure_endpointStringNoAzure endpoint used when requested_service is azure.
requested_serviceENUMYesThe service to use for extraction. Allowed values: azure, apyhub.

Response

Returns a JSON object with a required data object field. Inside data, the extraction result is provided in either the azure object or the apyhub object; the schema does not define any fixed inner fields for those objects.

ParameterTypeMandatoryDescription
dataObjectYesContainer for the extraction result.
data.azureObjectNoPresent when requested_service is azure. The schema allows additional properties, but does not define specific fields.
data.apyhubObjectNoPresent when requested_service is apyhub. The schema allows additional properties, but does not define specific fields.

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.

▣ 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.