Paradigm

1、Get API Key by registering

(1) This platform offers data access through API. Since we have membership mechanism, you need to use and API Key to access our Open Data.

(2) After registering (https://data.epa.gov.tw/api_term) , this website will send you an email of membership API key.

(3) After login, you can also get your membership API key on the page "basic information".After login, you can also get your membership API key on the page basic information.


2、Access data through "API Documentation"

(1) Get API URL with "API Documentation"

...

Step 1:Click「Development Guide」>「API Documentation」Click API Documentation

Step 2:Click the dataset that you would like to access data, and then click "Try it out" Click Try it out larryryryry

Step 3:There are different parameters with each datasets. Take dataset below for example, there are three available API parameters, as shown below.
Fill in parameters and then click "Execute".3 available API parameters

Step 4:Then you can get API URL. API URL is shown as below:
https://data.epa.gov.tw/api/v1/RAIN_S_01?offset=0&limit=1000&api_key=your-api-key

(2) API Parameters
API URL format:
https://data.epa.gov.tw/api/v1/{DataID}?format={format}&year_month={yyyy_mm}&offset={offset}&limit={limit}&api_key={api-key}

{DataID} Identifier of data resource. You can get it in "API Documentation", shown as above figure in Step 4.
{limit} Number of data to access. Please fill in a number.
{offset} Number of data to skip. Please fill in a number.
{api_key} The authentication code to access data, you can get one by registering.
{sort} The field to sort data.
{format} Data format. Please fill in json, xml, or csv.
{yyyy_mm} Please fill in historical data time, such as 2020_01. Would get the latest data if not filled in.

(3) Download [Year_Month] wrapped data:
Download [Year_Month] wrapped data1. Download structural data with API argument "year_month"(a.k.a "yyyy_mm"):
https://data.epa.gov.tw/api/v1/aqx_p_185?format=json&limit=5&year_month=2019_03&api_key=f8146cb1-193c-4a9a-812a-9c84c9ef87b9

2. In the dataset page, click and download the icon of zipped file as shown above:
http://opendata2.epa.gov.tw/data/aqx_p_185/aqx_p_185_2019-03.zip



(4) Three export formats via API:
JSON, CSV and XML are supported.
Three API download formats
API CSV format
API XMLformat