Endpoint: indices

Indices for health and outdoor activities as based on common weather observations and forecasts.

https://api.aerisapi.com/indices/:type

Supported Indice Types

The following types are supported with the indices endpoint:

arthritis Returns index on how current and forecast weather conditions may affect people with arthritis.
coldflu Returns index on how current and forecast weather conditions may relate to catching a cold or flu<./td>
migraine Returns index on how current and forecast weather conditions may affect migraines.
sinus Returns index on how current and forecast weather conditions may affect sinus headaches.
outdoors Returns index on how current and forecast weather conditions are conducive to general outdoor activities.
golf Returns index on how current and forecast weather conditions are conducive to golfing.
biking Returns index on how current and forecast weather conditions are conducive to biking.
swimming Returns index on how current and forecast weather conditions are conducive to swimming.
campfires Returns index on how current and forecast weather conditions are conducive to campfires and/or grilling.
bees Returns index on how current and forecast weather conditions as related to bees being active.

Supported Actions

The following actions are supported with the indices endpoint:

:id Requesting data by using the :id action is used for returning data for a particular item that has an ID associated with it. This is the primary method for requesting general weather information for a single location (observations, forecasts, advisories, etc.) as the location's name or a zip code serves as the id. Other endpoints may expect a certain value for the ID, such as storm cells whose ID value is a combination of the radar site identifier and unique identifier assigned to every storm cell. Refer to an enpoint's detailed documentation for specific information regarding how to use the :id action.

Supported Parameters

The following parameters are options unless otherwise noted:

callback callback=:functionName Used with JSONP implementation.

Defines the callback function to use for the response. The response will be enclosed as C(response), where C is the callback function provided.
filter filter=:string Predefined filters for limiting the results. The filter value can be a single, comma-delimited or a semicolon delimited string of filter names.
from from=:string Returns the results starting form the value specified.

Supports a UNIX timestamp a specific date string, or a string supported by the PHP strtotime() function.

Examples:
from=tomorrow
from=friday
from=1302883980
from=7/10/2011
from=2011/07/10
from=+2hours
limit limit=:total The total number of results to return as an integer. Each endpoint may have a set maximum for this value depending on usage.

The default limit is 1 if not specified.
p p=:place Defines the location to query data for. Refer to the list of supported place value formats.
plimit plimit=:total Applied only on the periods property, the total number of periods to return as an integer. This parameter has a normal default of one (1).
radius radius=:distance:unit When requesting the closest results within a circle, the radius determines how far from the specified location to search. A valid unit value must be included in your radius value, e.g., "5mi", "10km", "50miles". If no unit is provided, your value is assumed to be in meters by default.

The default radius is 25 miles if not specified.
to to=:string Returns the results between now* and the value specified. When used in conjunction with the from parameter, the value of to will be relative to the value of from, not relative to the current time.

Supports a UNIX timestamp a specific date string, or a string supported by the PHP strtotime() function.

Examples:
to=+6hours
to=+5days
to=1302883980
to=7/10/2011
to=2011/07/10

Supported Filters

The following filters can be passed to the filter parameter to reduce the results that are returned:

day Use day only forecast periods. Example: Monday, Tuesday, Wednesday
daynight Use day and night forecast periods. Example: Monday, Monday Night, Tuesday, Tuesday Night
#hr Use interval based forecast. For hourly use '1hr'. Only supported if your subscription supports hourly/interval based forecasts.
allstations Use all available observation stations for the current index value

Examples

Provide the migraine index based on the latest observation.
/indices/migraine/55403

Provide the migraine index based on the latest observation, and for the next 5 days.
/indices/migraine/55403?to=+5days

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.


{
   "loc":{
      "lat":25.77427,
      "long":-80.19366
   },
   "indice":{
      "type":"migraine",
      "range":{
         "min":1,
         "max":5,
         "reverse":true
      },
      "current":{
         "timestamp":1438627980,
         "dateTimeISO":"2015-08-03T14:53:00-04:00",
         "index":3,
         "indexENG":"moderate"
      },
      "forecast":{
         "periods":[
            {
               "timestamp":1438599600,
               "dateTimeISO":"2015-08-03T07:00:00-04:00",
               "index":1,
               "indexENG":"minimal"
            },
            {
               "timestamp":1438686000,
               "dateTimeISO":"2015-08-04T07:00:00-04:00",
               "index":1,
               "indexENG":"minimal"
            },
            {
               "timestamp":1438772400,
               "dateTimeISO":"2015-08-05T07:00:00-04:00",
               "index":1,
               "indexENG":"minimal"
            },
            {
               "timestamp":1438858800,
               "dateTimeISO":"2015-08-06T07:00:00-04:00",
               "index":1,
               "indexENG":"minimal"
            },
            {
               "timestamp":1438945200,
               "dateTimeISO":"2015-08-07T07:00:00-04:00",
               "index":1,
               "indexENG":"minimal"
            }
         ]
      }
   },
   "place":{
      "name":"miami",
      "state":"fl",
      "country":"us"
   },
   "profile":{
      "tz":"America/New_York"
   }
}
								

Response Properties

The following properties will be provided in every response object:

indice.type (string) Type of indice
indice.range (object) Object containing the indice range information.
indice.range.min (number) The minimum indice value.
indice.range.max (number) The maximum indice value
indice.range.reverse (boolean) Flag determining order of the indice.
indice.current (object) Object containing the indice based on the latest observation. Null if unavailable.
indice.current.timestamp (number) The unix timestamp, in seconds, for the time of the observation used.
indice.current.dateTimeISO (string) ISO 8601 date of the observation used.
indice.current.index (number) The numeric index value
indice.current.indexENG (string) The English phrase for the index value.
indice.forecast (object) The object containing the forecast indice values. Null if the forecast was not requested.
indice.forecast.periods (array) Array of forecast periods
indice.forecast.periods.#.timestamp (number) The unix timestamp, in seconds, for the forecast period. For daily forecasts this will normally be approx 7am local time of the day the forecast period represents.
indice.forecast.periods.#.dateTimeISO (string) The ISO 8601 date of the forecast period. For daily forecasts this will normally be approx 7am local time of the day the forecast period represents.
indice.forecast.periods.#.index (number) The numeric index value for the forecast period
indice.forecast.periods.#.indexEng (number) The English phrase for the index value
loc.long (number) The longitude coordinate of the record.
loc.lat (number) The latitude coordinate of the record.
place.name (string) The place or nearest place to the record.
place.state (string) The state abbreviation in which the record is located. This may be null depending on the country.
place.country (string) The country abbreviation in which the record is located.
profile.tz (string) Timezone name of the location.
profile.tzname (string) The timezone abbreviation for the location.
profile.tzoffset (number) The timezone offset for the location in seconds.
profile.isDST (boolean) True if the location is currently observing Daylight Savings Time (DST), otherwise false.