apyhub
ARTIFICIAL INTELLIGENCE · DATA EXTRACTION

AI Document Data Extraction API

Hosted on ApyHub

What it does

Document Extraction lets you send a file or a document URL and receive extracted document data back in a structured response. Choose whether to route the request to azure or apyhub with requested_service, and the API returns a data object containing the corresponding result under azure or apyhub.

Use the /file endpoint when you already have the document bytes ready to upload. The request accepts file, requested_service, and optional Azure settings such as azure_key and azure_endpoint. Use /url when the document is already hosted remotely; send the url, requested_service, and optional Azure configuration inside the azure object, including key, region, endpoint, account_id, and access_token.

Document Extraction is useful when you need to pull text or document content into downstream systems without building your own ingestion layer. For example, you can ingest PDFs from a storage bucket, process invoices or forms from a download link, and hand the returned document payload to search, review, or workflow steps.

The response is intentionally flexible: it returns a top-level data object with either an azure payload or an apyhub payload depending on the service you request. That makes it suitable for integrating document parsing into systems that need a consistent interface while keeping the provider-specific output available.

Provider (requested_service)Atoms
Azure500
ApyHub2000
▣ ENDPOINT 01 / 02
POST
Document Extraction via file upload
http://localhost:8080/apyhub/document-extraction/file
QUICKSTARTGUIDE

Quickstart

Upload a document file and choose which extraction service to use.

curl -X POST "http://localhost:8080/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 field. The data object may include an azure object when requested_service is azure, or an apyhub object when requested_service is apyhub.

{
  "data": {
    "azure": {}
  }
}
TRY ITLIVE · 550 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 with a data object that may contain extracted results under azure or apyhub, depending on requested_service.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe document file to upload. Binary file input.
azure_keyStringNoAzure key used when requested_service is azure.
azure_endpointStringNoAzure endpoint used when requested_service is azure.
requested_serviceENUMYesThe extraction service to use. Allowed values: azure, apyhub.

Response

Returns a JSON object with a data object field. Inside data, the schema defines optional azure and apyhub object fields, which contain the extraction result for the corresponding service when present.

AttributeTypeMandatoryDescription
dataObjectYesWrapper object for the extraction result.
data.azureObjectNoPresent when requested_service is azure. Contains the Azure extraction result; the schema allows additional properties.
data.apyhubObjectNoPresent when requested_service is apyhub. Contains the ApyHub extraction result; the schema allows additional properties.

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
Document Extraction via URL
http://localhost:8080/apyhub/document-extraction/url
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/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 data object. The data object contains the extraction result from the selected service, under either azure or apyhub depending on requested_service.

{
  "data": {
    "azure": {}
  }
}
TRY ITLIVE · 550 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

Submits a document URL for extraction and routes the request to the selected service. The request body must include the document url and a requested_service value of azure or apyhub; if requested_service is azure, you can also provide Azure connection details under azure.

Request Body

ParameterTypeMandatoryDescription
urlStringYesDocument URL to extract from. Format: URI.
azureObjectNoAzure configuration object. Present when using Azure; see schema for nested fields.
azure.keyStringNoAzure key.
azure.regionStringNoAzure region.
azure.endpointStringNoAzure endpoint. Format: URI.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoAzure access token.
requested_serviceENUMYesService to use for extraction. Allowed values: azure, apyhub.

Response

Returns a JSON object with a required data object field. The data object may contain an azure object when requested_service is azure, and/or an apyhub object when requested_service is apyhub.

ParameterTypeMandatoryDescription
dataObjectYesResponse payload container.
data.azureObjectNoPresent when requested_service is azure. Additional properties are allowed.
data.apyhubObjectNoPresent when requested_service is apyhub. Additional properties are allowed.

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.