openaq / openaq-fetch

A tool to collect data for OpenAQ platform.
MIT License
85 stars 39 forks source link

Update Taiwan adapter #763

Open sruti opened 4 years ago

sruti commented 4 years ago

The Taiwanese API has been changed so the URL needs to be changed in the source file and the adapter updated. The differences are pretty minimal, so it shouldn't be too much work.

New URL: https://data.epa.gov.tw/api/v1/aqx_p_432?format=json&api_key=[API_Key] API documentation: https://data.epa.gov.tw/en/dataset/aqx_p_432/resource/8ff027dc-2da2-42e8-85de-78ac3faf470e (Google translate/Chrome's translation feature is very helpful)

I already registered and have an API key, let me know if you work on this and I can send it you!

The old site will be phased out soon, so the sooner someone can work on this, the better!

CRTao commented 3 years ago

As being a Taiwanese, I would like to give it a try. 🙋‍♂️🙋‍♂️

yasamnoya commented 3 years ago

Hi, is somebody working on this? If not, I'd like to pick it up as my first PR. Thanks!

majesticio commented 1 year ago

Hello Sruti, I am Gabriel the new developer for OpenAQ. I don't know if you still have the API key for Taiwan stashed away, but I am trying to get this issue taken care of. Any help is appreciated!

majesticio commented 1 year ago

new site details: all stations needs query time to stay up to date data needs airlist${station#}${date&time}

Looks like we can retool the adapter w/o the need for an API key.

russbiggs commented 1 year ago

The way those two endpoints are arranged presents a technical challenge however. Based on the terms of use here:

https://data.epa.gov.tw/en/api-term

`

  1. RESTful API services (including website search) are only available 300 times per day for a single API. `

With 86 locations in the station list reporting hourly data this requires 2064 API call to get a days worth of data.

The design of the endpoitns seems odd and isnt really built as an API but more like file endpoints, so it doesn't seem to have as powerful of query capabilities.

majesticio commented 1 year ago

Good find. Looks like we will have to use the api key with the swagger docs.

majesticio commented 1 year ago

New source has everything needed but differs enough from the original adapter that it probably merits being written from scratch. Looks like we can pull all the hourly data - daily, with the API + API Key. Refer to the Taiwan source wiki