Skip to content

Instantly share code, notes, and snippets.

@imvladikon
Created March 19, 2020 22:58
Show Gist options
  • Save imvladikon/3bfb39f4f0c844581c3b457022482594 to your computer and use it in GitHub Desktop.
Save imvladikon/3bfb39f4f0c844581c3b457022482594 to your computer and use it in GitHub Desktop.
import pprint
import requests
import json
QUERY = 'meaning'
DICTIONARY_API = 'https://dictionary.yandex.net/api/v1/dicservice.json/lookup'
YNDX_TMP_KEY = 'dict.1.1.20171114T131015Z.59d0570f825aeb6d.aa00fdbd5ee643a6cb790c0963c0946115ceef55'
params = {'key' : YNDX_TMP_KEY, 'lang' : 'en-ru', 'text' : QUERY}
req =requests.get(DICTIONARY_API, params = params)
pprint.pprint(json.loads(req.text)['def'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment