Getting started with Wordnik’s word & worldlist API

Getting started with Wordnik's Word & Worldlist API
Published: by
Last updated:

In today’s world where language is somewhat neglected modern ‘word-related’ services are a welcome edition to the struggle against illiteracy. One such service provider, Wordnik, offers unique word and other English language related services.

Introducing Wordnik

Wordnik bills itself as “a place for all the words, and everything known about them.” They allow users to look up definitions, add new words to their online database and provide example sentences pulled from the internet. Unlike many online dictionaries, Wordnik’s content can be accessed through their API.

From their website:

“Wordnik has amassed an incredible amount of data… one of our core principles is that you shouldn’t have to come to any particular web site to learn about words: the word data should come to you wherever you are.”

Wordnik’s API

Wordnik’s RESTful API allows developers to look up definitions, display the use of words in example sentences and return data about how frequently the word appears in Wordnik’s corpus. The Wordnik API also gives developers access to an auto complete function, and both a ‘random word’ and a ‘word of the day’ listing. Data for each function is accessed by GET request, and data can be returned in either XML or JSON format.

For Python

For the official Python library see Github and follow the instructions there. Other code libraries can be obtained here.

Pip needs to be installed:

sudo apt-get install python-pip
sudo pip install --upgrade pip --index-url=

After installation, sign up for a Wordnik account and and get an API key.

Wordnik API Python sample script

Create a new Python script in a desired location. For the Word Of The Day script I will use /home/pi/wotd/ for explanation purposes. In a freshly booted Raspberry Pi terminal use:

mkdir /home/pi/wotd
nano /home/pi/wotd/

and copy the following code into it:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from wordnik import *
apiUrl = ''
apiKey = 'your-api-key-here'
client = swagger.ApiClient(apiKey, apiUrl)

wordsApi = WordsApi.WordsApi(client)
wotd = wordsApi.getWordOfTheDay()

print wotd.word
print wotd.definitions[0].text
print wotd.note
print wotd.examples[0].text

Change the API details to the one from your own account, exit and save (Ctrl + X & Y).

To run the script use:

python /home/pi/wotd/

You can see more Words functions on the official Python development page (

About the author
Renier busies himself with improving his English writing, creative web design and his websites, photoshopping, micro-electronics, multiple genres of music, superhero movies and badass series.
Behind the Scenes is a free, informative website. If you find value in any of our content, please consider making a donation to our cause, or becoming a Patron for exclusive content.
Donate via PayPal Become a Patron

Save, share & discuss

Your comment is important, but don't be a knob. Keep it constructive and polite.

Leave a Reply

Your email address will not be published. Required fields are marked *

More coding related posts