Skip to content

Commit ed55038

Browse files
Updated to point to API hosted on https://dictionaryapi.dev
Updated API endpoint and usage to reflect changes in API.
1 parent e9b3533 commit ed55038

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

README.md

+32-23
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ Google does not provide API for Google Dictionary so I created one.
44

55
## Getting Started
66

7-
To use, pass the query string with parameter `define` equal to the word you want to get the meaning of.
7+
### Usage
88

9-
Eg. `/?define=hello`, will give you the Google dictionary definition of **hello**:
9+
The basic syntax of a URL request to the API is shown below:
10+
11+
https://api.dictionaryapi.dev/api/v1/entries/<--language_code-->/<--word-->
12+
13+
As an example, to get definition of English word **hello**, you can send request to
14+
15+
https://api.dictionaryapi.dev/api/v1/entries/en/hello, result returned will be,
1016

1117
```json
1218
[
@@ -40,43 +46,46 @@ Eg. `/?define=hello`, will give you the Google dictionary definition of **hello*
4046
]
4147
```
4248

49+
### Language support
4350

44-
Optionally you can also send another parameter `lang` equal to code of the language in which the word appear.
51+
The API supports multiple language, you can query any language supported by sending its language code.
4552

46-
Eg. `/?define=Bonjour&lang=fr`, will give you definition of **Bonjour** as present in French Dictionary.
53+
For example you can get definition of French word **Bonjour** by sending request to,
54+
55+
https://api.dictionaryapi.dev/api/v1/entries/fr/bonjour
4756

4857
```json
49-
[{
50-
"word": "bonjour",
51-
"meaning": {
52-
"nom_masculin": [
53-
{
54-
"definition": "Souhait de bonne journée (adressé en arrivant, en rencontrant).",
55-
"synonyms": [
56-
"salut"
57-
]
58-
}
59-
]
58+
[
59+
{
60+
"word": "bonjour",
61+
"meaning": {
62+
"nom_masculin": [
63+
{
64+
"definition": "Souhait de bonne journée (adressé en arrivant, en rencontrant).",
65+
"synonyms": [
66+
"salut"
67+
]
68+
}
69+
]
70+
}
6071
}
61-
}]
72+
]
6273
```
6374

6475

65-
List of languages supported can be found [here](https://googledictionaryapi.eu-gb.mybluemix.net/languageCode.txt) for your reference.
76+
List of languages supported can be found [here](https://dictionaryapi.dev/languageCode.txt) for your reference.
6677

6778
### Paths
6879

6980
| Location | Endpoint |
7081
| :-- | :-- |
71-
| Root path | `https://googledictionaryapi.eu-gb.mybluemix.net`|
72-
| Root path | `https://mydictionaryapi.appspot.com/`|
82+
| Root path | `https://api.dictionaryapi.dev/`|
7383

7484
### HTTP request and query methods
7585

76-
| Method | Endpoint | Query | Description | Examples |
77-
| :-- | :-- | :-- | :-- | :-- |
78-
| `GET` | `/` | `?define=<YOUR_WORD>` | Retrieves the Google Dictionary definition of the given word that has been entered instead of `<YOUR_WORD>`. | [`?define=hello`](https://googledictionaryapi.eu-gb.mybluemix.net/?define=hello) |
79-
| `GET` | `/` | `/?define=<YOUR_WORD>&lang=<LANGUAGE>` | Retrieves the Google Dictionary definition of the given word that has been entered instead of `<YOUR_WORD>` in the [provided language](https://googledictionaryapi.eu-gb.mybluemix.net/languageCode.txt) `<LANGUAGE>`. | [`/?define=Bonjour&lang=fr`](https://googledictionaryapi.eu-gb.mybluemix.net/?define=Bonjour&lang=fr) |
86+
| Method | Endpoint | Description | Examples |
87+
| :-- | :-- | :-- | :-- |
88+
| `GET` | `/api/v1/entries/<LANGUAGE>/<YOUR_WORD>`| Retrieves the Google Dictionary definition of the given word that has been entered instead of `<YOUR_WORD>` in the [provided language](https://dictionaryapi.dev/languageCode.txt) `<LANGUAGE>`. | [`/api/v1/entries/fr/bonjour`](https://api.dictionaryapi.dev/api/v1/entries/fr/bonjour) |
8089

8190
## Future plans
8291

0 commit comments

Comments
 (0)