APIs
Weather and air quality API
A weather and air quality API reports conditions in the air at a place. oslew answers from station networks — METAR reports from airports and the US EPA’s AirNow monitors — so each value is what the nearest station measuring it last reported, not a figure computed for your exact coordinate. /v1/conditions returns the latest reading of every parameter near a point, /v1/observations returns one parameter as a time series, and forecasts come separately, as ECMWF grids read through the raster route.
Last reviewed
Station data and gridded data answer different questions, and mixing them up is how an application ends up showing an airport’s wind as the wind in a sheltered street. These two routes are the station side: they report what instruments measured, where and when, and they say exactly which instrument answered.
Readings come from stations
GET /v1/conditions?at=lat,lon returns one entry per parameter, sorted by name. The important detail is that each entry is chosen independently: for every parameter, the service finds the nearest station within radius_m that carries it, and reports that station’s most recent value. If an airport and an air-quality monitor are both in range, temperature and wind can come from the airport and PM2.5 from the monitor, at different distances and different times.
That is why every entry carries its own station, distance_m, time and provenance. Read them per entry. Two values in one answer do not necessarily describe the same place or the same moment, and a display that says “conditions at your address” is claiming more than a station network can support.
The radius defaults to its maximum, 50 km, which finds an airport from most towns but can also let a reading from the far side of a mountain range answer for a valley. Narrow it when relevance matters more than always having a value. An area with no station in range is a 200 with an empty list, and so is a deployment with no station feed loaded at all, so an empty answer means “nothing here”, not a failure.
Latest does not mean recent. The value is the latest the loaded feed holds for that station. A station that went quiet yesterday is still the nearest station today, so filter on time before labelling anything current.
A history for one parameter
GET /v1/observations?at=…¶meter=… answers a narrower question: how one quantity has changed at the stations nearest a point. It returns the stations nearest first, each with its points in time order, over a window set by from and to in unix seconds. Without them, the window is the day leading up to the last time the feed holds — not the day leading up to now.
A few behaviours shape how to call it:
- One feed answers. Of the loaded feeds, the one whose nearest station carries the parameter wins, and every station in the answer comes from it.
provenancenames that feed once. - The answer is capped at 10,000 points across all stations. Points fill nearest station first, oldest first, so a window too long for the cap silently loses its newest points and the farther stations. If the total lands exactly on the cap, assume it was cut and page the window, a week at a time for hourly data.
- Precision is declared.
decimalssays how many decimal places the feed stores the parameter to, which is the precision to display. - Values are as published. AirNow’s hourly particulate readings near zero include small negative values. Averaging after discarding them biases the mean upwards; clamp only for display.
A series is only as long as the history the deployment has collected from that feed, so an airport may hold a single report in the default window while a monitor holds a full day.
Names and units belong to the feed
Nothing translates between vocabularies. METAR parameters are named as METAR names them — temp_c, dewpoint_c, wind_dir, wind_kt, gust_kt, vis_mi, altim_inhg, slp_hpa — with the unit in the name: Celsius, knots, statute miles, inches of mercury. AirNow parameters are its own names lower-cased, such as pm25, pm10 and o3. The answer carries no separate units field. A visibility of “at least” in the source is stored as its threshold value, so read the top of the scale as a floor.
Parameter names are exact and case-sensitive, which makes discovery straightforward: ask for a name that does not exist and the 400 lists every parameter that is loaded.
Forecasts are a different kind of data
A forecast is a gridded field over time, not a measurement, so it does not come through these routes. Where ECMWF open-data fields are loaded they are raster layers — ecmwf_2t for near-surface temperature, the wind components, precipitation and sea-level pressure — read through /v1/raster with a time. The elevation and rasters API explains the time axis and how the value between two forecast steps is worked out. Model cells are coarse: they describe an area, not a street, and places a grid cell cannot represent, such as a valley airport, are where a forecast and a station disagree most.
For a page that wants a summary of a place rather than the data itself, /v1/here returns the nearest readings beside the administrative chain and every raster value at a point in one request; the point enrichment use case shows it at work over a table of coordinates.
Licences
Station readings are public data from US federal agencies:
| Feed | What it reports | Licence |
|---|---|---|
| METAR | Airport weather: temperature, dew point, wind, gusts, visibility, pressure | US NWS / aviationweather.gov, public domain |
| AirNow | Air-quality monitors: particulates, ozone and other pollutants | US EPA AirNow, public domain |
| ECMWF open data | Forecast grids, via /v1/raster |
CC-BY-4.0 |
Public-domain readings can be stored and republished; ECMWF’s licence asks for attribution. The licensing page sets these beside every other layer.
What it costs
Both routes are in the Platform product, $699 a month for 20 requests a second sustained, burst 100, with no monthly quota. Paging a long history a week at a time is one request per page, which at the Platform rate is rarely the bottleneck. The pricing page lists the plans that include Platform.
Limits worth knowing
- There is no interpolation between stations: a point between two airports gets the nearer one’s reading, not a blend.
- Which networks and stations answer is a property of the deployment. AirNow’s monitors are concentrated in the United States, and METAR only reports where there is an airport in the loaded feed.
- No alerts or warnings are served, and the service computes no index of its own; values are what the feed published.
- The history is limited to what the deployment has collected, and one answer is capped at 10,000 points.
Bottom line
Use /v1/conditions when a page needs the latest measured weather or air quality near a point, and show each reading’s station, distance and time beside it. Use /v1/observations for a trend, paging long windows so the cap never cuts them. Use the raster route for forecasts, and do not present either kind of data as the conditions at an exact address. The same readings can be joined to the country and region codes from the boundaries API for reporting by area.
Questions
Are the readings real-time?
They are as fresh as the station feed the deployment last loaded. Each entry carries the time the station made the observation, and a station that stopped reporting is still the nearest station, so compare that time with the clock before calling a value current. The API does not interpolate or extrapolate to the present.
Why does the temperature come from a station some distance away?
Because the data is station-based, not gridded. The answer for each parameter comes from the closest station within the search radius that measures it, and it reports that station’s distance. Where no station is near, the nearest one may sit across a ridge or a coastline from your point; a smaller radius trades coverage for relevance.
Can I get a weather forecast?
Not from these routes, which report what stations measured. Where ECMWF open-data fields are loaded, forecasts are raster layers such as ecmwf_2t, read through /v1/raster with a time in unix seconds. They describe grid cells, not streets, and are interpolated between forecast steps.
Which pollutants can I query?
Whatever the loaded air-quality feed reports, under the feed’s own names. From AirNow that includes pm25, pm10 and o3, with units as AirNow publishes them. Ask /v1/observations for a parameter name that is not loaded and the error lists every name that is, which is the reliable way to see what a deployment carries.
Can I store and republish the readings?
METAR and AirNow readings are US Government public-domain data, so they can be kept and republished. Forecast fields are CC-BY-4.0 and need ECMWF credited as the source. Each entry’s provenance names the feed and its licence, so decide per reading rather than per request.