Pearl-image-comparer / Pearl

MIT License
3 stars 0 forks source link

Setup: Examine laji.fi API use #9

Closed Noorae closed 3 weeks ago

Noorae commented 3 weeks ago

We were able to get different level of endangerment data on laji.fi api, using coordinates. The api can be used to fetch sightings of species, which we can use to display the data on a map using coordinates.

It is also possible to fetch data on the species, if necessary.

The endpoint to get species data as a list: /warehouse/query/unit/list There are multiple parameters that can be used with the queries.

To get species data with different level of endangerment and coordinates, these parameters are used:

wgs84CenterPoint for coordinates (please see more in the api documentation) redListStatusId for endangerment level pageSize access_token

example use in the Tampere area with coordinates (paste your API_KEY to use):

https://api.laji.fi/v0/warehouse/query/unit/list?wgs84CenterPoint=61.49329:61.49688:23.82171:23.83041:WGS84&redListStatusId=MX.iucnEN&pageSize=10&access_token=PLEASE_INSERT_YOUR_API_KEY_HERE

We also fetched the different redListStatusId's from metadata/ranges, that can be added to the query above.

"MX.iucnNE": "NE – Arvioimatta jätetyt",
"MX.iucnNA": "NA – Arviointiin soveltumattomat",
"MX.iucnDD": "DD – Puutteellisesti tunnetut",
"MX.iucnLC": "LC – Elinvoimaiset",
"MX.iucnNT": "NT – Silmälläpidettävät",
"MX.iucnVU": "VU – Vaarantuneet",
"MX.iucnEN": "EN – Erittäin uhanalaiset",
"MX.iucnCR": "CR – Äärimmäisen uhanalaiset",
"MX.iucnRE": "RE – Suomesta hävinneet",
"MX.iucnEW": "EW – Luonnosta hävinneet",
"MX.iucnEX": "EX – Sukupuuttoon kuolleet"