This is a neat random word generator that I created to output random dictionary words from the English language.
I have written the code in a way that will let users output random words in any language they want as long as the database has those words.
Currently, the API only supports English. However, I am planning to add more words from other languages to the database.
You can clone the repository to set up your own random word generator or you can simply use the one I have created at https://hellonitish.com/random-words/
You can get a random word by making a GET request to get.php
.
In my case, the JSON response was:
{
"words": [
"distrait"
]
}
An application or project that you are working on might require you to get multiple words at once. Use the count
parameter in such cases.
get.php?count=10
I got these 10 words back:
{
"words": [
"nodosous",
"pennaceous",
"biolytic",
"undwellable",
"achromaticity",
"ziega",
"lisping",
"comparation",
"epicondyle",
"reerect"
]
}
At the moment, you can request words from 7 different categories — adjective, adverb, noun, verb, conjunction, preposition, fruit.
get.php?category=verb
Here is the response I got:
{
"words": [
"chant"
]
}
Provide a length
value if you want the words to have a specific number of characters. This
get.php?length=18
The length
parameter tales precedence over min-length
and max-length
.
Here is the response I got:
{
"words": [
"incommensurability"
]
}
If you are looking for words with at least a minimum number of characters, use the min-length
parameter.
count=10&min-length=15
Here is the response I got:
{
"words": [
"hyperoxymuriate",
"intermetacarpal",
"supersemination",
"devitrification",
"anthropomorphitism",
"concupiscential",
"superexcrescence",
"hydrometrograph",
"churchwardenship",
"contraremonstrant"
]
}
If you are looking for words with at least a minimum number of characters, use the min-length
parameter.
count=10&max-length=5
Here is the response I got:
{
"words": [
"gnaw",
"trade",
"dink",
"ling",
"acton",
"roial",
"wipe",
"dowl",
"begod",
"shrag"
]
}
You should use the start
parameter to get words that start with a specific sequence of letters.
get.php?start=app
Here is the response I got:
{
"words": [
"appeasable"
]
}
You should use the end
parameter to get words that start with a specific sequence of letters.
get.php?end=ate
Here is the response I got:
{
"words": [
"particulate"
]
}
If you just want a character sequence to be anywhere in the word, consider using the include
parameter.
include=der&count=10
Here is the response I got:
{
"words": [
"underclothes",
"raider",
"innholder",
"rudderless",
"epidermoid",
"interpleader",
"derainment",
"undersoil",
"derival",
"squanderingly"
]
}
You can also provide a comma separated list of characters and sequences if you want all of them to be present in the word.
include=der,t&count=5
Here is the response I got:
{
"words": [
"dittander",
"derivation",
"stenodermine",
"thereunder",
"underplot"
]
}
You might occasionally want to get a response that excludes words with specific characters or sequences. use the exclude
parameter to do so.
exclude=a,e,i&count=5
Here is the response I got:
{
"words": [
"outcrop",
"dorp",
"fluff",
"oxford",
"thoroughly"
]
}
I created this database from the Online Plain Text English Dictionary which is in public domain. The dictionary itself is based on the 1913 US Webster's Unabridged Dictionary.
- Some of the words in use at that time might no longer be in use today.
- Words recently added to English language will not be in the database.
- Use of words evolve. This means that some words which were used as a verb as well as noun in the past might be used only as a verb today etc.