Image Operations

Extract text from an image

Creates a task to extract text from a specified image file.

POST
/v1/image-operations/extract-text

Authorization

x-api-key
<token>

API Key for authentication

In: header

Request Body

application/jsonOptional
body
Plain | Markdown | HTML | JSON

Extract text from an image in various formats.

Response Body

The response of an extract-text task

TypeScript Definitions

Use the response body type in TypeScript.

responserequired
Extract Text Response

The response of an extract-text task

curl -X POST "https://api.scan-documents.com/v1/image-operations/extract-text" \
  -H "x-api-key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "file_avyrvozb9302uwhq",
    "format": "plain"
  }'
{
  "id": "task_euyrvozb9302uwhq",
  "operation": "extract-text",
  "parameters": {
    "input": "file_avyrvozb9302uwhq",
    "format": "plain"
  },
  "status": "completed",
  "result": {
    "format": "plain",
    "content": "This is a sample text extracted from an image."
  },
  "created_at": "2021-05-01T12:00:00Z",
  "updated_at": "2021-05-01T12:00:00Z"
}