WordReference API

Thesaurus JSON

Here is an example of the JSON output for a thesaurus entry, /thesaurus/house:

{
    "term0": {
        "term": "house",
        "senses": {
            "0": {
                "sensetext": "A habitation",
                "synonyms": {
                    "0": {
                        "synonym": "home",
                        "context": ""
                    },
                    "1": {
                        "synonym": "dwelling",
                        "context": ""
                    },
                    "2": {
                        "synonym": "residence",
                        "context": ""
                    }
                }
            },
            "1": {
                "sensetext": "A large business establishment",
                "synonyms": {
                    "0": {
                        "synonym": "organization",
                        "context": ""
                    },
                    "1": {
                        "synonym": "firm",
                        "context": ""
                    },
                    "2": {
                        "synonym": "company",
                        "context": ""
                    }
                }
            },
            "2": {
                "sensetext": "A family",
                "synonyms": {
                    "0": {
                        "synonym": "line",
                        "context": ""
                    },
                    "1": {
                        "synonym": "family",
                        "context": ""
                    }
                }
            },
            "3": {
                "sensetext": "A legislative body",
                "synonyms": {
                    "0": {
                        "synonym": "congress",
                        "context": ""
                    },
                    "1": {
                        "synonym": "parliament",
                        "context": ""
                    }
                }
            }
        }
    },
    "Lines": "End Reached",
    "END": true
}

Just like the other dictionaries, the API will return a series of zero or more objects of the type "term0" : {entry-block}, which will increment in the style "term1", "term2", etc, depending on how many distinct terms have been found in the thesaurus.

Inside each entry-block, a string and an object are returned. The string, term, is the term that was found in the thesaurus. The object, senses, contains a series of 0 or more objects, labeled 0 and incrementing, for each sense found for that particular term. For the term "house", four senses are found, so there are four objects under term0['senses'], labeled term0['senses'][0], term0['senses'][1], to [3].

Within each sense object, a string, sensetext, and an object, synonyms, are returned. The sensetext string is the name of the specific sense; in this example, the first sense is "A habitation", while the third sense is "A family". The synonyms object contains a series of 0 or more objects, labeled 0 and incrementing, that contain the synonyms for the given term.

The numbered objects inside the synonyms object contain a pair of strings, synonym and context. The synonym string is a synonym for the term. The context string gives some information about when or where the synonym is used. For example, in the entry for "abode", the synonym "studio flat" has the context string "UK" to indicate that this particular synonym is used in the UK.

If the context string for a particular synonym is blank, there is no context. Additionally, if the sensetext string is blank, that means there are no differentiated senses for that particular term. For example, the term "abode" has only one sense object, and it has no sensetext.

At the end of the response, the pairs, "Lines" : "Maximum Reached", "END": true, are returned to indicate the end of the response.

Return to the main API documentation page.

Questions? Comments? Suggestions? Send us a message.