Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chenelias/cambridge-dictionary-api
API for Cambridge Dictionary, written in Node.js.
https://github.com/chenelias/cambridge-dictionary-api
api cambridge-dictionary cambridge-dictionary-api cheerio express free-dictionary-api nodejs
Last synced: about 1 month ago
JSON representation
API for Cambridge Dictionary, written in Node.js.
- Host: GitHub
- URL: https://github.com/chenelias/cambridge-dictionary-api
- Owner: chenelias
- License: mit
- Created: 2023-08-27T03:23:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-28T07:25:29.000Z (7 months ago)
- Last Synced: 2024-12-17T08:54:53.671Z (about 2 months ago)
- Topics: api, cambridge-dictionary, cambridge-dictionary-api, cheerio, express, free-dictionary-api, nodejs
- Language: JavaScript
- Homepage: https://dictionary-api.eliaschen.dev
- Size: 3.46 MB
- Stars: 61
- Watchers: 1
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Cambridge Dictionary API
A simple API for Cambridge Dictionary, built with Node.js.
## ๐น๏ธ Manual
### ๐๏ธ dictionary
api/dictionary/`{language}`/`{word}`
#### **language option:**
| option | description |
| ----------- | :-------------------------: |
| **`en`** | english (us) |
| **`uk`** | english (uk) |
| **`en-cn`** | english-chinese-simplified |
| **`en-tw`** | english-chinese-traditional |**use `/` to test it with UI**
## ๐ Deploy
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/chenelias/cambridge-dictionary-api/)
## ๐ป Running Locally
After clone this repository, run the following commands in the repository floder:
```bash
# install dependencies
pnpm install
# run
pnpm run dev
```Then fetch `http://localhost:3000/api/dictionary/english/hello` to test it
or use / to test it out with UI.## ๐ Example
/api/dictionary/`en-tw`/`cook`
```json
{
"word": "cook",
"pos": ["verb", "noun"],
"verbs": [
{
"id": 0,
"type": "Plain form",
"text": "cook"
},
{
"id": 1,
"type": "Third-person singular",
"text": "cooks"
},
{
"id": 2,
"type": "Past tense",
"text": "cooked"
},
{
"id": 3,
"type": "Past participle",
"text": "cooked"
},
{
"id": 4,
"type": "Present participle",
"text": "cooking"
},
{
"id": 5,
"type": "Singular",
"text": "cook"
},
{
"id": 6,
"type": "Plural",
"text": "cooks"
}
],
"pronunciation": [
{
"pos": "verb",
"lang": "uk",
"url": "https://dictionary.cambridge.org/us/media/english-chinese-traditional/uk_pron/u/ukc/ukcon/ukconve028.mp3",
"pron": "/kสk/"
},
{
"pos": "verb",
"lang": "us",
"url": "https://dictionary.cambridge.org/us/media/english-chinese-traditional/us_pron/c/coo/cook_/cook.mp3",
"pron": "/kสk/"
},
{
"pos": "noun",
"lang": "uk",
"url": "https://dictionary.cambridge.org/us/media/english-chinese-traditional/uk_pron/u/ukc/ukcon/ukconve028.mp3",
"pron": "/kสk/"
},
{
"pos": "noun",
"lang": "us",
"url": "https://dictionary.cambridge.org/us/media/english-chinese-traditional/us_pron/c/coo/cook_/cook.mp3",
"pron": "/kสk/"
}
],
"definition": [
{
"id": 0,
"pos": "verb",
"text": "When you cook food, you prepare it to be eaten by heating it in a particular way, such as baking or boiling, and when food cooks, it is heated until it is ready to eat.",
"translation": "ๅ้ฃฏ๏ผ็น่ชฟ;็๏ผ็ ฎ",
"example": [
{
"id": 0,
"text": "I don't cook meat very often.",
"translation": "ๆไธๅธธ็ ฎ่ๅใ"
},
{
"id": 1,
"text": "He cooked us a huge dinner./He cooked a huge dinner for us.",
"translation": "ไป็ตฆๆๅๆบๅไบไธ้ ่ฑ็็้ฃฏ่ใ"
},
{
"id": 2,
"text": "Let the fish cook for half an hour before you add the wine.",
"translation": "ๅ ๆ้ญ็ ฎๅๅๅฐๆๅๅ ๅ ฅ้ ใ"
}
]
},
{
"id": 1,
"pos": "noun",
"text": "someone who prepares and cooks food",
"translation": "ๅปๅธซ",
"example": [
{
"id": 0,
"text": "She's a wonderful cook.",
"translation": "ๅฅนๆฏไฝๅพๅบ่ฒ็ๅปๅธซใ"
}
]
}
]
}
```## Support me ๐
Hi there, I'm Elias, a middle school student from Taiwan. This API was initially created for another project that I'm still working on. I have never expected that so many people are interested in this project, please consider sponsoring me.\
Your donations would cover the operating costs of the database and the server for my future projects.
thanks a lot โค๏ธ.## API Source
- Verbs from [wiktionary](https://www.wiktionary.org/)
- Other data from [Cambridge Dictionary](https://dictionary.cambridge.org/)Develop by Elias โค๏ธ \
Contributions are welcome! ๐