Internet is very Powerful ! Lots of online API’s, Tools and Programs are available that will make your life easy. Today in this post I’ll discuss with you how to get Synonyms of a word using an Online Thesaurus API and Powershell.

What is a Synonym ?

A Synonym is a word or phrase that means exactly or nearly the same as another word or phrase in the same language

What is Thesaurus ?

A book that lists words in groups of Synonyms and related concepts.

HOW IT WORKS :

A word is passed in a HTTP request as a URL to an online Thesarus API in order to receive an XML based response. (Using Invoke-WebRequest cmdlet) Do some Data mining from the XML reponse Plus, some magic 😉 ( Go to my Script to see the magic ) You get Synonyms of the word which was queried, like in the below screenshot.

GET THE SCRIPT : Click here to go to my GitHub gist to get the code.

HOW TO USE IT :

Feed the Script the word(s) you want to query and the script will return you the Synonyms of those words

You can Also Filter the Synonyms using the Part of Speech

Or, you can Check Available Part of Speech’s in the Thesaurus.

And in case you feed in a word that is not available in Thesaurus you will get a 404 Not Found Error like in the below screenshot.

Hope you guys find this post useful, Stay tuned for more fun !

Thank you for Stopping by 🙂