We have released version 1.7.3 of the AerisWeather API to production that builds upon the recent Canadian weather alert additions and improved advisory support. We will highlight a few of these changes, though for the complete list of updates review the AerisWeather API release history.
With the addition of Canadian weather alerts, we have added new filters to simplify querying alerts specifically for the US or Canada. For instance, to limit results to US alerts, utilize filter=usa, which is the equivalent to using query=country:us
1 |
/advisories/search?filter=usa&limit=100 |
For Canada alerts, you would use filter=canada, which is equal to using query=country:ca
1 |
/advisories/search?filter=canada&limit=100 |
A weather alert is normally issued for multiple locations, weather zones or counties in the Canadian location codes (CLCs) in Canada. When performing searches using the Aeris API, a copy of the alert will be returned for each location the alert is for.
For example, if a flood watch is issued for the MNZ001-MNZ002-MNZ003 weather zones and you query the API with:
1 |
/advisories/search?filter=flood&limit=100 |
The API will return three copies of the same flood watch, one for each of the three locations.
In some use cases, you may not want to include a copy of the same alert for each location. To make this easier, the API now supports a distinct filter. Adding filter=distinct to the above example will return only a single copy of the flood watch.
For instance, to obtain unique thunderstorm warnings within the US:
1 |
/advisories/search?filter=usa,distinct&query=type:SV.W |
There are a couple considerations when using this filter:
The advisories/summary endpoint now supports both US and Canadian alerts. Additionally, the new canada, usa, and distinct filters work with this endpoint.
When using this endpoint, the summary.states attribute will return Canadian provinces with the ca.xx format where xx is the two-letter province abbreviation. For example, the API will return ca.on for Ontario. This change will prevent any potential current or future conflicts with US state abbreviations.
Use our free developer trial and start integrating weather data into your next project!
No comments yet.
Be the first to respond to this article.