apyhub
Back
▣ ARTIFICIAL INTELLIGENCE · DATA EXTRACTION

AI Image Optical Character Recognition (OCR) API

Hosted on ApyHub

What it does

The Image OCR API extracts text from images. Upload a binary file or send a public image url, add an optional BCP-47 language code, and get the recognized text back as JSON under data.apyhub or data.azure.

Choose the engine with requested_service: apyhub (default) or azure for Azure Vision Read. You can pass your own Azure credentials in the request when you want to use an existing Azure account.

Use this image to text API for receipt capture, scanned forms, screenshot parsing, ID and label photos, and document indexing. The JSON output goes straight into search, classification or validation steps, so text from a photo becomes searchable data without manual retyping. AI agents can call the OCR API through ApyHub MCP to read images inside a workflow.

This API returns the raw text in each image. For structured fields such as totals and dates, send receipts to the AI Document Receipt Data Extraction API.

Working with PDFs? Use the Extract Text from PDF API for digital documents, or split scanned pages with the Convert PDF to Image API and run each page through OCR.

Provider (requested_service)Atoms
Azure500
ApyHub2000
▣ ENDPOINT 01 / 02
POST
Extract text from image (file upload)
https://api.eu.apyhub.com/apyhub/extract-text-from-image/file

QUICKSTART

GUIDE

Quickstart

Upload an image file to extract text from it.

curl -X POST "https://api.eu.apyhub.com/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

ParameterTypeDescription
fileBinaryBinary image file to process.
languageStringBCP-47 language code of the text in the image.
azure_keyStringAzure key used for Azure-based extraction.
azure_regionStringAzure region.
azure_endpointStringAzure endpoint URL.
azure_account_idStringAzure account ID.
requested_serviceENUMWhich service to use for extraction. Allowed values: azure, apyhub. Default: apyhub.
azure_access_tokenStringAzure 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.

ParameterTypeDescription
dataObjectWrapper object for OCR results.
data.azureObjectText elements extracted via Azure Vision Read API.
data.apyhubObjectText elements extracted via ApyHub OCR.

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)
https://api.eu.apyhub.com/apyhub/extract-text-from-image/url

QUICKSTART

GUIDE

Quickstart

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

curl -X POST "https://api.eu.apyhub.com/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.

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

ParameterTypeDescription
urlStringImage URL to extract text from. Must be a URI.
azureObjectCustom credentials for Azure services. Contains the optional fields key, region, endpoint, account_id, and access_token. See schema for nested fields.
azure.keyStringAzure subscription key.
azure.regionStringAzure service region.
azure.endpointStringAzure endpoint URL.
azure.account_idStringAzure account ID.
azure.access_tokenStringOAuth access token for Azure service.
languageStringBCP-47 language code of the text in the image.
requested_serviceENUMService 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.

ParameterTypeDescription
dataObjectContainer for the extraction result.
data.azureObjectText elements extracted via Azure Vision Read API.
data.apyhubObjectText elements extracted via ApyHub OCR.
▣ 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.