Returns matching taxa from iNaturalist, useful for finding the taxon ID to pass to inat_fetch().

inat_search_taxon(name, rank = NULL, n = 10)

Arguments

name

Character. Taxon name to search (common or scientific).

rank

Character or NULL. Filter results by taxonomic rank, e.g. "genus", "species", "family". Default NULL returns all ranks.

n

Integer. Maximum number of results to return (default 10).

Value

A data frame with columns id, name, common_name, rank, and observations_count, ordered by number of observations.

Note

The common_name field reflects iNaturalist's preferred_common_name, which is typically in English but may vary depending on the taxon and iNaturalist's locale settings.

Examples

if (FALSE) { # \dontrun{
inat_search_taxon("Drosera rotundifolia")
inat_search_taxon("Drosera", rank = "genus")
inat_search_taxon("sundew", rank = "species")
} # }