Can't get my code to work
Categories
- 326 All Categories
- 3 Language datasets
- 9 News and updates
- 18 API endpoints
- 15 Review my code
- 6 Tutorials and presentations
- 92 Frequently asked questions
- 5 How to get useful technical help
- 2 Member guidelines
- 12 Suggest an improvement
- 58 Report a bug
- 10 Ask the Community: Other
- 56 Ask the Community: Technical and operational questions
- 62 General
Can't get my code to work

I just discovered OxfordDictionaries but I cannot get my code to work. I have registered and got an appID and key. My code fails with The debugged program raised the exception unhandled KeyError "'results'".
What have I done wrong? Thanks
here is the code -
from oxforddictionaries.words import OxfordDictionaries
app_id =
app_key =
o = OxfordDictionaries(app_id, app_key)
relax = o.get_synonyms("absorb").json()
print('relax = ', relax)
synonyms = relax['results'][0]['lexicalEntries'][0]['entries'][0]['senses'][0]['synonyms']
for s in range(10):
print(synonyms[s]['text'])
Tagged:
Comments
Hello @micksulley
It seems that you are using a third-party library. We would like to inform you that we do not maintain it; therefore, we don't support it. It refers to the API's first version, hence is out of date.
We would recommend to use our API Documentation as reference, you will see our code examples there.
I hope it helps!