Analyzing images

Usually, you'll want more control over the image being analyzed than our web screenshot functionality can provide. That's why you can also provide a PNG or JPEG image directly. More on the types of images we support under Image formats and limitations.

To upload an image file for analysis, change the input type to image and provide the contents of your image file as a Base64-encoded string as the input content.

๐Ÿ“˜

Base64-encoding images on the command-line

On Linux and Mac OS, you probably already have the command-line utility base64 available, which you can use to encode an image like this:

base64 -i /path/to/image.png > image.png.base64

Here's how you would analyze an image:

curl \
  -X POST \
  -H "Authorization: Bearer $apikey" \
  -H "Content-Type: application/json" \
  -d '{
        "input": {
          "type": "image",
          "content": "iVBORw0KGgoAAAANSUhE....FTkSuQmCC",
          "medium": "desktopWeb",
          "title": "Example"
        }
      }' \
  https://api.eyequant.com/v2/analyses

Following that, the steps are the same as when analyzing by url.