Generic Photo Tagging

The Photo Tagging API automatically analyzes photos and assigns descriptive tags. It recognizes both objects and scenes, making it ideal for stock photos, media libraries, or large image collections.

This service has one endpoint:

https://api.ximilar.com/photo/tags/v2/tags

POST/v2/tags

Tagging Endpoint

Quickstart

Given a list of image records, this method returns tags for each image with their confidence scores (probabilities).

Required attributes

  • Name
    records
    Type
    dict
    Max
    Maximum:10
    Description

    A batch of JSON records (max 10). Each record represents a single image, defined by _url or _base64.

Optional attributes

  • Name
    lang
    Type
    string
    Default
    Default:en
    Description

    Language settings for tags, currently: en or cs.

  • Name
    tagging_mode
    Type
    string
    Default
    Default:complex
    Description

    Two modes of the tagging process and of returned data:

    • complex – standard tagging mode, relevance values (probabilities) are returned
    • simple – simple mode, some tags might be omitted, no probabilities returned The billing for both modes is the same.

Returns

HTTP error code 2XX, if the method was OK, and other HTTP error code, if the method failed. The response body is a JSON object (map) with the following fields:

  • Name
    records
    Type
    dict
    Description

    JSON array with the input records, each record enriched by field _tags containing detected tags with probabilities.

  • Name
    status
    Type
    dict
    Description

    A JSON map/dictionary with a status of the method processing. It contains these subfields: code (numeric code of the operation status; it follows the concept of HTTP status codes) and text (text describing the status code).

  • Name
    statistics
    Type
    dict
    Description

    A map of various statistics about the processing, including processing time in seconds.

Request

POST
/v2/tags
curl https://api.ximilar.com/photo/tags/v2/tags -H "Content-Type: application/json" -H "Authorization: Token __API_TOKEN__" -d '{
  "lang": "en",
  "tagging_mode": "complex",
  "records": [
    {
      "_url": "__PATH_TO_IMAGE_URL__"
    }
  ]
}'

Response

{
  "lang": "en",
  "tagging_mode": "complex",
  "status": {
    "text": "OK",
    "code": 200
  },
  "records": [
    {
      "_url": "http://example.com/myimage321.png",
      "_tags": [
        {
          "prob": 0.8912695050239563,
          "name": "indoor"
        },
        {
          "prob": 0.8378337025642395,
          "name": "room"
        }
      ],
      "_height": 500,
      "_width": 500
    }
  ],
  "statistics": {
    "processing time": 0.2893240451812744
  }
}

Was this page helpful?