POST
/
v1
/
images
/
{image_id}
/
extract-formatted-text
curl --request POST \
  --url https://api.img-processing.com/v1/images/{image_id}/extract-formatted-text \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "format": "markdown"
}'
{
  "format": "markdown",
  "content": "# Example Title\n\nThis is an example of **formatted text** extracted from an image. It can include *italic*, **bold**, and other markdown features."
}

Description

This endpoint extracts the text from an image and returns its content in the format specified in the request.

The format can be either plain or markdown. The API will return all the text from the image, trying to maintain the document structure as much as possible.

This is particularly useful for documents, receipts, and other text-heavy images where you want to retain the formatting.

This endpoint is not available in test mode, since test watermarks prevent accurate text extraction. If you want to test the capabilities of this endpoint, please switch to live mode to use this feature, or contact support to temporarily upgrade your account.


Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

image_id
string
required

The unique identifier of the image. This identifier is used to reference the image in subsequent requests.

Body

application/json

Response

201
application/json

The API will return the Image object in the response body.

Response object for extracting formatted text from an image. Contains the format and content of the extracted text.