Compartir a través de


Image Moderation - Match Url Input

Fuzzily match an image against one of your custom image lists. You can create and manage your custom image lists by using this API.

Returns the ID and tags of a matching image.

Note: You must refresh the index on the corresponding image list to ensure that additions and removals are reflected in the response.

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/Match
POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/Match?overload=url&listId={listId}&CacheImage={CacheImage}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Azure Cognitive Services endpoints (protocol and host name, such as https://westus.api.cognitive.microsoft.com).

CacheImage
query

boolean

Whether to retain the submitted image for future use. If it's omitted, the default is false.

listId
query

string

List ID.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Content-Type True

string

Content type.

Request Body

Name Type Description
DataRepresentation

string

Value

string

Responses

Name Type Description
200 OK

MatchResponse

Supported values for tags are:

  • 101: Nudity
  • 102: Sexual Content
  • 201: Alcohol
  • 202: Tobacco
  • 203: Drugs
  • 301: Child Exploitation
  • 401: Violence
  • 402: Weapons
  • 403: Gore
  • 501: Profanity
  • 502: Vulgarity
.
Other Status Codes

APIError

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Match Image request

Sample request

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/Match?overload=url&listId=12345



{
  "DataRepresentation": "URL",
  "Value": "https://moderatorsampleimages.blob.core.windows.net/samples/sample.jpg"
}

Sample response

{
  "IsMatch": true,
  "Matches": [
    {
      "Score": 1,
      "MatchId": 89203,
      "Source": "89117",
      "Tags": [],
      "Label": "ImageA"
    },
    {
      "Score": 1,
      "MatchId": 92708,
      "Source": "89083",
      "Tags": [],
      "Label": "ImageB"
    }
  ],
  "Status": {
    "Code": 3000,
    "Description": "OK",
    "Exception": ""
  },
  "TrackingId": "WE_7be19175b8274274baea9219e6b6b1b0_ContentModerator.Preview_44b1f691-35ee-4d49-a981-0d01d07f18d6",
  "CacheID": "c660dfa6-eba9-4950-aa58-a6967de57ea8_636422189473647994"
}

Definitions

Name Description
APIError

Error information that the API returns.

Error

Error body.

Match

Match details.

MatchResponse

Response for a match request.

Status

Status properties.

APIError

Error information that the API returns.

Name Type Description
Error

Error

Error body.

Error

Error body.

Name Type Description
Code

string

Message

string

Match

Match details.

Name Type Description
Label

string

Label.

MatchId

integer

Match ID.

Score

number

Confidence score of the image match.

Source

string

Source.

Tags

integer[]

Tags for match details.

MatchResponse

Response for a match request.

Name Type Description
CacheID

string

Cache ID.

IsMatch

boolean

Indicates if there is a match.

Matches

Match[]

Match details.

Status

Status

Evaluation status.

TrackingId

string

Tracking ID.

Status

Status properties.

Name Type Description
Code

integer

Status code.

Description

string

Status description.

Exception

string

Exception status.