Need to generate random words in your application? This guide covers everything you need to know about random word generation via API, including word types, filtering options, and implementation examples.
Word Types
The API provides access to a comprehensive dictionary with words categorized by part of speech, difficulty level, and topic. This makes it easy to get exactly the type of word you need for your application.
Words are sourced from standard English dictionaries and verified for accuracy.
Filtering Options
Filter words by various criteria:
Part of Speech
Filter by nouns, verbs, adjectives, adverbs, etc. Essential for word games that require specific types.
Word Length
Specify minimum and maximum character length. Useful for crosswords and other length-constrained uses.
Difficulty Level
Filter by easy, medium, or hard based on common usage frequency.
Starting Letter
Get words that start with a specific letter. Great for educational games.
Using the Random Word API
TinyFn provides a simple endpoint to generate random words:
GET https://api.tinyfn.io/v1/random/word?type=noun&min_length=5&max_length=8
Headers: X-API-Key: your-api-key
{
"word": "garden",
"type": "noun",
"length": 6,
"difficulty": "easy",
"definition": "A piece of ground used for growing flowers, vegetables, or fruit",
"syllables": 2
}
Parameters
| Parameter | Type | Description |
|---|---|---|
type |
string | Part of speech: noun, verb, adjective, adverb |
min_length |
integer | Minimum word length |
max_length |
integer | Maximum word length |
difficulty |
string | Difficulty: easy, medium, hard |
starts_with |
string | Starting letter(s) |
count |
integer | Number of words to return (default: 1) |
Code Examples
JavaScript / Node.js
const response = await fetch(
'https://api.tinyfn.io/v1/random/word?type=noun&min_length=5&max_length=8',
{ headers: { 'X-API-Key': 'your-api-key' } }
);
const { word, definition } = await response.json();
console.log(`Word: ${word}`); // Word: garden
Python
import requests
response = requests.get(
'https://api.tinyfn.io/v1/random/word',
params={'type': 'noun', 'min_length': 5, 'max_length': 8},
headers={'X-API-Key': 'your-api-key'}
)
data = response.json()
print(f"Word: {data['word']}, Definition: {data['definition']}")
cURL
curl "https://api.tinyfn.io/v1/random/word?type=noun&min_length=5&max_length=8" \
-H "X-API-Key: your-api-key"
Common Use Cases
- Word Games: Hangman, Wordle clones, word scrambles
- Educational Apps: Vocabulary builders, spelling practice
- Placeholder Text: Generate random words for mockups
- Creative Writing: Word prompts for writing exercises
- Password Phrases: Generate memorable passphrases
Best Practices
- Match difficulty: Use appropriate difficulty for your audience
- Include definitions: Helpful for educational contexts
- Validate length: Ensure words fit your UI constraints
- Filter appropriately: Use specific filters for game mechanics
Use via MCP
Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:
{
"mcpServers": {
"tinyfn-random": {
"url": "https://api.tinyfn.io/mcp/random/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
See all random tools available via MCP in our Random MCP Tools for AI Agents guide.
Try the Random Word API
Get your free API key and start generating words in seconds.
Get Free API Key