The Thesaurus service provides a simple RESTful API to get synonyms of a given word in the context of a specific language. An application can retrieve the synonyms by using a HTTP GET. The service script can return results either using xml or json format.

Request url:

Query Parameters

The following parameters are supported by the thesaurus Web service:

key*String that uniquely identifies your application. The key is assigned by subscribing here
word*(urlencoded string)
language*cs_CZ, da_DK, de_CH, de_DE, en_US, el_GR, es_ES, fr_FR, hu_HU, it_IT, no_NO, pl_PL, pt_PT, ro_RO, ru_RU, sk_SK
outputxmlxml or json
callbackjavascript callback function (requires output=json)
*: mandatory parameter

Query parameters are preceded by a question mark ("?") and separated by ampersands ("&") and consist of the parameter name, an equals sign ("="), and a value.

Response content

The thesaurus Web service returns a sequence of elements list. Each list element contains a pair of elements: category and synonyms. The element synonyms contains a list of synonyms separated by the character |.
The detailed schema can be downloaded synonymResponse.xsd.

The query word=peace and language=en_US will return the following result:

xml output (test now: en_US, it_IT, fr_FR, es_ES)

<list><category>(noun)</category><synonyms>order|war (antonym)</synonyms></list>
<list><category>(noun)</category><synonyms>public security|security</synonyms></list>
<list><category>(noun)</category><synonyms>peace treaty|pacification|treaty|pact|accord</synonyms></list>

json output (test me!)

{"response":[{"list":{"category":"(noun)","synonyms":"order|war (antonym)"}},
{"list":{"category":"(noun)","synonyms":"public security|security"}},
{"list":{"category":"(noun)","synonyms":"peace treaty|pacification|treaty|pact|accord"}}]}

Error codes

The following error codes may be returned by the thesaurus Web service:

error codedescription
400 Bad RequestWrong/Missing parameter
403 ForbiddenYou do not have permission to access this resource, or are over your rate limit
404 Not FoundNo match found for given word
405 Method Not AllowedMethods PUT, DELETE, POST... are rejected. Only GET is allowed
Share Share on Facebook Share on Twitter Bookmark on Reddit Share via mail
Terms and conditions | Privacy policy