Helios APIs: Alerts (Search)
To return a list of alerts near a given location, we can query the Search method in the Alerts API using a variety of query parameter options, depending on our particular needs.
To search for alerts located near Phoenix, AZ using a bounding box our API request looks like this:
https://api.helios.earth/v1/alerts?bbox=-113.835,32.412,-110.374,34.473
We can also search for alerts in the same area using a latitude, longitude, and radius:
https://api.helios.earth/v1/alerts?lat=43.1563&lon=lat=33.5437&lon=-112.1155&radius=10000
If we need more precision on the area of interest where we want to search, we can query using a polygon:
https://api.helios.earth/v1/alerts?polygon=-113.835 32.412,-113.835 34.473,-110.374 34.473,-110.374 32.412,-113.835 32.412
We can identify all of the alerts in the entire state of Arizona using the state query parameter:
https://api.helios.earth/v1/alerts?state=arizona
When requesting route information from services like Google Maps or Mapbox Directions, the route is often provided as an encoded polyline. We can used this polyline to perform a polygon search around the given route. To search for alerts along of a stretch of Interstate 10 in Phoenix, AZ our query looks like this:
https://api.helios.earth/v1/alerts?polyline=mqfkErtflTqByml@frEfCrqBkfDqBkdENote: polylines are encoded with different precision depending on the provider. For example, Google Maps uses a precision of 5, while services like Mapbox Directions based on the Open Source Routing Machine use a precision of 6. We have used the default value of 5 here. See the API documentation for more information on specifying different values for the polyline precision and radius used to compute the search polygon.