Error trying to use translation in Python V2.

dmoura329dmoura329 Member
edited October 2 in Review my code

I'm doing a monograph on this great API, but I can't use version 2 for "Python" translations.
Note: I am new to the art of programming.

The system displays error 403

I've read it many times and couldn't understand what I did wrong.
Could someone guide me?

************* My code*********Could someone help me please?
import requests
import json

app_id = 'xxxxxxx'
app_key = 'xxxxxxxxxx'
api_base_urll = 'https://od-api.oxforddictionaries.com/api/v2/translations/'

word_id = 'ace'
source_lang_translate = 'en'
target_lang_translate = 'pt'
strictMatch = 'false'

url = 'https://od-api.oxforddictionaries.com/api/v2/translations/' + source_lang_translate + '/' + target_lang_translate + '/' + word_id + '?strictMatch=' + strictMatch

r = requests.get(url, headers={'accept': 'application/json', 'app_id': app_id, 'app_key': app_key})

data = r.json()

Comments

  • TaisFukushimaTaisFukushima Member, Administrator, Moderator admin
    edited October 24

    Hello @dmoura329

    I have forwarded this issue to my colleagues from the technical team. They tried to do the same request and it is working fine for them.

    The translation endpoint is only available for the Developer plan. If you hold a Prototype plan, you won't be able to retrieve translations since this plan only allows requests to Entries and Lemmas endpoints.

    We hope this helps. Please let us know if you are on a Developer plan and still facing this issue.

Sign In or Register to comment.