Download iNaturalist images from GBIF using R

Hi, I am trying to download the images about 2,000 animal species from the iNaturalist Research Grade Observation dataset in GBIF. I am using this package called rgbif. I have prepared the GBIF taxonKey ready to run the occ_download(), but when I run the code with all the credentials, R returns this error:

Error: XXXX not allowed to create download with creator XXXX@gmail.com

I have no idea why this happened, could somebody give me a suggestion? [EDIT: Solved, see reply below]

Also, I would guess that using occ_download() will return a file with only the url of the images. So if I want to download the actual images, I will need to extract the url information and download them using another chunk of codes. Is this a good way to do it? Or is there an alternative way using the rgbif package?

Finally, this shouldn’t be a problem with downloading using the url. But in case a direct image download alternative is available: is it possible to limit the number of image download per given taxonKey? I would only need about 10 images for each species, but in my sample, some species may have 1 or 1,000 images available.

Many thanks and cheers!

I have successfully managed to login by following this solution:

so you were able to get the image links for the download? @Tuan

I was able to get the url of the occurence in the iNaturalist database. I also get the GBIF occurence ID which means with a bit of manipulation I can get the url to the occurence in the GBIF database.

But these are only occurence url, not the image url to download. The direct image url is not supported using these queries. They can still be found on the occurence url though.

I may need to download each image manually or employ a scraping method, neither of which are desirable options for me.

You need to download the full darwin core archive. Then if you look in the multimedia extension file the image links should be there. Then you can download each of the images from iNaturalist.

1 Like

Thanks for the suggestion! I will try that.

I’ve done it using the multimedia extension file from DarwinCore archives from GBIF before, this has the advantage of me having a DOI to reference in the future for the image/occurrence set.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.