Indices
https://data.api.xweather.com/indices/:type/
Supported Indice Types
The following types are supported with the indices endpoint:
Indice | Description |
---|---|
arthritis | An index on how current and forecast weather conditions may affect people with arthritis. |
coldflu | An index on how current and forecast weather conditions may relate to catching a cold or flu. |
migraine | An index on how current and forecast weather conditions may affect migraines. |
sinus | An index on how current and forecast weather conditions may affect sinus headaches |
outdoors | An index on how current and forecast weather conditions are conducive to general outdoor activities. |
golf | An index on how current and forecast weather conditions are conducive to golfing. |
biking | An index on how current and forecast weather conditions are conducive to biking. |
swimming | An index on how current and forecast weather conditions are conducive to swimming. |
campfires | An index on how current and forecast weather conditions are conducive to campfires. |
bees | An index on how current and forecast weather conditions as related to bees being active. |
Requests
Every request to the endpoint must include one of the supported actions in the url.
https://data.api.xweather.com/indices/:type/{action}?client_id={client_id}&client_secret={client_secret}&{params}
Supported Actions
The following actions are supported with the /indices/:type endpoint:
Action | Description |
---|---|
:id | Type: stringTypically used for passing a geographical location name or identifier such as city name, lat/long, or even US and Canadian postal codes. Learn more. |
route | Type: stringAllows you to pass several coordinates along a custom route to return data points at each location. Learn more. |
Response
The following is an example of what each object in the response will consist of. Depending on your requested action, the response may contain multiple instances of this object within an array.
Properties
loc (object)
The location of the record.
loc.lat (number)
The latitude coordinate of the record.
loc.long (number)
The place or nearest place to the record.
indice (object)
Object containing information about the index.
indice.type (string)
The type of index.
indice.range (object)
Object containing information about the index range.
indice.range.min (number)
The minimum value of the index range.
indice.range.max (number)
The maximum value of the index range.
indice.range.reverse (boolean)
Flag indicating if the index range is reversed.
indice.past (Object)
Not currently used. Will be used to store historical index data. Null for now.
indice.current (object)
Object containing information about the current index.
indice.current.timestamp (number)
The unix timestamp, in seconds, for the valid time of the current index.
indice.current.dateTimeISO (string)
The ISO-8601 date and time string for the valid time of the current index.
indice.current.index (number)
The numeric index value. The value, is normally from 0-5.
0 = Unavailable
If indice.range.reverse = false:
1 = bad
2 = poor
3 = good
4 = very good
5 = excellent
If indice.range.reverse = true:
1 = excellent
2 = very good
3 = good
4 = poor
5 = bad
indice.current.indexENG (string)
The English phrase for the index value.
Possible values include:
- unavailable
- bad
- poor
- good
- very good
- excellent
indice.forecast (object)
Object containing information about the forecast index.
indice.forecast.periods (array)
Array containing information about the forecast index periods.
indice.forecast.periods.#.timestamp (number)
The unix timestamp, in seconds, for the valid time of the forecast index.
indice.forecast.periods.#.dateTimeISO (string)
The ISO-8601 date and time string for the valid time of the forecast index.
indice.forecast.periods.#.index (number)
The numeric index value. The value, is normally from 0-5.
0 = Unavailable
If indice.range.reverse = false:
1 = bad
2 = poor
3 = good
4 = very good
5 = excellent
If indice.range.reverse = true:
1 = excellent
2 = very good
3 = good
4 = poor
5 = bad
indice.forecast.periods.#.indexENG (string)
The English phrase for the index value.
Possible values include:
- unavailable
- bad
- poor
- good
- very good
- excellent
place (object)
Object containing information about the place or nearest place to the record.
place.name (string)
The place or nearest place to the record.
place.state (string)
The state abbreviation in which the response is located. This may be null
or an empty string depending on the country.
place.country (string)
The 2 letter ISO-3166 country abbreviation in which the response is located.
profile (object)
Object containing information about the location or event.
profile.tz (string)
Timezone name of the location, such as America/New_York
.
[
{
"loc": {
"lat": 44.97997,
"long": -93.26384
},
"indice": {
"type": "coldflu",
"range": {
"min": 1,
"max": 5,
"reverse": true
},
"past": null,
"current": {
"timestamp": 1702583460,
"dateTimeISO": "2023-12-14T13:51:00-06:00",
"index": 1,
"indexENG": "minimal"
},
"forecast": {
"periods": [
{
"timestamp": 1702558800,
"dateTimeISO": "2023-12-14T07:00:00-06:00",
"index": 1,
"indexENG": "minimal"
},
{
"timestamp": 1702645200,
"dateTimeISO": "2023-12-15T07:00:00-06:00",
"index": 1,
"indexENG": "minimal"
}
]
}
},
"place": {
"name": "minneapolis",
"state": "mn",
"country": "us"
},
"profile": {
"tz": "America/Chicago"
}
}
]