Skip to main content
Publication

Programmatic Access to AZMet Data with a Web API

Authors
Matt Harmon
Eric Scott
Scott White
Publication Date: July 2026 | Publication Number: az2218 Download PDF

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.

The API endpoint to retrieve AZMet 15-minute data is https://api.azmet.arizona.edu/v1/observations/15min/{stationID}/{startDate}/{timeInterval} where parameters enclosed in {} are the following variables:

  • {stationID}: a valid AZMet station ID
  • {startDate}: the first datetime, inclusive, of data to return
  • {timeInterval}: the time duration of data to return

{stationID} A list of valid station IDs is available on the AZMet website for stations currently listed as active. Use of * for this parameter will return, as default, data for all AZMet stations with data given the context of the other two parameters. Also dependent on the other two parameters, returned data when using * may include the Test station, station ID az99, which is adjacent to the Tucson station, station ID az01, and used to test equipment and sensors before operational field deployment.

{startDate} Entries for this parameter are a valid ISO 8601 datetime without a time zone offset and of the form YYYY-MM-DDTHH:MM where:

  • YYYY: represents a four-digit year
  • MM: represents a two-digit calendar month
  • DD: represents a two-digit day of the specified month
  • T: for time, a literal that does not change based on the parameter value and marks the start of the time designator
  • HH: represents a two-digit hour between 00 and 23
  • MM: represents a two-digit minute between 00 and 59

Use of * for this parameter will result in a default datetime for 15-minute data, which for the AZMet API is set to the date and time representing the start of the past 24 hours of 15-minute data, Arizona date and time. Learn more about the ISO 8601 standard.

{timeInterval} Entries for this parameter are a valid ISO 8601 duration of the form PT[h]H where:

  • P: for period, a literal that does not change based on the parameter value and indicates what follows is a duration designator
  • T: for time, a literal that does not change based on the parameter value and indicates that the value that follows is a duration value for time
  • [h]: represents a non-negative integer value of the number of hours
  • H: for hour, a literal that does not change based on the parameter value and marks the hour designator that follows the value for the number of hours

Use of * for this parameter defaults to 24 hours of 15-minute data and is equivalent the {timeInterval} parameter being set to PT24H.

Although ISO 8601 durations have a period designator, P, at the start of the duration representation that can precede values for year, month, week, day, minute, and second, the AZMet API conveniently requires only a number-of hours value, [h], in the {timeInterval} parameter. Learn more about the format of this parameter.

Parameters at the end of this API endpoint are not required to retrieve 15-minute data and, if missing, will take default values. Asterisk placeholders can be used to specify defaults for a parameter while defining parameters later in the request URL.

Using Tucson as an example AZMet station, access to 15-minute data over the past 24 hours is through the following URL: https://api.azmet.arizona.edu/v1/observations/15min/az01/*/* 

  • The {stationID} parameter is az01 (AZMet station metadata)
  • The {startDate} parameter is *, with YYYY-MM-DD and HH:MM automatically set to the date and time representing the start of the past 24 hours of 15-minute data
  • The {timeInterval} parameter also is *, with the number of hours, [h], automatically set to 24

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.

The API endpoint to retrieve AZMet hourly data is https://api.azmet.arizona.edu/v1/observations/hourly/{stationID}/(startDate}/timeInterval} where parameters enclosed in {} are the following variables:

  • {stationID}: a valid AZMet station ID
  • {startDate}: the first datetime, inclusive, of data to return
  • {timeInterval}: the time duration of data to return

{stationID} A list of valid station IDs is available on the AZMet website for stations currently listed as active. Use of * for this parameter will return, as default, data for all AZMet stations with data given the context of the other two parameters. Also dependent on the other two parameters, returned data when using * may include the Test station, station ID az99, which is adjacent to the Tucson station, station ID az01, and used to test equipment and sensors before operational field deployment.

{startDate} Entries for this parameter are a valid ISO 8601 datetime without a time zone offset and of the form YYYY-MM-DDTHH:MM where:

  • YYYY: represents a four-digit year
  • MM: represents a two-digit calendar month
  • DD: represents a two-digit day of the specified month
  • T: for time, a literal that does not change based on the parameter value and marks the start of the time designator
  • HH: represents a two-digit hour between 00 and 23
  • MM: represents a two-digit minute between 00 and 59

Use of * for this parameter will result in a default date for hourly data, which for the AZMet API is set to the most recent calendar day with 24 hourly observations, Arizona date and time. Learn more about the ISO 8601 standard.

{timeInterval} Entries for this parameter are a valid ISO 8601 duration of the form PT[h]H where:

  • P: for period, a literal that does not change based on the parameter value and indicates what follows is a duration designator
  • T: for time, a literal that does not change based on the parameter value and indicates that the value that follows is a duration value for time
  • [h]: represents a non-negative integer value of the number of hours
  • H: for hour, a literal that does not change based on the parameter value and marks the hour designator that follows the value for the number of hours

Use of * for this parameter defaults to 24 hours of hourly data and is equivalent to the {timeInterval} parameter being set to PT24H

Although ISO 8601 durations have a period designator, P, at the start of the duration representation that can precede values for year, month, week, day, minute, and second, the AZMet API conveniently requires only a number-of-hours value, [h], in the {timeInterval} parameter. Learn more about the format of this parameter.

Parameters at the end of this API endpoint are not required to retrieve hourly data and, if missing, will take default values. Asterisk placeholders can be used to specify defaults for a parameter while defining parameters later in the request URL.

Using January 1, 2020, and Tucson as an example date and AZMet station, access to hourly data on this day is through the following URL: https://api.azmet.arizona.edu/v1/observations/hourly/az01/2020-01-01T00:00/PT24H 

  • The {stationID} parameter is az01 (AZMet station metadata)
  • The {startDate} parameter is 2020-01-01T00:00, with YYYY-MM-DD set to 2020-01-01 and HH:MM set to 00:00
  • The {timeInterval} parameter is PT24H, with the number of hours, [h], set to 24

As the {timeInterval} parameter represents a duration, this example data request returns any hourly data that is recorded at the AZMet Tucson station starting with a timestamp at 00:00 and ending 24 hours later. Since the timestamp for hourly data occurs at the top of every hour, or HH:00, except for midnight, Arizona time, which has a timestamp of 23:59:59, data returned in this example would start with those from the 0100 hour and end with those from the 2400 hour. There is no 0000-hour representation of midnight in data accessed through the AZMet API.

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.

The API endpoint to retrieve AZMet daily data is https://api.azmet.arizona.edu/v1/observations/daily/{stationID}/(startDate}/timeInterval} where parameters enclosed in {} are the following variables:

  • {stationID}: a valid AZMet station ID
  • {startDate}: the first datetime, inclusive, of data to return
  • {timeInterval}: the time duration of data to return

{stationID} A list of valid station IDs is available on the AZMet website for stations currently listed as active. Use of * for this parameter will return, as default, data for all AZMet stations with data given the context of the other two parameters. Also dependent on the other two parameters, returned data when using * may include the Test station, station ID az99, which is adjacent to the Tucson station, station ID az01, and used to test equipment and sensors before operational field deployment.

{startDate} Entries for this parameter are a valid ISO 8601 datetime without a time zone offset and of the form YYYY-MM-DDTHH:MM where:

  • YYYY: represents a four-digit year
  • MM: represents a two-digit calendar month
  • DD: represents a two-digit day of the specified month
  • T: for time, a literal that does not change based on the parameter value and marks the start of the time designator
  • HH: represents a two-digit hour between 00 and 23
  • MM: represents a two-digit minute between 00 and 59

Use of * for this parameter will result in a default date for daily data, which for the AZMet API is set to the most recent calendar day with 24 hours of observations, Arizona date and time. Learn more about the ISO 8601 standard.

{timeInterval} Entries for this parameter are a valid ISO 8601 duration of the form P[d]D where:

  • P: for period, a literal that does not change based on the parameter value and indicates what follows is a duration designator
  • [d]: represents a non-negative integer value of the number of days beyond the {startDate}
  • D: for day, a literal that does not change based on the parameter value and marks the day designator that follows the value for the number of days

Use of * for this parameter defaults to one day of daily data and is equivalent to the {timeInterval} parameter being set to P0D.

Although ISO 8601 durations have a period designator, P, at the start of the duration representation that can precede values for year, month, week, day, minute, and second, the AZMet API conveniently requires only a number-of-days value, [d], in in the {timeInterval} parameter. Learn more about the format of this parameter.

Parameters at the end of this API endpoint are not required to retrieve daily data and, if missing, will take default values. Asterisk placeholders can be used to specify defaults for a parameter while defining parameters later in the request URL.

Using January 1, 2020, and Tucson as an example date and AZMet station, access to daily data on this day is through the following URL: https://api.azmet.arizona.edu/v1/observations/daily/az01/2020-01-01T00:00/P0D  

  • The {stationID} parameter is az01 (AZMet station metadata)
  • The {startDate} parameter is 2020-01-01T00:00, with YYYY-MM-DD set to 2020-01-01 and HH:MM set to 00:00
  • The {timeInterval} parameter is P0D, with the number of days, [d], set to 0

As the {timeInterval} parameter represents a duration, this example data request returns any daily data that is recorded at the AZMet Tucson station starting with a date of 2020-01-01 and ending zero days later, or in other words, that same date. If, for instance, data for the entire month, or 31 days, of January 2020 instead were of interest, one would set [d] to 30.

 

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 nameStation IDStation nameStation IDStation nameStation ID
Tucsonaz01Mohaveaz20Sahuaritaaz38
Yuma Valleyaz02Queen Creekaz22Willcox Benchaz39
Saffordaz04Harquahalaaz23Ft Mohave CAaz40
Coolidgeaz05Rollaz24Salomeaz41
Maricopaaz06Buckeyeaz26Wellton EToaz42
Aguilaaz07Desert Ridgeaz27Yuma Valley EToaz43
Parkeraz08Mohave-2az28Mohave EToaz44
Bonitaaz09Paysonaz32Chino Valleyaz45
Phoenix Greenwayaz12Bowieaz33Duncanaz46
Yuma North Gilaaz14Parker-2az35Elginaz47
Phoenix Encantoaz15Yuma Southaz36Testaz99
Palomaaz19San Simonaz37  

 

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 toolURL
Data Viewer: 15-minutehttps://viz.datascience.arizona.edu/azmet/data-viewer-15minute
Data Viewer: Hourlyhttps://viz.datascience.arizona.edu/azmet/data-viewer-hourly
Data Viewer: Dailyhttps://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