API Routes

WordDirectory provides a simple REST API for accessing word definitions and audio pronunciations. All endpoints are rate-limited and return JSON responses (except audio).

Base URL

All API routes are served from: https://worddirectory.app/api

Rate Limiting

All endpoints are rate-limited based on IP address. If you exceed the limit, you'll receive a 429 response with a Retry-After header. Audio endpoints have stricter rate limits.

Endpoints

Get Word Definition

GET /words/{word}

Get the definition and details for a specific word.

Query Parameters:

  • fallback - URL to redirect to if word isn't found
  • next - URL to redirect to if word is found

Response Codes:

  • 200 - Word found
  • 404 - Word not found
  • 429 - Rate limit exceeded
  • 500 - Server error

Get Word Audio

GET /words/{word}/audio

Get the audio pronunciation of a word using ElevenLabs AI.

Response:

  • Returns audio/mpeg data
  • Cached for 1 year

Response Codes:

  • 200 - Audio generated successfully
  • 404 - Word not found
  • 429 - Rate limit exceeded
  • 500 - Server error

Search Words

GET /words/search

Search for words in the dictionary.

Query Parameters:

  • q - Search query
  • limit - Maximum results (default: 50, max: 100)
  • offset - Pagination offset (default: 0)

Random Words

GET /words/random

Get a list of random words from the dictionary.

Query Parameters:

  • limit - Number of words (default: 50, max: 100)

Results are cached for 1 year for performance.

Need help?

If you need help or have questions about the API, please get in touch.