Skip to main content
POST
/
v3
/
ocr
Extract text (OCR)
curl --request POST \
  --url https://api.opper.ai/v3/ocr \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "document": {
    "type": "<string>",
    "content": "<string>",
    "document_name": "<string>",
    "document_url": "<string>",
    "file_id": "<string>",
    "image_url": "<string>"
  },
  "model": "<string>"
}
'
{
  "id": "<string>",
  "model": "<string>",
  "pages": [
    {
      "index": 123,
      "markdown": "<string>",
      "dimensions": {},
      "elements": [
        {}
      ],
      "images": [
        {}
      ]
    }
  ],
  "usage": {
    "cost": 123,
    "pages_processed": 123
  }
}
See the OCR guide for runnable examples, document sources (URL / base64 / file_id), and language options.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
document
object
required
model
string
required
image_limit
integer
image_min_size
integer
include_image_base64
boolean
pages
integer[]
parameters
object

Response

Successful response

id
string
required
model
string
required
pages
object[]
required
usage
object
required