Skip to content

Commit 405dec0

Browse files
Added reasoning behind v2 version of API
1 parent f894795 commit 405dec0

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

README.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,9 @@ The basic syntax of a URL request to the API is shown below:
1010

1111
https://api.dictionaryapi.dev/api/<--version-->/entries/<--language_code-->/<--word-->
1212

13-
As an example, to get definition of English word **hello** using _v1_, you can send request to
13+
As an example, to get definition of English word **hello** using _v2_, you can send request to
1414

15-
https://api.dictionaryapi.dev/api/v1/entries/en/hello, result returned will be,
16-
17-
```json
18-
[
19-
{
20-
"word": "hello",
21-
"phonetic": [
22-
"həˈləʊ",
23-
"hɛˈləʊ"
24-
],
25-
"meaning": {
26-
"exclamation": [
27-
{
28-
"definition": "used as a greeting or to begin a telephone conversation.",
29-
"example": "hello there, Katie!"
30-
}
31-
],
32-
"noun": [
33-
{
34-
"definition": "an utterance of ‘hello’; a greeting.",
35-
"example": "she was getting polite nods and hellos from people"
36-
}
37-
],
38-
"verb": [
39-
{
40-
"definition": "say or shout ‘hello’.",
41-
"example": "I pressed the phone button and helloed"
42-
}
43-
]
44-
}
45-
}
46-
]
47-
```
48-
49-
instead, if you use _v2_, response will be formated in much better way
15+
https://api.dictionaryapi.dev/api/v2/entries/en/hello, result returned will be,
5016

5117
```json
5218
[
@@ -96,6 +62,7 @@ instead, if you use _v2_, response will be formated in much better way
9662
}
9763
]
9864
```
65+
9966
### Language support
10067

10168
The API supports multiple language, you can query any language supported by sending its language code.
@@ -131,6 +98,41 @@ https://api.dictionaryapi.dev/api/v2/entries/fr/bonjour
13198

13299
List of languages supported can be found [here](https://dictionaryapi.dev/languageCode.txt) for your reference.
133100

101+
### Regarding V1 Version
102+
The API earlier use to send response as shown below, but this structure of response was found out to be difficult to work with (you can take a look at these tickets [#32](https://github.com/meetDeveloper/googleDictionaryAPI/issues/32) and [#4](https://github.com/meetDeveloper/googleDictionaryAPI/issues/4)), based on feedback in these tickets I have updated the API to _v2_ version. _v2_ version is available for all languages supported. That said, _v1_ version will always be supported for backward compatibility.
103+
104+
```json
105+
[
106+
{
107+
"word": "hello",
108+
"phonetic": [
109+
"həˈləʊ",
110+
"hɛˈləʊ"
111+
],
112+
"meaning": {
113+
"exclamation": [
114+
{
115+
"definition": "used as a greeting or to begin a telephone conversation.",
116+
"example": "hello there, Katie!"
117+
}
118+
],
119+
"noun": [
120+
{
121+
"definition": "an utterance of ‘hello’; a greeting.",
122+
"example": "she was getting polite nods and hellos from people"
123+
}
124+
],
125+
"verb": [
126+
{
127+
"definition": "say or shout ‘hello’.",
128+
"example": "I pressed the phone button and helloed"
129+
}
130+
]
131+
}
132+
}
133+
]
134+
```
135+
134136
### Paths
135137

136138
| Location | Endpoint |

0 commit comments

Comments
 (0)