https://github.com/imshawan/thewordsapi-backend
TheWordsAPI is a free English-English dictionary API developed for educational purposes.
https://github.com/imshawan/thewordsapi-backend
api api-rest backend curl dictionary dictionary-api dictionaryapi english-dictionary express javascript node nodejs rest-api theword thewordsapi
Last synced: 2 months ago
JSON representation
TheWordsAPI is a free English-English dictionary API developed for educational purposes.
- Host: GitHub
- URL: https://github.com/imshawan/thewordsapi-backend
- Owner: imshawan
- License: mit
- Created: 2021-08-02T08:14:55.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T16:21:45.000Z (over 3 years ago)
- Last Synced: 2025-01-23T13:43:53.463Z (4 months ago)
- Topics: api, api-rest, backend, curl, dictionary, dictionary-api, dictionaryapi, english-dictionary, express, javascript, node, nodejs, rest-api, theword, thewordsapi
- Language: JavaScript
- Homepage: https://thewords.netlify.app
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# theWordsAPI - BackEnd
TheWordsAPI is a free English-English dictionary API developed for educational purposes.
### theWordsAPI - Frontend Link
[https://github.com/imshawan/theWords-Frontend](https://github.com/imshawan/theWords-Frontend/)> **Important Note:** Only dummy database (100 entries each) is provided with this source code, please prepare your own database for deployment purposes.
## Testing
```bash
npm test
```## Local Run
```bash
npm install && npm start
```
## API Usage :: Methods supported -> ['GET']### API URLS
[https://the-words.herokuapp.com/api/v2/definitions/en-US/entries/](https://the-words.herokuapp.com/api/v2/definitions/en-US/entries/)
[https://the-words.herokuapp.com/api/v2/audio/en-US/entries/](https://the-words.herokuapp.com/api/v2/audio/en-US/entries/)
### To fetch definations
Using Curl:
```
curl https://the-words.herokuapp.com/api/v2/definitions/en-US/entries/hello
-H "Accept: application/json"
```
Using Python```python
URL = f"https://the-words.herokuapp.com/api/v2/definitions/en-US/entries/hello"
HEADERS={'Accept': 'application/json'}
response = requests.get(URL, headers=HEADERS)
print(response.text)
```Response:
```
{
"id": 27833,
"word": "hello",
"meanings": [
{
"partOfSpeech": "noun",
"definitions": [
{
"definition": "An utterance of “hello”; a greeting.",
"synonyms": [
"greeting",
"welcome",
"salutation",
"saluting",
"hailing",
"address",
"hello",
"hallo"
],
"example": "she was getting polite nods and hellos from people"
}
]
},
{
"partOfSpeech": "intransitive verb",
"definitions": [
{
"definition": "Say or shout “hello”; greet someone.",
"example": "I pressed the phone button and helloed"
}
]
},
{
"partOfSpeech": "exclamation",
"definitions": [
{
"definition": "Used as a greeting or to begin a phone conversation.",
"example": "hello there, Katie!"
}
]
}
]
}
```### To fetch pronunciation data
Using Curl:
```
curl https://the-words.herokuapp.com/api/v2/audio/en-US/entries/hello
-H "Accept: application/json"
```
Using Python```python
URL = f"https://the-words.herokuapp.com/api/v2/audio/en-US/entries/hello"
HEADERS={'Accept': 'application/json'}
response = requests.get(URL, headers=HEADERS)
print(response.text)
```Response:
```
{
"id": 22998,
"word": "hello",
"contents": [
{
"pronunciation": "he-loh, huh-, hel-oh",
"audio": "https://static.sfdict.com/audio/lunawav/H01/H0178500.ogg"
}
]
}
```## Deployment
After signing up on Heroku, create a new app, and proceed to download Heroku CLI
```bash
heroku login -i
heroku builds:create -a
```
## AboutCopyright (c) 2021 Shawan Mandal.