Skip to content

Instantly share code, notes, and snippets.

@nikhilkumarsingh
Created June 23, 2017 08:27
Show Gist options
  • Save nikhilkumarsingh/ed3dce2b000c57d987ea3aa6baf85f88 to your computer and use it in GitHub Desktop.
Save nikhilkumarsingh/ed3dce2b000c57d987ea3aa6baf85f88 to your computer and use it in GitHub Desktop.
import requests
API_ENDPOINT = "https://www.wikidata.org/w/api.php"
query = "covfefe"
params = {
'action': 'wbsearchentities',
'format': 'json',
'language': 'en',
'search': query
}
r = requests.get(API_ENDPOINT, params = params)
print(r.json()['search'][0]['description'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment