Serverless AI Image Content Extraction

AI powered OCR service that extracts specific text content from images based on the provided content keys.

Endpoint

This API uses multipart/form-data format. You must send the image file and the contents as form fields.

POSThttps://api.xtartapp.com/image/content-extraction

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
imageFileYes-The image file to analyze. Must be provided as a file in multipart/form-data.
contentsstringYes20 itemsA JSON string containing an array of content keys and descriptions to extract from the image. Maximum 20 items. Format: '[{"key":"example_key","description":"description text"}]'
contents[].keystringYes25The key for the content to extract from the image.
contents[].descriptionstringYes150A description of the content to extract.

Response

NameTypeDescription
dataobjectAn object containing all extracted content with keys matching the input content keys
data.<key>stringThe extracted key for the specified content key
data.<value>stringThe extracted value about the extracted key
metadataobjectMetadata about the image analysis process
metadata.costnumberThe cost of the image extraction request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTThe request is invalid.
400IMAGE_CONTENT_EXTRACTION_ERRORCould not extract content from image | parsing error.
400INVALID_IMAGEThe image was not found or is invalid.
400HARM_CONTENTThe content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance.
401UNAUTHORIZEDThe token is invalid.
429TOO_MANY_REQUESTSThe request limit has been reached.