You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-28Lines changed: 34 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ __jhu__ data-source will be used as a default source if you don't specify a *sou
34
34
All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL:
You can try to open the URL in your browser to further inspect the response. Or you can make this curl call on your terminal to see the prettified response:
37
+
You can open the URL in your browser to further inspect the response. Or you can make this curl call in your terminal to see the prettified response:
| source | The data-source where data will be retrieved from. __Value__ can be: __jhu/csbs__. __Default__ is __jhu__| String |
188
-
| country_code | The ISO ([alpha-2 country_code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) to the Country/Province for which you're calling the Endpoint | String |
189
-
| timelines | To set the visibility of timelines (*daily tracking*).__Value__ can be: __0/1__. __Default__ is __0__| Integer |
| source | The data-source where data will be retrieved from. |
188
+
|__Value__ can be: *jhu/csbs*. __Default__ is *jhu*| String |
189
+
| country_code | The ISO ([alpha-2 country_code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) to the Country/Province for which you're calling the Endpoint | String |
190
+
| timelines | To set the visibility of timelines (*daily tracking*). |
191
+
|__Value__ can be: *0/1*. __Default__ is *0* (timelines are not visible) | Integer |
| {latest} | The total amount of confirmed cases, deaths and recoveries for all the locations | Object |
196
-
| {latest}/confirmed | The up-to-date total number of confirmed cases for all the locations within the data-source | Integer |
197
-
| {latest}/deaths | The up-to-date total amount of deaths for all the locations within the data-source | Integer |
198
-
| {latest}/recovered | The up-to-date total amount of recovered for all the locations within the data-source | Integer |
199
-
| {locations} | The collection of locations contained within the data-source | Object |
200
-
| {location} | Information that identifies a location | Object |
201
-
| {latest} | The amount of confirmed cases, deaths and recovered related to the specific location | Object |
202
-
| {locations}/{location}/{latest}/confirmed | The up-to-date number of confirmed cases related to the specific location | Integer |
203
-
| {locations}/{location}/{latest}/deaths | The up-to-date number of deaths related to the specific location | Integer |
204
-
| {locations}/{location}/{latest}/deaths | The up-to-date number of recovered related to the specific location | Integer |
205
-
| {locations}/{location}/id | The location id. This id number is assigned to the location by the data-source. | Integer |
206
-
| {locations}/{location}/country | The Country name | String |
207
-
| {locations}/{location}/country_code | The ISO ([alpha-2 country_code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) Country code for the location. | String |
208
-
| {locations}/{location}/province | The province where the location belongs to. (Used only for __csbs data-source__ of US locations. __Empty__ with __jhu data-source__. | String |
209
-
| {locations}/{location}/{coordinates}/latitude | The location latitude | Float |
210
-
| {locations}/{location}/{coordinates}/longitude | The location longitude | Float |
| {latest} | The total amount of confirmed cases, deaths and recovered for all the locations | Object |
198
+
| {latest}/confirmed | The up-to-date total number of confirmed cases for all the locations within the data-source | Integer |
199
+
| {latest}/deaths | The up-to-date total amount of deaths for all the locations within the data-source | Integer |
200
+
| {latest}/recovered | The up-to-date total amount of recovered for all the locations within the data-source | Integer |
201
+
| {locations} | The collection of locations contained within the data-source | Object |
202
+
| {location} | Information that identifies a location | Object |
203
+
| {latest} | The amount of confirmed cases, deaths and recovered related to the specific location | Object |
204
+
| {locations}/{location}/{latest}/confirmed | The up-to-date number of confirmed cases related to the specific location | Integer |
205
+
| {locations}/{location}/{latest}/deaths | The up-to-date number of deaths related to the specific location | Integer |
206
+
| {locations}/{location}/{latest}/deaths | The up-to-date number of recovered related to the specific location | Integer |
207
+
| {locations}/{location}/id | The location id. This unique id is assigned to the location by the data-source. | Integer |
208
+
| {locations}/{location}/country | The Country name | String |
209
+
| {locations}/{location}/country_code | The [ISO alpha-2 country_code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Country code for the location. | String |
210
+
| {locations}/{location}/province | The province where the location belongs to. (Used for US locations coming from __csbs data-source__. |
211
+
|__Empty__ when *jhu data-source* is used | String |
212
+
| {locations}/{location}/{coordinates}/latitude | The location latitude | Float |
213
+
| {locations}/{location}/{coordinates}/longitude | The location longitude | Float |
211
214
212
215
213
216
### Example Requests with parameters
214
217
215
218
__Parameter: country_code__
219
+
216
220
Getting data for the Country specified by the *country_code parameter*, in this case Italy - IT
217
221
218
222
```http
@@ -249,6 +253,7 @@ __Sample Response__
249
253
```
250
254
251
255
__Parameter: source__
256
+
252
257
Getting the data from the data-source specified by the *source parameter*, in this case [csbs](https://www.csbs.org/information-covid-19-coronavirus)
253
258
254
259
@@ -306,12 +311,13 @@ __Sample Response__
306
311
```
307
312
308
313
__Parameter: timelines__
314
+
309
315
Getting the data for all the locations including the daily tracking of confirmed cases, deaths and recovered per location.
310
316
311
317
```http
312
318
GET /v2/locations?timelines=1
313
319
```
314
-
Explore the response by opening the URL in your browser [https://coronavirus-tracker-api.herokuapp.com/v2/locations?timelines=1](https://coronavirus-tracker-api.herokuapp.com/v2/locations?timelines=1) or make the following curl call on your terminal:
320
+
Explore the response by opening the URL in your browser [https://coronavirus-tracker-api.herokuapp.com/v2/locations?timelines=1](https://coronavirus-tracker-api.herokuapp.com/v2/locations?timelines=1) or make the following curl call in your terminal:
0 commit comments