Text Moderation - Detect Language

This operation detects the language of input content. It returns the ISO 639-3 code for the predominant language in the submitted text. More than 110 languages are supported.

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessText/DetectLanguage

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).

Request Header

Media Types: "text/plain", "text/html", "text/xml", "text/markdown"

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

string

Content-Type True

string

Content type.

Request Body

Media Types: "text/plain", "text/html", "text/xml", "text/markdown"

Name Type Description
Text Content

object

Content to screen.

Responses

Name Type Description
200 OK

DetectedLanguage

Detected language result.

Other Status Codes

APIError

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Detect Language request

Sample request

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessText/DetectLanguage



"Is this a crap email abcdef@abcd.com, phone: 6657789887, IP: 255.255.255.255, 1 Microsoft Way, Redmond, WA 98052"

Sample response

{
  "DetectedLanguage": "eng",
  "Status": {
    "Code": 3000,
    "Description": "OK",
    "Exception": ""
  },
  "TrackingId": "2826a49-b976-419e-98e8-c5532c1n78c6"
}

Definitions

Name Description
APIError

Error information that the API returns.

DetectedLanguage

Detected language result.

Error

Error body.

Status

Status properties.

APIError

Error information that the API returns.

Name Type Description
Error

Error

Error body.

DetectedLanguage

Detected language result.

Name Type Description
DetectedLanguage

string

Detected language.

Status

Status

Detected language status.

TrackingId

string

Tracking ID.

Error

Error body.

Name Type Description
Code

string

Message

string

Status

Status properties.

Name Type Description
Code

integer

Status code.

Description

string

Status description.

Exception

string

Exception status.