Use Cases

Products

Developer

Blog

Blog

/

Developer

Leveraging Xweather's global weather conditions endpoint

6.3.2020//Developer, API & Mapping

Blog post banner

Access local weather conditions with our global conditions endpoint.

Lee Huffman

Chief Technology Officer, AerisWeather

What is the current weather outside? What’s the weather in Minneapolis, Minnesota? What’s the current temperature in northern Alaska? Current weather conditions are consistently one of the most common requests we receive. To stay cutting-edge, we are constantly growing our observation network - a practice that continues to drive improvements in our global conditions endpoint.

What is the weather conditions endpoint?

Our conditions endpoint provides users with a source for the weather conditions of any location across the globe. The weather conditions for the time and place requested consist of a blend of nearby weather observations, radar and satellite data, global and regional models, near-time analysis, and other proprietary sources - but we package this data for you so you can get it all in one place. Beyond providing the current conditions at a specific place and point in time — for example, 1:23 am the morning of September 6, 2023 in Kansas City — the conditions endpoint also provides hourly conditions across a range of time and goes back as far as April of 2011.

Conditions vs. observations

Before we rolled out the conditions endpoint, the observations endpoint was our chosen solution for displaying the latest weather conditions. The observations endpoint provides access to actual weather conditions observed at thousands of observation stations across the globe. Therefore, the observations endpoint is incredibly accurate, especially for requests near the weather observations’ time and location.

Challenges can arise if there are too few or no nearby observation stations or if the station updates infrequently. Additionally, station elevation is often a hurdle in mountainous regions as the closest observation stations may be a significantly different elevation.

The conditions endpoint solves these challenges of solely using nearby weather observation. The combination of using actual weather observations with radar and satellite information, models, near-real-time analysis, and other sources allows the endpoint to provide accurate weather conditions for any global location and timeframe.

How to use the conditions endpoint

The conditions endpoint supports a variety of integration methods with the specifics depending on your needs. The conditions documentation provides information on the various query methods and an example of the output and associated properties.

Fetching the latest conditions

The most common request is to obtain the latest conditions or the conditions for right now. For this request, pass the location in the URL. The request location can be a city, state combination, latitude/longitude combination, or any of the API supported places.

Current conditions for Minneapolis, MN:

Current conditions for Minneapolis, MN via latitude and longitude:

Current conditions for Paris, France:

Fetching conditions for a point in time

Along with the latest conditions, it also supports requesting the weather conditions for a specific point in time. The point in time is specified using the from parameter and can be a Unix timestamp, a date/time string, or a relative date format.

Conditions for two hours ago:

Conditions for 1:23 am this morning:

Conditions for June 1, 2020 as 1:45pm:

The conditions endpoint supports querying date/times across our entire historical conditions archive, which dates back to April of 2011.

Fetching hourly conditions

The conditions endpoint also allows querying for up to 24 hours of hourly weather conditions, snapped to the top of each hour. For hourly weather conditions, set the from parameter to the start time and the to parameter to the end time. The API will return the weather conditions for the hour defined by the from and to parameters.

Weather conditions for the past 4 hours:

Weather conditions for the last 24 hours:

Weather conditions from midnight through 6 am this morning:

Notice that in the above examples, there is no plimit parameter. The API calculates the total periods based on the from and to parameters. The plimit parameter is available for use if needed.


Make an API call with the conditions endpoint today - start your free 30-day trial here.

Happy coding!

Happy coding!

Lee Huffman

Chief Technology Officer, AerisWeather

Related Resources

Related
Resources

Developer

Adding custom styling to hurricane maps with the Tropical module

Developer

Creating animated weather maps with Leaflet and Xweather Maps

=

Next

Here's your truly smart grid monitoring solution