I am trying to access an API of all Fungi observations and display the medium_urls as images for each Fungus. However, although the API link returns > 400 records and medium_urls under each Fungus taxon, I can only display 30 through my GET requests. I tried setting the limit of the page in my code to 300 or another number without luck. How can I resolve this?
Welcome to the forum!
There are almost 8 million verifiable Fungus observations, you need the medium_url for every observation/image?
That’s considerably larger than the API was intended to support.
You can use the page parameter to get more pages of results (e.g., page=2&per_page=200). See the Pagination section in the guide jwidness linked for more info.
If you want to get that many photos, though, you may want to get them from the iNaturalist Open Dataset instead.
Thanks so much for the response! I won’t need all 8 million but I would like to access at least a couple of hundred pictures from the medium_url links in the API link (10k would be brilliant too). I thought I resolved it by using page & per_page parameters via https://api.inaturalist.org/v1/observations?place_id=any&iconic_taxa=Fungi&page=3&per_page=200 but after formatting the content on the page, I realised I was getting duplicates or more of each Fungus, so the real number did not actually decrease to 200 different observations. Is there another way of doing this successfully by changing the page & per_page parameters?
I would otherwise look into the bulk observation request method and read up on it - however, if I can easily change this via this method, that would be good to know!
You’re getting duplicate observations or duplicates of the same species? This search returns individual observations, so if there are multiple observations of the same species, you will get the same species multiple times.
Right, apologies. I thought the above API was linking only 1 observation for each Fungus! Either way, changing the page & per_page parameters, does not give more than 200 results (including duplicates / more). Is there any way at all to use your online API and get a list of each Fungi species (>200 records) with its according data - that does not list multiple of the same observations?
Hey, thank you so much for your previous reply, that was a massive help. I noticed that https://api.inaturalist.org/v1/taxa/${id}, according to the API documentation, does not result in a single result of a single Fungus species either (avoiding multiple observations). Using(https://api.inaturalist.org/v1/taxa/150608152 e.g., I get an empty JSON array. I also tried to attach the id to the previous URL without luck. Any chance you can advise on that one too? Thanks again!
That is the observation number, not the taxon number. But if you go to that observation and click on the name at the top left corner, that will take you to the taxon page, and the url there will show you the taxon number.