apyhub
ARTIFICIAL INTELLIGENCE · DATA EXTRACTION

AI Image Optical Character Recognition (OCR) API

Hosted on ApyHub

What it does

Image Text Extraction turns an image into text. Send a file upload or an image URL, optionally include a BCP-47 language code, and get extracted text back in data.azure or data.apyhub depending on the service you request.

Use the /file endpoint when you already have the image in your request body. Use /url when the image lives at a public URI. Both endpoints accept requested_service with azure or apyhub, so you can route OCR through Azure Vision Read API or ApyHub OCR. The file upload endpoint also supports Azure-specific credential fields in the body, and the URL endpoint accepts an azure object with custom Azure credentials.

This is a fit for receipt capture, document indexing, screenshot parsing, and any workflow where you need machine-readable text from an image. The response is structured, so you can pass the extracted text into search, review, classification, or downstream validation steps without manual copying.

Provider (requested_service)Atoms
Azure500
ApyHub2000
▣ ENDPOINT 01 / 02
POST
Extract text from image (file upload)
http://localhost:8080/apyhub/extract-text-from-image/file
QUICKSTARTGUIDE

Quickstart

Upload an image file to extract text from it.

curl -X POST "http://localhost:8080/apyhub/extract-text-from-image/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.png"

What you'll get back

Returns a JSON object with a data field. The data value is an object that may contain azure text elements from Azure Vision Read API and/or apyhub text elements from ApyHub OCR.

{
  "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*
BCP-47 language code of the text in the image.

About this endpoint

What it does

Uploads an image file and extracts text from it. The response returns a data object containing OCR results for the supported extraction services.

Request Body

ParameterTypeMandatoryDescription
fileStringYesBinary image file to process.
languageStringNoBCP-47 language code of the text in the image.
azure_keyStringNoAzure key used for Azure-based extraction.
azure_regionStringNoAzure region.
azure_endpointStringNoAzure endpoint URL.
azure_account_idStringNoAzure account ID.
requested_serviceENUMNoWhich service 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 can contain azure and apyhub object fields with text elements extracted by the corresponding OCR service.

ParameterTypeMandatoryDescription
dataObjectNoWrapper object for OCR results.
data.azureObjectNoText elements extracted via Azure Vision Read API.
data.apyhubObjectNoText elements extracted via ApyHub OCR.

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 text from image (URL input)
http://localhost:8080/apyhub/extract-text-from-image/url
QUICKSTARTGUIDE

Quickstart

Send an image URL to extract text from it with the default OCR service.

curl -X POST "http://localhost:8080/apyhub/extract-text-from-image/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.png"}'

What you'll get back

Returns a JSON object with a data object field. The data object may contain azure and/or apyhub objects with the extracted text results.

{
  "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.
BCP-47 language code of the text in the image.

About this endpoint

What it does

Extracts text from an image located at a URL and returns the OCR result in a data object. The response includes either the azure or apyhub result object, depending on which extraction service is used.

Request Body

ParameterTypeMandatoryDescription
urlStringYesImage URL to extract text from. Must be a URI.
azureObjectNoCustom credentials for Azure services. Contains the optional fields key, region, endpoint, account_id, and access_token. See schema for nested fields.
azure.keyStringNoAzure subscription key.
azure.regionStringNoAzure service region.
azure.endpointStringNoAzure endpoint URL.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoOAuth access token for Azure service.
languageStringNoBCP-47 language code of the text in the image.
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 schema declares two possible object fields: azure and apyhub, which contain text elements extracted via Azure Vision Read API and ApyHub OCR, respectively.

ParameterTypeMandatoryDescription
dataObjectNoContainer for the extraction result.
data.azureObjectNoText elements extracted via Azure Vision Read API.
data.apyhubObjectNoText elements extracted via ApyHub OCR.

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.