A warbleR user asks if “there is any method for downloading from xeno canto a SINGLE individual of each species in Costa Rica”.
This can be done by 1) downloading the metadata of all recordings in a given site (in this case Costa Rica) using the
querxc function from the package warbleR (which searches and downloads recordings from Xeno-Canto), 2) filtering the metadata to have only one recording per species, and 3) input the filtered metadata back into
querxcto download the selected recordings.
then search for all recordings in Costa Rica setting the download argument to
FALSE to obtain only the metadata. Note that the search term follows the xeno-canto advanced query syntax. This syntax uses tags to search within a particular aspect of the recordings (e.g. country, location, sound type). Tags are of the form tag:searchterm’. See http://www.xeno-canto.org/help/search for a full description. (Note that in
querxc you can also search for species names or families without using any tags)
This query returned more than 38000 recordings from ~518 species (at the time I am writing this post)
Now filter the metadata. First split the data in ‘songs’ and ‘other sounds’ (possibly calls) and then select a single recording for each species. Sort the metadata by recording quality before filtering so the best quality recordings are found higher up in the list (which ensures that selected recordings are the highest quality recordings for each species)
We ended up with songs from 379 species and no-songs from 420 species
To download the files just input the filtered metadata back into
querxc (this will probably take several minutes!)
I would rather download no-songs only for those species that have no song in Xeno-Canto. To do this simply remove the species with songs from the ‘no-song’ data