Alcohol Label Recognition

FREEMIUM
By API 4 AI | Updated 24 days ago | Visual Recognition
Popularity

8.7 / 10

Latency

890ms

Service Level

100%

Health Check

100%

README

โญ๏ธ Alcohol Label Recognition

Examples API4AI Telegram

Alcohol label recognition

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.


๐Ÿ‘‰ Features

Vodka

Brandy

Beer

Tekila

Bourbon

10 drinks

Rum

Wine

Liqueur

Whiskey

Cognac


  • โœ… Supports 10 different types of alcoholic drinks.
  • โœ… Enables recognition of multiple labels within a single image.
  • โœ… Provides additional information about the drink.
  • โœ… Returns comprehensive JSON outputs.
  • โœ… Offers two alternative methods for submitting images: as a binary file or via a URL to a public resource.

๐Ÿ‘‰ Demos


๐Ÿ‘‰ Contacts




๐Ÿ›  Endpoints

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.

๐Ÿ‘‰ Get version

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: ...'
Click here to view the response
v1.3.0



๐Ÿ‘‰ Analyze image and return results

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:

  • as binary file in image field
  • as URL to some public resource in url field

Image 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.
  • The most important part of an output is results[].entities[].array โ€“ array of objects which encodes recognized labels.
  • Each label always has propery drink which defines the kind of the drink. Possible values:
    • beer
    • wine
    • vodka
    • whiskey
    • bourbon
    • brandy
    • cognac
    • rum
    • tekila
    • liqueur
  • The other properties of a label object depends on kind of the drink.
    • For example a wine label will contain the following properties (besides drink):
      • country
      • variety
      • vintage
      • region
    • While a beer label will contain the following properties (besides drink, again):
      • brewery
      • country
      • abv
      • type
  • N/A โ€“ is special value for properties which is used in cases when the API can not identify proper value.




๐Ÿ“Œ Examples


๐Ÿ‘‰ Recognize the whole text as single block

curl -X 'POST' 'https://alcohol-label-recognition.p.rapidapi.com/v1/results' \
     -H 'X-RapidAPI-Key: ...' \
     -F 'image=@bottle.jpg'
Click here to view the response
{
  "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"
            }
          ]
        }
      ]
    }
  ]
}




โ—๏ธ Possible errors


๐Ÿ‘‰ The service can not process an image

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:

  • Unsupported MIME type
  • Image resolution exceeds limits
  • Corrupted image

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 too big

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.

๐Ÿ‘‰ Missing image

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."}




โ“ F.A.Q.


๐Ÿ‘‰ Is this yet another wine recognition API?

No. Alcohol Label Recognition API supports many kinds of drinks (including wine, of course):

  • beer
  • wine
  • vodka
  • whiskey
  • bourbon
  • brandy
  • cognac
  • rum
  • tekila
  • liqueur

๐Ÿ‘‰ Which properties does it support for a label?

It depends on the drink:

  • beer: brewery, country, abv, type
  • wine: winery, country, variety, vintage, region
  • vodka: brand, country
  • whiskey: brand, country, malt, (e.g. single, double, blended)
  • bourbon: brand, country
  • brandy: brand, country, aging (e.g. VS, VSOP, XO))
  • cognac: brand, country, aging (e.g. VS, VSOP, XO))
  • rum: brand, country, color
  • tekila: brand, country, abv, color
  • liqueur: brand, country, abv, color, base

๐Ÿ‘‰ What will happen if the image contains multiple drinks of different kinds?

This is not a problem! The API will recognize all labels and return information about all of them.


๐Ÿ‘‰ How to pass an image as binary file?

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'

๐Ÿ‘‰ How to pass an image as URL?

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'

๐Ÿ‘‰ Where to find code examples?

Code examples in Python, C#, JavaScript, Swift and other popular programming languages: https://gitlab.com/api4ai/examples/alco-rec


๐Ÿ‘‰ Where to try live demo?


๐Ÿ‘‰ I need support

Feel free to contact API4AI team if you have any questions.

Followers: 0
Resources:
Product Website
API Creator:
Rapid account: API 4 AI
API 4 AI
api4ai
Log In to Rate API
Rating: 5 - Votes: 1