Words API
Description
Lookup a specific (or random) word
for definitions, synonyms or antonyms. This endpoint currently only supports english
but will be expanded soon to include more languages. The dataset also includes common multi-word phrases that are often treated as one word in normal speech.
Endpoint
> GET https://api.jsonrepo.com/v1/knowledge/language/words
Headers
Field | Description |
---|---|
api_key | Required Your API Key |
Parameters
Field | Type | Description |
---|---|---|
word | String | Optional The word to lookup |
Random Lookup:
This endpoint will return a random
word
if the optional search parameter is not provided.
Response
A successful request will result in a populated payload
field with the expected output.
A failed request will result in an error output as detailed in Error Rules. If the endpoint validation fails due to missing, badly formatted or invalid parameters, the endpoint will return HTTP code 400
along with a message
detailing the error.
See the examples section for more information.
Request 1: Random Word
- Curl
// Get a random `word`
curl \
https://api.jsonrepo.com/v1/knowledge/language/words \
-H "api_key: {YOUR_API_KEY_HERE}"
Success Response 1
{
"http_code": 200,
"http_message": "Ok",
"message": "Successful execution",
"payload": {
"word": {
"id": 16533,
"word": "chemise",
"language": "en",
"definitions": [
{
"pos": "n.",
"definition": "A shift, or undergarment, worn by women."
},
{
"pos": "n.",
"definition": "A wall that lines the face of a bank or earthwork."
}
],
"synonyms": [
"shimmy",
"shift",
"slip",
"teddy",
"sack"
],
"antonyms": [],
"db_entry_last_updated_at": "2024-07-26 05:20:40"
}
}
}
Request 2: Lookup
- Curl
// Look up `arise`
curl -G \
https://api.jsonrepo.com/v1/knowledge/language/words \
-H "api_key: {YOUR_API_KEY_HERE}" \
--data-urlencode "word=arise"
Success Response 2
{
"http_code": 200,
"http_message": "Ok",
"message": "Successful execution",
"payload": {
"word": {
"id": 6112,
"word": "arise",
"language": "en",
"definitions": [
{
"pos": "v. i.",
"definition": "To come up from a lower to a higher position; to come above the horizon; to come up from one's bed or place of repose; to mount; to ascend; to rise; as, to arise from a kneeling posture; a cloud arose; the sun ariseth; he arose early in the morning."
},
{
"pos": "v. i.",
"definition": "To spring up; to come into action, being, or notice; to become operative, sensible, or visible; to begin to act a part; to present itself; as, the waves of the sea arose; a persecution arose; the wrath of the king shall arise."
},
{
"pos": "v. i.",
"definition": "To proceed; to issue; to spring."
},
{
"pos": "n.",
"definition": "Rising."
}
],
"synonyms": [
"originate",
"rise",
"develop",
"uprise",
//More synonyms
...
],
"antonyms": [
"sit down",
"fall",
"go to bed",
"turn in"
],
"db_entry_last_updated_at": "2024-07-26 05:20:32"
}
}
}