POST
/
v1
/
images
/
{imageId}
/
extract-formatted-text
POST /v1/images/<imageId>/extract-formatted-text HTTP/1.1
Host: https://api.img-processing.com
x-api-key: <api-key>
{
    "format": "plain",
    "content": "This is the first line of text.\nThis is the second line of text.\nThis is the third line of text."
}

Description

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

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.


Request Parameters

The request path should contain the following parameters:

imageId
string
required

The ID of the image to extract text from.

Request Body

The request body should contain a JSON object with the following fields:

format
string
default:"plain"

The desired format of the extracted text. The available formats are plain and markdown.

Response

The API will return a JSON object with the following fields:

format
string

The format of the extracted text.

content
string

The content of the image processed in the desired format.

POST /v1/images/<imageId>/extract-formatted-text HTTP/1.1
Host: https://api.img-processing.com
x-api-key: <api-key>
{
    "format": "plain",
    "content": "This is the first line of text.\nThis is the second line of text.\nThis is the third line of text."
}