Cognitive service translation API error One of the specified language pair is not valid

Anand Tp 1 Reputation point

We are currently subscribed to cognitive service for translation purposes to be used in our App. Right now we are able to translate English words to different languages. But when it is translating from french to german it is showing an error with the message 'One of the specified language pair is not valid.'.
We couldn't find any solutions for this. It's an immediate requirement for our app.
await axios({
url: '/dictionary/lookup',
method: 'post',
headers: {
'Content-type': 'application/json',
'X-ClientTraceId': uuidv4().toString()
params: {
'api-version': '3.0',
'from': sourceLang,
'to': targetLang
data: [{
'text': word
}).then((result) => {
let translateData = {}
translateData["word"] = word
translateData["translations"] =[0].translations
}).catch((err) => {
return reject({ message: 'Internal Server Error' })

Endpoint is

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
355 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,518 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,366 Reputation points Microsoft Employee

    @Anand Tp Unfortunately, this isn't a valid language pair that is supported for dictionary lookup API. English is the only pair that is supported for French for this API. You can check the supported languages for translation, transliteration and dictionary using the languages API to get the complete list and then use the supported languages.

    "fr": {  
        "name": "French",  
        "nativeName": "Français",  
        "dir": "ltr",  
        "translations": [  
                "name": "English",  
                "nativeName": "English",  
                "dir": "ltr",  
                "code": "en"  

    A workaround for your scenario is to use the lookup API for FR-EN and then EN-DE.

    0 comments No comments