Programmatic Access to AZMet Data with a Web API
The Arizona Meteorological Network (AZMet) collects, processes, and stores 15-minute, hourly, and daily data from 34 stations currently measuring air and soil temperature, wind speed and direction, relative humidity, solar radiation, and precipitation. A new application programming interface (API) is now available to provide access to these data and to facilitate custom downloads with user-specified parameters. In this publication, we provide background information on the AZMet API and instructions on using it to access and download 15-minute, hourly, and daily AZMet data. We also describe other resources for data access and downloads that leverage the AZMet API and have varying levels of simplification to support users with different data needs and technical skill sets.
The AZMet API
The AZMet REST (Representational State Transfer) API is an interface that allows software, or a client, to access and download server-stored station data programmatically or through a browser using standard HTTP (hypertext transfer protocol) methods rather than a direct machine-to-machine connection. Being based on HTTP methods, the AZMet API receives requests for station data through URLs (uniform resource locators), or web addresses. Technically considered as API endpoints, these URLs are structurally but not exactly similar for 15-minute, hourly, and daily AZMet data, as the network stores records of each observation type in its own database table. Returned data is a JSON (JavaScript Object Notation) response, a compact and structured text-based format that is faster than other data formats for transmitting and processing, and both human-readable and machine-readable with many programming languages.
Pulling data for different time intervals
15-minute time interval
AZMet collects data most frequently every 15 minutes as the basis for its real-time system and stores these data for only the past 14 days from present, Arizona date and time. Except for maxima, minima, and totals since midnight or the top of the hour, values are instantaneous measurements rather than ones integrating conditions over a 15-minute period. Descriptions of 15-minute data variables are available on the AZMet website.
Hourly time interval
Hourly data currently are available through the API from January 1, 2020, to the present for all stations with measurements during this period. For data prior to this date, users need to access the legacy data archive. As AZMet applies present-day quality assurance and control (QA/QC) methods to data from years prior to 2020, the network will make those data available via the API. Except for soil temperature, which is sampled once per hour, values are averages, maxima, or totals integrating conditions over a 60-minute period rather than ones instantaneously measuring conditions once per hour. Descriptions of hourly data variables are available on the AZMet website.
Daily time interval
Daily data currently are available through the API from January 1, 2020, to the present for all stations with measurements during this period. For data prior to this date, users need to access the legacy data archive. As AZMet applies present-day QA/QC methods to data from years prior to 2020, the network will make those data available via the API. Values are averages, maxima, minima, or totals integrating conditions over a 24-hour period rather than ones instantaneously measuring conditions once per day. Descriptions of daily data variables are available on the AZMet website.
Table 1. There are currently 35 AZMet stations in operation and with data available through the AZMet API, including a test station adjacent to the Tucson station. Valid entries for the {stationID} parameter of API endpoints are in the “Station ID” column. This information, along with additional station details including locations, start and end dates, and sensors, also is available on the AZMet website.
| Station name | Station ID | Station name | Station ID | Station name | Station ID |
|---|---|---|---|---|---|
| Tucson | az01 | Mohave | az20 | Sahuarita | az38 |
| Yuma Valley | az02 | Queen Creek | az22 | Willcox Bench | az39 |
| Safford | az04 | Harquahala | az23 | Ft Mohave CA | az40 |
| Coolidge | az05 | Roll | az24 | Salome | az41 |
| Maricopa | az06 | Buckeye | az26 | Wellton ETo | az42 |
| Aguila | az07 | Desert Ridge | az27 | Yuma Valley ETo | az43 |
| Parker | az08 | Mohave-2 | az28 | Mohave ETo | az44 |
| Bonita | az09 | Payson | az32 | Chino Valley | az45 |
| Phoenix Greenway | az12 | Bowie | az33 | Duncan | az46 |
| Yuma North Gila | az14 | Parker-2 | az35 | Elgin | az47 |
| Phoenix Encanto | az15 | Yuma South | az36 | Test | az99 |
| Paloma | az19 | San Simon | az37 |
Table 2. Data viewers that support AZMet QA/QC activities are publicly available online and provide an alternative user interface to download 15-minute, hourly, and daily data for all active stations within a user-specified date range.
| Data tool | URL |
|---|---|
| Data Viewer: 15-minute | https://viz.datascience.arizona.edu/azmet/data-viewer-15minute |
| Data Viewer: Hourly | https://viz.datascience.arizona.edu/azmet/data-viewer-hourly |
| Data Viewer: Daily | https://viz.datascience.arizona.edu/azmet/data-viewer-daily |
Additional resources
AZMet provides other resources for data access and downloads that leverage the AZMet API and have varying levels of simplification to support users with different data needs and technical skill sets.
For R users, AZMet has developed and maintains the R package {azmetr}, which provides alternative programmatic access to station data via the API (Weiss & Scott 2024). Installation instructions and function examples are on the package website. The {azmetr} package provides functions for the R programming language (R Core Team 2026) that access AZMet data by creating API requests like in the previous examples while formatting returned JSON responses as data frames. Unlike directly generating URLs of API endpoints with formatted {startDate} and {timeInterval} parameters, the {azmetr} functions accept simplified start and end dates and datetimes, automatically translating those to ISO 8601 datetimes and durations. The {azmetr} package is best for downloading larger data requests that are at least several weeks of hourly data or several months of daily data.
As part of a suite of data tools that support QA/QC activities, AZMet also has developed and maintains individual data viewers for 15-minute, hourly, and daily data (Table 2). Viewers are publicly available online and allow users to select a date range of interest. Once data are retrieved, tools show tabular and graphical summaries across all stations and provide one-click buttons to download a file of the retrieved data in either comma- or tab-separated values, or .csv or .tsv, formats. These data tools are best for downloading smaller data requests that are less than several weeks of hourly data or several months of daily data.
AZMet additionally has developed and maintains a data tool to preview and download hourly and daily data by station and date range. After a user selects a station, specifies either an hourly or daily observation type, and sets the period of interest, data are returned and displayed in tabular form for preview. One-click buttons to download a file of the retrieved data in either comma- or tab-separated values, or .csv or .tsv, formats, also appear. This data tool is best for downloading smaller data requests that are less than several weeks of hourly data or several months of daily data.
Citations for data and data tool use
Arizona Meteorological Network (Year) Arizona Meteorological Network (AZMet) Data. https://azmet.arizona.edu. Accessed (Date)
Arizona Meteorological Network (Year) Data Preview and Download. https://viz.datascience.arizona.edu/azmet/data-preview-and-download. Accessed (Date)
Arizona Meteorological Network (Year) Data Viewer: 15-minute. https://viz.datascience.arizona.edu/azmet/data-viewer-15minute. Accessed (Date)
Arizona Meteorological Network (Year) Data Viewer: Daily. https://viz.datascience.arizona.edu/azmet/data-viewer-daily. Accessed (Date)
Arizona Meteorological Network (Year) Data Viewer: Hourly. https://viz.datascience.arizona.edu/azmet/data-viewer-hourly. Accessed (Date)
Acknowledgments
The authors thank University of Arizona Cooperative Extension, the National Oceanic and Atmospheric Administration (NOAA)-funded Commercial Data Program-National Mesonet Program, and Arizona Experiment Station, Communication & Cyber Technologies for support of this work. Dr. Paul Brown and Bruce Russell provided guidance on the initial development of the AZMet API.
References
R Core Team (2026). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
Weiss, J., & Scott, E. R. (2024). azmetr: Access Arizona weather data from the AZMet API (Version 0.3.0) [Computer software]. azmetr: Access Arizona weather data from the AZMet API. https://zenodo.org/records/10498596