Thesaurus API
The Thesaurus API allows you to look up synonyms (similar words) and antonyms (opposite-meaning words) for any English word.
From 5,075 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 282ms | 301ms | 334ms | 667ms | 1106ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/thesaurus GET
https://api.api-ninjas.com/v1/thesaurus
Returns a list of synonyms and a list of antonyms for a given word.
Parameters
wordrequiredWord to look up.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
wordThe word that was looked up.
synonymsArray of synonym strings (words with similar meanings).
antonymsArray of antonym strings (words with opposite meanings).
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/thesaurus?word=elegantHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/thesaurus?word=happy" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Frequently Asked Questions
Can I use the Thesaurus API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Thesaurus API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Thesaurus API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Thesaurus API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.How do I look up synonyms and antonyms for a word with the Thesaurus API?
Send a GET request to the/v1/thesaurusendpoint with the requiredwordparameter set to the English word you want to look up, for exampleword=elegant. You will need an API key in theX-Api-Keyheader, which you can get by registering for a free account.What fields does the Thesaurus API response include?
Each response is a JSON object containing thewordthat was looked up, asynonymsarray of strings with similar meanings, and anantonymsarray of strings with opposite meanings. See the error codes page for the responses returned when a request is unsuccessful.What are some use cases for the Thesaurus API?
The Thesaurus API is useful for building writing assistants, word games, vocabulary-builder apps, and content tools that suggest alternative or opposite words on the fly. It pairs well with the Dictionary API for definitions, the Rhyme API for rhyming words, and the Random Word API for generating prompts.Does the Thesaurus API support non-English words?
No, thewordparameter is intended for English words only, returning Englishsynonymsandantonyms. If you need word data for other use cases, browse the full API catalog to find a better fit.