Daily Indices
Learn how to retrieve all daily indices and their metadata.
We'll cover the following
Overview
In this lesson, we learn how to retrieve a list of all daily indices and their metadata.
List all daily indices
We make a GET
request to the following URL to get a list of all daily indices and their metadata:
http://dataservice.accuweather.com/indices/v1/daily
URL query parameters
Parameter | Type | Category | Description |
| string | required | This is our API key. |
| string | optional | This is the language in which we have to return the results. Its default value is “en-us.” |
Sample code
You can try adding the optional parameter language
to the URL on lines 1–2 to get results in a language of your choice.
Click the "Run" button to see the output.
url = 'http://dataservice.accuweather.com/indices/v1/daily' \+ '?apikey={{API_KEY}}'response = requests.get(url)printResponse(response)
The output of the code above displays all daily indices as a list of objects. For each of these index objects, it provides its metadata that comprises the attributes given in the table below. In case of failure, an appropriate error message is displayed.
Metadata for each index type
Parameter | Type | Description |
| string | This is the name of the index. |
| integer | This is the ID of the index. This value may be NULL. |
| boolean | This is the order of the index values. If "True," the best value is 10 and the poorest value is 0. Vice versa in case it is "False." |
| string | This is the description of the index type. |