This is a simple REST-style API. There is only one method (so far). It can be called from server-side applications or from client-side javascript using JSONP.
Method: combinations
http://www.just-the-word.com/api/combinations
Returns the set of combinations of an input word.
Parameters
- word (Required) The query word or phrase
- callback (Optional) The default is to return a JSON encoded object. If you include a callback function, then a JSONP response will be made - ie JSON wrapped by the callback function.
- key (Optional) Your API key if you have one.
Example
http://www.just-the-word.com/api/combinations?word=pig
Response
Format: JSON or JSONP (see callback parameter)
The response contains a list for each different part of speech.
Each list contains sublists of the form (pattern, cluster num, phrase, frequency, strength)
{
"status":"ok",
"word":"pig",
"combinations":
[
{
"pos":"N",
"list":[ ["V obj N*",1,"kill pig","32",5],
["V obj N*",1,"slaughter pig","4",1],
["V obj N*",2,"eat pig","9",2],
["V obj N*",2,"feed to pig","7",2],
["V obj N*",3,"behave like pig","5",2],
["V obj N*",4,"breed pig","4",1],
["V obj N*",4,"buy pig","12",3],
["V obj N*",4,"keep pig","38",5],
["V obj N*",4,"see pig","17",1],
["V obj N*",4,"sell pig","6",1],
...
["article N*",1,"some pigs","10",1]]
},
{
"pos":"V",
"list":[["V* ADV",1,"pig out","11",3]]
}
]
}
Error
Errors are returned as follows:
{
"status":"error",
"errstr":"error information"
}