update client api according to Maurice's doc
I’ve altered the URI to https://air-tst.epa.ie/api/v1/aq_measurements - if that’s a problem just let me know and I’ll remove the ‘/api/v1’.
There is a JSON description of the API https://air-tst.epa.ie/api-docs. If you have Swagger UI installed you can paste that into the explore box. We plan to install Swagger UI this week hopefully so we can serve the documentation. The JSON endpoint doesn’t have the parameterised queries added yet – again, hopefully this week.
I’ll just list out the available queries here for now:
There are two options for query syntax:
- ?where=parameter==value or
- ?where={"parameter":"value"} o Note the curly braces o Note that the quotes must be excluded for number values (i.e. ?where{"parameter":value}) o Multiple queries can be passed, comma separated, i.e.:
- ?where={"parameter1":"textvalue1", "parameter2":"textvalue2", "parameter3":numbervalue1}
(Note: the parameters are case sensitive)
Examples:
https://air-tst.epa.ie/api/v1/aq_measurements?where=rawreadingid==3918
https://air-tst.epa.ie/api/v1/aq_measurements?where=measurementunit==ppm
https://air-tst.epa.ie/api/v1/aq_measurements?where=measurementtype==Pollutant
https://air-tst.epa.ie/api/v1/aq_measurements?where=pollutantname==CO
https://air-tst.epa.ie/api/v1/aq_measurements?where={"samplingpoint":"Trailer 1"}
https://air-tst.epa.ie/api/v1/aq_measurements?where={"rawdatavalue":7.206}
https://air-tst.epa.ie/api/v1/aq_measurements?where={"pollutantname":"AD25", "rawdatavalue":7.206}
https://air-tst.epa.ie/api/v1/aq_measurements?where={"raw_reading_measurement_time":"Thu, 30 Aug 2012 22:00:00 GMT"}
Please let me know if you have any other questions.
Thanks, Maurice