Skip to main content
Currently, Wesog Tag exposes an HTTP endpoint that accepts requests to tag a specific image, which must be included as a field in the request.

Parameters

In the following table, you’ll find the various parameters that can be sent to the Wesog Tag service not only to generate a list of keywords describing a specific image, but also to enable caption generation, OCR processing, or color extraction. Most parameters are optional—except for the image itself—but we recommend including the additional parameters, as they provide extra context to the system and help produce more relevant keywords, more accurate captions, better text extraction, and richer color data.
ParameterTypeRequiredDescription
imageFileYesThe image file to be tagged
langStringNoLanguage for tags (default: “en”)
modeStringNoTagging mode: “editorial” or “standard”
dateStringNoDate when the image was taken
eventStringNoEvent name or description
cityStringNoCity where the image was taken
countryStringNoCountry where the image was taken
captionBooleanNoGenerate caption (default: false)
keywordsBooleanNoGenerate keywords (default: false)
ocrBooleanNoExtract text from image (default: false)
colorsBooleanNoExtract dominant colors (default: false)

Request Example

In the following example, a request to the endpoint for keyword generation is shown. In this case, it assumes that the image referenced in the curl command is available so that the system can process it correctly:
    curl --request POST \
    --url https://api.wesog.com/tag/image \
    --header 'API-Key: <api-key>' \
    --header 'Content-Type: multipart/form-data' \
    --form lang=en \
    --form mode=editorial \
    --form date= \
    --form event= \
    --form city= \
    --form country= \
    --form caption=false \
    --form keywords=true \
    --form ocr=false \
    --form colors=false \
    --form image=@example-file

Responses

Image was tagged (Response Code: 200)

After a brief period during which the server processes the request, a response is returned in the following form:
{
  "keywords": ["politics", "elections", "voting", "democracy", "campaign"],
  "processing_time": "1.2s",
  "language": "en",
  "mode": "editorial"
}

Input Data not following defined format (Response Code: 422)

If required fields are missing or malformed, the API responds with:
{
  "detail": [
    {
      "loc": ["<field_name>"],
      "msg": "<error_message>",
      "type": "<error_type>"
    }
  ]
}