How do the JSON output and object table of air quality observations API made by CustomWeather work?
In this article, I will clarify the object table and JSON and XML output of the CustomWeather air quality observations API. The CustomWeather air quality observations API provides data on various pollutants and meteorological conditions at different locations. The data is provided in two formats, an object table and an output. The object table is a structured representation of the data that can be easily read and understood by humans and can be easily imported into a database for further analysis. The output is a more lightweight, machine-readable format that can be easily parsed and processed by computer programs. I will explain the structure and contents of the object table and XML output and give examples of how they can be used to analyze air quality data.
Object and description table
Objects | Description |
gmt_date | The update time of the product in UTC time in HHMMDDYYYY format. |
unix_date | The number of seconds elapsed since 1971-01-01 00:00 UTC of the update time of the actual data. |
timezone | Time zone offset from UTC of the location. |
state | The state code of the requested location. |
state_name | The state name of the requested location. |
country | The country code. |
iso_cc | The ISO country code. |
country_name | The country name. |
local_time | The real-time local time of the location. |
localupdatetime | The time of the last update. |
metric | Metric units indicator (true or false). |
city_name | The location name. |
longitude | The longitude coordinates in decimal degrees of the requested location. |
latitude | The latitude coordinates in decimal degrees of the requested location. |
tzinfo | IANA (Internet Assigned Numbers Authority) time zone database identifier. |
elevation | The elevation of the location in meters or feet. |
name | The name of the weather product being requested. |
station_id | The air quality station ID. |
forecast_id | The nearest CustomWeather location ID. |
air_station_name | The air quality station name. |
etc | etc |
gmt_date: The update time of the product in UTC time in the format of hour, minute, day, month, and year.
unix_date: The number of seconds elapsed since January 1, 1971, 00:00 UTC of the update time of the actual data.
timezone: The time zone offset from UTC of the location in the format of +/- hours and +/- minutes.
state: The state code of the requested location.
state_name: The name of the state of the requested location.
country: The country code of the requested location.
iso_cc: The ISO country code of the requested location.
country_name: The name of the country of the requested location.
local_time: The real-time local time of the location in the format of day of the week, day, month, year, hour, minute, second, and timezone.
localupdatetime: The time of the last update of the product in the format of day of the week, day, month, year, hour, minute, second, and timezone.
metric: A boolean that indicates whether the units of measurement of the data is in metric or not.
city_name: The name of the location for which the data is provided.
longitude: The longitude coordinate in decimal degrees of the requested location.
latitude: The latitude coordinate in decimal degrees of the requested location.
tzinfo: The IANA (Internet Assigned Numbers Authority) time zone database identifier of the location, this is a standard method of identifying different time zones.
elevation: The elevation of the location in meters or feet, depending on whether the metric unit is used or not.
name: The name of the weather product being requested.
station_id: The air quality station ID, a unique identifier for the location for which the air quality data is being provided.
forecast_id: The nearest CustomWeather location ID, a unique identifier for the location for which the weather forecast data is being provided.
air_station_name: The name of the air quality station for which the data is being provided.
The information in the table is useful because it provides a clear and detailed description of the data that is being provided by the CustomWeather air quality observations API. The table lists all the objects that are included in the API's data output and provides a brief description of each object. This information is useful for developers who are working with the API, as it allows them to understand the structure and format of the data that they are receiving. Additionally, it allows them to understand what each object represents, in terms of data, and how to use it to analyze the air quality data and build various applications. Knowing what data is included in the API, allows developers to make the best use of the data and to better understand how the data can be used.
Explaining the Output
This JSON output contains data about the air quality observations in a specific location. The JSON object starts with a report node that has multiple attributes such as gmt_date, unix_date, timezone, state, state_name, country, iso_cc, country_name, localtime, localupdatetime, metric, city_name, longitude, latitude, tzinfo, elevation, and name. All these attributes represent different characteristics of the location and the data such as date and time of the update, geographical location, units of measurement, name of the location, and the type of data provided.
Underneath the report node, there are multiple observation nodes, each one representing a different air quality station. Each observation node has multiple attributes such as station_id, forecast_id, air_station_name, state_code, concentration, and category. The station_id and forecast_id represent the unique identifiers for the air quality station and nearest CustomWeather location. The air_station_name attribute represents the name of the air quality station, state_code represents the state in which the air quality station is located, concentration represents the concentration of certain pollutants, and category is a letter code that represents the air quality level.
Overall, this JSON output provides a detailed and structured information about the air quality observations in a specific location. It includes information about the location's characteristics and properties, as well as the data of multiple air quality stations, it provides attributes such as station_id, forecast_id, air_station_name, state_code, concentration, and category which allow to identify the station, know where it is located, and have a sense of the air quality level.
<?xml version="1.0" encoding="UTF-8"?>
<report gmt_date="2309282017" unix_date="1506641402.000000" timezone="-6" state="IL" state_name="Illinois" country="US" iso_cc="US" country_name="United States" localtime="Fri, 29 Sep 2017 10:06:30 CDT" localupdatetime="Thu, 28 Sep 2017 18:30:02 CDT" metric="false" city_name="Chicago / Meigs" longitude="-87.59" latitude="41.86" tzinfo="America/Chicago" elevation="175.00" name="air_quality_obs" >
<observation station_id="170314002" forecast_id="14751" air_station_name="CIRERO" state_code="IL" concentration="41" category="G" />
<observation station_id="170310032" forecast_id="K63G" air_station_name="CHI-SWFP" state_code="IL" concentration="41" category="G" />
<observation station_id="170317002" forecast_id="K62G" air_station_name="EVANSTON" state_code="IL" concentration="45" category="G" />
<observation station_id="180892008" forecast_id="16050" air_station_name="HAMMOND" state_code="IN" concentration="41" category="G" />
</report>
Closing words
In summary, this article has provided an overview of the CustomWeather air quality observations API, specifically the object table and output. The object table is a structured representation of the data that can be easily read and understood by humans and can be easily imported into a database for further analysis. The table and JSON output provide detailed information about the data provided by the API, including information about the location, time of update, and data about multiple air quality stations, including unique identifiers, location, concentration, and air quality level. This information can be useful for developers working with the API, as it allows them to understand the structure and format of the data, and to make the best use of the data for analysis and building various applications.
Reference
The CustomWeather air quality observations API is a data service that provides information about the air quality in different locations. This data can be accessed and used by third-party applications, websites, and software through an API. One way to get access to the CustomWeather air quality observations API is by purchasing it via a third-party data marketplace, Worldindata.
Worldindata is a platform that offers access to a wide range of datasets, including those from the CustomWeather air quality observations API. The platform allows users to browse and purchase data sets through a simple and easy-to-use interface. By purchasing the CustomWeather air quality observations API through Worldindata, you will get a license that allows you to use the data, including access to the API endpoint, credentials to authenticate and request the data, and the documentation that describes how to use the API and interpret the data.
###