This Alcohol Label Recognition API accurately identifies alcohol labels using advanced intelligent technologies.
API4AI creates APIs built on a fully cloud-based technology stack, ensuring complete operability, scalability, and stable uptime. Our goal is to create out-of-the-box, self-contained AI solutions that can be easily integrated into any application with just a few simple steps.
Vodka |
Brandy |
Beer |
Tekila |
Bourbon |
10 drinks |
Rum |
|
Wine |
Liqueur |
Whiskey |
Cognac |
METHOD | URL | DESCRIPTION |
---|---|---|
GET | https://alcohol-label-recognition.p.rapidapi.com/v1/version |
Get a service version. |
POST | https://alcohol-label-recognition.p.rapidapi.com/v1/results |
Perform image analysis and get results. |
Retrieve the current version of the service, formatted as vX.Y.Z
, where X indicates the API version.
PROPERTY | DESCRIPTION |
---|---|
Endpoint | https://alcohol-label-recognition.p.rapidapi.com/v1/version |
Method | GET |
Query parameters | โ |
POST parameters | โ |
Example
curl -X 'GET' 'https://alcohol-label-recognition.p.rapidapi.com/v1/version' \
-H 'X-RapidAPI-Key: ...'
v1.3.0
Initiate an image analysis and receive the results.
PROPERTY | DESCRIPTION |
---|---|
Endpoint | https://alcohol-label-recognition.p.rapidapi.com/v1/results |
Method | POST |
POST parameters | image , url |
Passing image
Image can be passed by posting regular โmultipart/form-dataโ in two alternative ways:
image
fieldurl
fieldImage must be a regular JPEG or PNG image (with or without transparency).
Usually such images have extensions: .jpg
, .jpeg
, .png
.
The service accepts the following MIME types:
image/jpeg
image/png
The size of the image file must be less than 16Mb
.
The maximum allowed resolution is 4096x4096
.
Response schema
For responses with 200
HTTP code the type of response is JSON object with the following schema:
{
"results": [
{
"status": {
"code": ...,
"message": ...
},
"name": ...,
"md5": ...,
"page": ...,
"width": ...,
"height": ...,
"entities": [
{
"kind": "array",
"name": "alcohol-labels",
"array": {
...
}
}
]
}
]
}
Primary fields:
Name | Type | Description |
---|---|---|
results[].status.code |
string |
Status code of image processing: ok or failure . |
results[].status.message |
string |
Human readable explanation for status of image processing. |
results[].name |
string |
Original image name passed in request (e.g. bottle.jpg ). |
results[].md5 |
string |
MD5 sum of original image passed in request. |
results[].page |
int |
Optinal page number (presented for multipage inputs only). |
results[].width |
int |
Optinal image width (presented for valid inputs only). |
results[].height |
int |
Optinal image height (presented for valid inputs only). |
results[].entities[].array |
array |
Recognized labels. |
results[].entities[].array
โ array of objects which encodes recognized labels.drink
which defines the kind of the drink. Possible values:
wine
label will contain the following properties (besides drink
):
beer
label will contain the following properties (besides drink
, again):
N/A
โ is special value for properties which is used in cases when the API can not identify proper value.curl -X 'POST' 'https://alcohol-label-recognition.p.rapidapi.com/v1/results' \
-H 'X-RapidAPI-Key: ...' \
-F 'image=@bottle.jpg'
{
"results": [
{
"status": {
"code": "ok",
"message": "Success"
},
"name": "bottle.jpg",
"md5": "a447c0aa2b2b89aa6ffb488317c0ab1e",
"entities": [
{
"kind": "array",
"name": "alcohol-labels",
"array": [
{
"drink": "wine",
"winery": "Tierra de Almas",
"country": "Spain",
"variety": "Tempranillo",
"vintage": "2020",
"region": "Rioja"
},
{
"drink": "beer",
"brewery": "Lรถwenbrรคu",
"country": "Germany",
"abv": "0.0",
"type": "Wheat Beer"
}
]
}
]
}
]
}
When a client sends an image that can not be processed for some reason(s), the service responds with 200
code and returns a JSON object in the same format as the format for successful analysis. In this case, the results[].status.code
will have failure
value and results[].status.message
will contain relevant explanation.
Example of possible reasons for the issue:
Example response for image with unsupported MIME type:
{
"results": [
{
"status": {
"code": "failure",
"message": "Can not load image."
},
"name": "file.txt",
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"entities": []
}
]
}
Request size is limited by approximately 32Mb
.
When a client sends a request that exceeds this limit, the service responds with 413
code.
The typical reason for exceeding this limit is an overly large image.
Taking into account additional HTTP overhead, we strongly recommend not passing image files of size more than 16Mb
.
Example response for overly big image:
Error: Request Entity Too Large
Your client issued a request that was too large.
When a client sends a request without an image, the service responds with 422
code and returns a JSON object.
Example response for request with missing image:
{"detail":"Missing image or url field."}
No. Alcohol Label Recognition API supports many kinds of drinks (including wine, of course):
It depends on the drink:
This is not a problem! The API will recognize all labels and return information about all of them.
Post a file content as a โmultipart/form-dataโ field named image
.
curl -X 'POST' 'https://alcohol-label-recognition.p.rapidapi.com/v1/results' \
-H 'X-RapidAPI-Key: ...' \
-F 'image=@bottle.jpg'
Post a URL to file as a โmultipart/form-dataโ field named url
.
curl -X 'POST' 'https://alcohol-label-recognition.p.rapidapi.com/v1/results' \
-H 'X-RapidAPI-Key: ...' \
-F 'url=https://storage.googleapis.com/api4ai-static/samples/alco-rec-1.jpg'
Code examples in Python, C#, JavaScript, Swift and other popular programming languages: https://gitlab.com/api4ai/examples/alco-rec
Feel free to contact API4AI team if you have any questions.