https://github.com/ajdavidl/dictionary-api
An API to query dictionary sites.
https://github.com/ajdavidl/dictionary-api
Last synced: 2 months ago
JSON representation
An API to query dictionary sites.
- Host: GitHub
- URL: https://github.com/ajdavidl/dictionary-api
- Owner: ajdavidl
- License: gpl-3.0
- Created: 2023-05-19T14:28:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-08T01:27:16.000Z (7 months ago)
- Last Synced: 2025-01-21T05:09:04.058Z (4 months ago)
- Language: Python
- Homepage:
- Size: 25.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dictionary-api
An API to query dictionary sites.
This small project creates a flask API in the localhost. The API queries dictionary sites to get the word translations. I use it in my self-hosted [LWT](https://github.com/HugoFara/lwt) server to learn new words.
The available dictionaries are [Glosbe](https://glosbe.com/), [Pons](https://en.pons.com/translate) and [Linguee](https://www.linguee.com/).
In the data folder there are dictionaries in the tsv format that were compiled from freedict and wikidict dictionaries.
## Usage
```shell
git clone https://github.com/ajdavidl/dictionary-api.git
cd dictionary-api
pip install -r requirements.txt
python app.py
```Now you can query the API using `curl`.
Example: to query the English word `language` in Portuguese.
```shell
curl http://localhost:5555/web/en/pt/language
```Or you can browse the address `http://localhost:5555/web/en/pt/language` in your favorite browser.
If you wish to use the local dictionaries (only Portuguese as target language), you need to put the local name in the API call.
```shell
curl http://localhost:5555/local/es/pt/language
```