Python 3 Oxford Dictionary API Example to Find Meaning of Given Word in Command Line

Python 3 Oxford Dictionary API Example to Find Meaning of Given Word in Command Line

Python 3 Oxford Dictionary API Example to Find Meaning of Given Word in Command Line

import  requests
import json
# TODO: replace with your own app_id and app_key
app_id = '<my app_id>'
app_key = '<my app_key>'
language = 'en-gb'
word_id = 'Ace'
url = 'https://od-api.oxforddictionaries.com/api/v2/entries/'  + language + '/'  + word_id.lower()
r = requests.get(url, headers = {'app_id' : app_id, 'app_key' : app_key})
print("code {}n".format(r.status_code))
print("text n" + r.text)
print("json n" + json.dumps(r.json()))
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment