Dictionary Word lookup API Reference
The Dictionary Word lookup API conforms to the design principles of the REST. It accepts both GET and POST HTTP Requests with parameters, and returns HTTP Responses in JSON format or multi-line text.
The Request can have an optional filter parameter to restrict the fields returned in the Response, so reducing the amount of processing required by the client application and extracting only the information that is necessary.
A format Request parameter controls the formatting of the response.
With the help of the limit Request parameter, the number of words returned can be restricted. 12 is the default value.
Both HTTPS and plain text HTTP API requests are supported by us. HTTP request - response trip time can be a factor when speed is desired over encrypted connection with wordbelle.com servers.
curl https://wordbelle.com/api/suggest/sketch.
# or by HTTP
curl http://api.wordbelle.com/v1/suggest/sketch.
A GET Request can include the word pattern value to be looked up at the end of the path.
Currently, the API Client is not required to get and send an API Key.
API Request with word pattern Parameter
The query pattern (or regular expression) parameter indicates what dictionary words the API Client wants to lookup. The parameter is optional, as the word value can be added to the Request url as the last token on the path.
Regular expressions that are supported can be found on the Elastic Search website: Elastic Docs - Apache Lucene's regular expression
The lookup word pattern (or regular expression) value can be passed as a parameter in a GET or POST Request, or added to the URL.
# a POST Request
curl https://wordbelle.com/api/suggest/ \
-H 'Connection: keep-alive' \
-d query=sketch.
# a GET Request
curl "http://api.wordbelle.com/v1/suggest/?q=sketch."
{
"success": true,
"query": "sketch.",
"index_query": "sketch.",
"limit": 12,
"matching_words": 9,
"words": [
{
"word": "sketch",
"score": 5146
},
{
"word": "sketchy",
"score": 1095
},
{
"word": "sketchbook",
"score": 184
},
{
"word": "sketcher",
"score": 8
},
{
"word": "sketchily",
"score": 5
},
{
"word": "sketchiness",
"score": 5
},
{
"word": "sketch_block",
"score": 1
},
{
"word": "sketch_map",
"score": 1
},
{
"word": "sketch_pad",
"score": 1
}
]
}
API Request with filter Parameter
The filter parameter can be used to reduce the fields returned in the Response. For multiple fields the API Client should use a comma character separator, with no spaces around it.
You may use fields parameter in place of filter, it it easier to remember for you.
Please note that when only the word values are required, by using the filter=word parameter, the Response "words" field becomes an array of Strings instead of an array of word fields, that would include both the word and its score (the frequency with which the word is used in the top million list of words used on the internet).
# a POST Request
curl https://wordbelle.com/api/suggest/ \
-d word=sketch. \
-d filter=word
# a GET Request
curl "http://api.wordbelle.com/v1/suggest/?word=sketch.&filter=word"
{
"success": true,
"query": "sketch.",
"index_query": "sketch.",
"limit": 12,
"matching_words": 9,
"words": [
"sketch",
"sketchy",
"sketchbook",
"sketcher",
"sketchily",
"sketchiness",
"sketch_block",
"sketch_map",
"sketch_pad"
]
}
API Request with format Parameter jsonp
The format parameter indicates whether the API Client expects the Response in JSON, TAB Text, comma or multi-line text.
The default value for format is one line JSON. When the API Client expects to get the response for multi-line printing, including indentation, the parameter format value must be set as json-pretty, json-print, or shorter as jsonp.
# a POST Request
curl https://wordbelle.com/api/suggest/ \
-d query=sketch. \
-d format=jsonp
# a GET Request
curl "http://api.wordbelle.com/v1/suggest/?q=sketch.&format=jsonp"
{
"success": true,
"query": "sketch.",
"index_query": "sketch.",
"limit": 12,
"matching_words": 9,
"words": [
{
"word": "sketch",
"score": 5146
},
{
"word": "sketchy",
"score": 1095
},
...
]
}
API Request with format Parameter TAB
The format parameter value tab indicates the API Client expects the Response in TAB multi-line Text formatting.
Each line in the Response contains the field name, a TAB character separator, and the field value.
# a POST Request
curl https://wordbelle.com/api/suggest/ \
-d query=sketch. \
-d format=tab
# a GET Request
curl https://wordbelle.com/api/suggest/?q=sketch.&format=tab
sketch 5146 sketchy 1095 sketchbook 184 sketcher 8 sketchily 5 sketchiness 5 sketch_block 1 sketch_map 1 sketch_pad 1
API Request with comma format
The format parameter value comma indicates the API Client expects the Response in comma separated value formatting.
The single line in the Response contains only the field values separated by a comma character.
# a POST Request
curl https://wordbelle.com/api/suggest/ \
-d query=sketch. \
-d format=comma
# a GET Request
curl "http://api.wordbelle.com/v1/suggest/?q=sketch.&format=comma"
sketch,5146 sketchy,1095 sketchbook,184 sketcher,8 sketchily,5 sketchiness,5 sketch_block,1 sketch_map,1 sketch_pad,1
API Request with filter Parameter text
The format parameter value text indicates the API Client expects the Response in multi-line Text formatting.
This formatting is handy when the API Client expects just the word values.
# a POST Request
curl https://wordbelle.com/api/suggest/ \
-d query=sketch. \
-d format=text
# a GET Request
curl "http://api.wordbelle.com/v1/suggest/?q=sketch.&format=text"
sketch sketchy sketchbook sketcher sketchily sketchiness sketch_block sketch_map sketch_pad
API Request to extract word details from the WordNet Dictionary
The word parameter indicates what dictionary word the API Client wants to lookup. The parameter is optional, as the word value can be added to the Request url as the last token on the path.
Lookup word value can be passed as a parameter in a GET or POST Request, or added to the URL.
To limit the number of word variations returned, a level parameter can be used with a value greater than 1. The default value is 1, which returns all semantics associated with the lookup word.
When the requested word cannot be found in the dictionary, the Response will contain a field called "suggest". For example, word=sketck will return "suggest": "sketch".
# a POST Request
curl https://wordbelle.com/api/word/ \
-H 'Connection: keep-alive' \
-d word=sketch
-d level=2
# a GET Request
curl "http://api.wordbelle.com/v1/word/?word=sketch&level=2"
{
"success": true,
"word": "sketch",
"level": 2,
"matching_words": 5,
"words": [
{
"type": "n",
"type_name": "noun",
"word": "sketch",
"related": "study",
"similar": "drawing",
"antonym": "",
"description": "preliminary drawing for later elaboration",
"sentences": [
"\"he made several studies before starting to paint\""
],
"frequency": 5146
},
{
"type": "n",
"type_name": "noun",
"word": "sketch",
"related": "vignette",
"similar": "description",
"antonym": "",
"description": "a brief literary description",
"sentences": [],
"frequency": 5146
},
{
"type": "n",
"type_name": "noun",
"word": "sketch",
"related": "survey, resume",
"similar": "summary",
"antonym": "",
"description": "short descriptive summary (of events)",
"sentences": [],
"frequency": 5146
},
{
"type": "v",
"type_name": "verb",
"word": "sketch",
"related": "chalk_out",
"similar": "draw",
"antonym": "",
"description": "make a sketch of",
"sentences": [
"\"sketch the building\""
],
"frequency": 5146
},
{
"type": "v",
"type_name": "verb",
"word": "sketch",
"related": "outline, adumbrate",
"similar": "describe",
"antonym": "",
"description": "describe roughly or briefly or give the main points or summary of",
"sentences": [
"\"sketch the outline of the book\"",
"\"outline his ideas\""
],
"frequency": 5146
}
]
}