The query parameter allows you to make detailed requests for the specific data you need that is not covered by the more general filters for that endpoint. This allows you to search for weather data based on a particular property of any data object within the API.
The following is the basic format for queries:
|PROP||The property to perform the query on for the data object. The endpoints allow for shortened versions of property names, such as name and state under the places endpoint, instead of having to provide the dot-notation format. Refer to the documentation for each endpoint for information regarding the short names of properties.|
|VAL/MIN_VAL||If performing a query against a numerical field, this should be the minimum allowed value returned in the result set. If querying against a string field, this is the exact value of the property to search for.
Not Equal Too - If the VAL is preceded by an exclamation point (!) then a "not equal to" query is performed.
Starts With - If the VAL is preceded by an caret (^) then a "starts with" query is performed. This type of query is often used for auto complete queries.
|MAX_VAL||Only used when performing numerical field queries, this is the maximum allowed value to be returned in the result set. Please note, when using the MAX value, a MIN value is required.|
Querying against a string property from the data object is an equal to operation. Therefore, you must provide the string exactly as what appears as the value for that property in order to return the proper results.
For example, to return a place object for Seattle, WA, you would request the following:
Not equal to example: The following will return up to 10 locations where the name is "blacksburg" and state is not equal to "va" (Virginia) under the places endpoint:
Starts with example: The following will return up to 10 locations within the United States where the location name starts with the strong "minn" under the places endpoint:
Performing a query against a numerical property is handled slightly differently than a string property in that it is an >= - <= operation. If only the first value is provided, then all results whose value for that property is greater than or equal to (>=) the specified value is returned. The following request would return all storm cells that have an 80% probability or higher of containing hail:
If both a minimum and maximum value are provided, then all results whose value for the property is equal to or in between the two values is returned. The following request would return all storm cells closest to the location whose probability of hail is >= 40% and <= 80%:
You may want to perform a query in which you define a maximum value to cap the request with but not a minimum value. In this case, you would simply not provide the first value, which informs the API you want all results whose value is less than or equal to (<=) the specified value. For instance, the following request will return all storm cells whose probability of hail is 80% or less:
Not equal to (!=): To perform a query that just ensures the numeric value is not equal to the value, just include an exclamation point in front of the value. For example, to obtain storm cells where the probability of hail is not equal to zero (0) use:
Multiple properties can be chained together in a single request to perform more complex AND/OR conditional queries. An AND operation is designated by separating your query strings by a comma (,). However, you would use a semicolon (;) character to separate your OR operations.
For example, the following places request would return all places whose name is either Seattle OR Austin:
The following request is commonly used to return all storm cells that have a tornadic signature, which also depends on the OR query operation:
The AerisWeather API allows requesting entries where a value is NULL or not NULL. A perfect use case may be to find the observations that did not report humidity:
Or to avoid a null value for specific query properties by utilizing the
!NULL option. Each endpoint query properties will support this option. The example below demonstrates how to ensure the reporting station contains a value for humidity:
Last modified: November 11, 2020