Daily Indices

Learn how to retrieve all daily indices and their metadata.

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

API_KEY

string

required

This is our API key.

language

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.

Press + to interact
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

Name

string

This is the name of the index.

ID

integer

This is the ID of the index.

This value may be NULL.

Ascending

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."

Description

string

This is the description of the index type.