Skip to content

Taiwan Environmental Protection Administration

Gabriel Fosse edited this page Jan 24, 2024 · 26 revisions

Overview

The Taiwan Environmental Protection Administration (EPA) maintains a site showing real time ambient air monitoring data from municipal and non-municipal monitoring sites in Taiwan. While the site maintains an API (swagger docs), signing up for an API key may require a Taiwan national ID number, and requesting the API key has not been successful.

https://airtw.moenv.gov.tw/ Screenshot 2022-12-14 at 5 17 05 PM

Accessing data

As of November 2023, there are 85 active stations reporting air quality and other meteorological data (station map).

Currently, data can be obtained by requesting the measurements for each station using the station ID in the following format:
https://airtw.moenv.gov.tw/json/airlist/airlist_{station_id}_{yyyyMMddHH}.json

We can then join that measurement object to the appropriate station object from the stations endpoint to get the station name and location information. All of the stations with their coordinates can be found here:
https://airtw.moenv.gov.tw/gis_ajax.aspx?Type=GetAQInfo&Layer=EPA&QueryTime=yyyy/MM/DD%20hh:mm:ss

Data Endpoint Discovery and Usage

The above endpoints were identified through an analysis of network traffic and API calls made by the Taiwan EPA’s web interface. These endpoints are used internally by the website to fetch real-time air quality measurements and station information, respectively.

URL Construction

The URL for data fetching requires both the station ID and a timestamp in the ‘yyyyMMddHH’ format, using this timestamp to request the latest data. The station ID corresponds to one of the 85 active monitoring stations.

Joining Data

To combine the measurements and the station data, a 2 step process is used: Fetch the measurements for a given station ID and timestamp. Fetch the station details and join this with the measurement using the station ID. Example data:

// measurement
'136': {
    date: '2024/01/17 00:00',
    county: '彰化縣',
    sitename: '大城',
    sitetype: '其它站',
    AQI: '38',
    AVPM25: '7.4',
    PM25_FIX: '5',
    AVPM10: '29',
    PM10_FIX: '28',
    AVO3: '41',
    O3_FIX: '31.4',
    AVCO: '0.10',
    CO_FIX: '0.19',
    SO2_FIX: '0.3',
    NO2_FIX: '4.5',
    POLLUTANT: '',
    AVSO2: '0'
  }
// station
  {
    SiteID: '136',
    SiteName: '大城',
    AQI: '79',
    ViewName: '大城',
    AreaName: '中部空品區',
    AreaID: '3',
    COUNTY_Eng: 'Changhua',
    POLLUTANT: '細懸浮微粒',
    SiteAddres: '彰化縣大城鄉西厝路98號',
    TWD97_Lon: 120.26964167,
    TWD97_Lat: 23.85493056,
    SiteType: '其它站',
    SiteType2: '中央政府',
    siteowner: ''
  }
// combined
'136': {
    date: '2024/01/17 00:00',
    county: '彰化縣',
    sitename: '大城',
    sitetype: '其它站',
    AQI: '79',
    AVPM25: '7.4',
    PM25_FIX: '5',
    AVPM10: '29',
    PM10_FIX: '28',
    AVO3: '41',
    O3_FIX: '31.4',
    AVCO: '0.10',
    CO_FIX: '0.19',
    SO2_FIX: '0.3',
    NO2_FIX: '4.5',
    POLLUTANT: '細懸浮微粒',
    AVSO2: '0',
    SiteID: '136',
    SiteName: '大城',
    ViewName: '大城',
    AreaName: '中部空品區',
    AreaID: '3',
    COUNTY_Eng: 'Changhua',
    SiteAddres: '彰化縣大城鄉西厝路98號',
    TWD97_Lon: 120.26964167,
    TWD97_Lat: 23.85493056,
    SiteType: '其它站',
    SiteType2: '中央政府',
    siteowner: ''
  }

Resolution

  • Data frequency: hourly / daily
    • API provides hourly and daily values (not currently used)
    • Internal API calls provide hourly real-time data (currently used)
  • Historical data access: 1 year
    • Via API
  • Time recording: end of hour (time-ending) - Inferred by seeing data reported shortly after the turn of the hour

Pollutants and Meteorological Parameters

Pollutants

Description Key Unit
Nitrous Oxides NOx ppb
Particulate Matter ≤ 10 μm PM10 μg/m³
Total Hydrocarbons THC ppm
Carbon Monoxide CO ppm
Methane CH4 ppm
Sulfur Dioxide SO2 ppb
Particulate Matter ≤ 2.5 μm PM2.5 μg/m³
Nitrogen Dioxide NO2 ppb
Non-Methane Hydrocarbons NMHC ppm
Nitric Oxide NO ppb
Ozone O3 ppb

Meteorological Parameters

Description Key Unit
Rainfall RAINFALL mm
Relative Humidity RH %
Ambient Temperature AMB_TEMP
Wind Speed WIND_SPEED m/sec
Wind Direction WIND_DIREC degrees
Wind Direction (Hourly) WD_HR degrees
Atmospheric Pressure PRESSURE hPa
Wind Speed (Hourly) WS_HR m/sec
Rain Intensity RAIN_INT mm

URL Reference

The official API is not being utilized currently as we were unable to obtain an API key. These URLs are not currently utilized but may become useful if an API key is obtained, in which case our current fetch adapter would likely become deprecated.

API DATA These two API endpoints make available data from municipal or non-municipal stations. Both sets would need to be accessed to get the full dataset. API key needed

License

There are a few licenses mentioned on the site:
https://data.gov.tw/licenses

  • CC BY 4.0
  • CC BY 4.0-SA
  • CC0
  • OFL (Open font license)

https://data.gov.tw/license

  • OGL (Open Government Data License)

However, the Ministry of Environment specifically mentions the OGL here: https://data.moenv.gov.tw/en/data-regulations

Other considerations

We should continue to reach out in hopes of obtaining an API key from the Taiwan Environmental Protection Administration