Thesaurus API

The Thesaurus API allows you to look up synonyms (similar words) and antonyms (opposite-meaning words) for any English word.

/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

  • word  required

    Word to look up.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

word
https://api.api-ninjas.com/v1/thesaurus?word=elegant

Sample Response

JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 { "word": "elegant", "synonyms": [ "graceful", "handsome", "fine", "luxurious", "majestic", "magnificent", "classy", "stylish", "simple", "tasteful", "glorious", "proud", "royal", "superb", "regal", "refined", "rich", "sophisticated", "aristocratic", "noble", "gallant", "courtly", "stately", "fashionable", "exquisite", "grand", "quiet", "lavish", "ornate", "sleek", "polished", "heroic", "splendid", "classic", "monumental", "heroical", "imposing", "artful", "chic", "conservative", "restrained", "understated", "baronial", "genteel", "posh", "swanky", "smart", "patrician", "august", "swank", "grandiose", "ostentatious", "pretentious", "modish", "in", "sharp", "snappy", "a la mode", "affected", "recherché", "swagger", "à la mode" ], "antonyms": [ "inelegant", "unfashionable", "tasteless", "unhandsome", "dowdy", "graceless", "loud", "grotesque", "flamboyant", "flashy", "gaudy", "unstylish", "crude", "coarse", "tawdry", "glitzy", "tacky", "garish", "cheesy", "raffish", "splashy", "styleless", "vulgar", "unpolished", "uncouth", "trashy", "unrefined", "rude", "uncultivated", "rough-hewn", "uncultured", "ticky-tacky", "ticky-tack", "rough-edged" ] }

Code Examples

1 2 3 4 5 6 7 8 9 import requests word = 'elegant' api_url = 'https://api.api-ninjas.com/v1/thesaurus?word={}'.format(word) response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'}) if response.status_code == requests.codes.ok: print(response.text) else: print("Error:", response.status_code, response.text)

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.