3  Get data from IUCN

3.1 Registering to use the API

Before using this package, you’ll first need to create an account on the IUCN website to authorize your queries and download. This will also allow you to store a query history and manage your data downloads, including citations.

The IUCN API access requires that you make a formal request to the IUCN Red List team. If you need to access the IUCN data, go to the IUCN API website, register, and follow the instructions to get your personal key.

To store your IUCN key information in your .Renviron file, you can use the following code:

install.packages("usethis")
usethis::edit_r_environ()

Then, edit your .Renviron file to include your IUCN API key:

IUCN_REDLIST_KEY='youractualkeynotthisstring'

3.2 Downloading data

All data retrieved from IUCN need to be cited properly. You can use the function rl_citation() from the package rredlist to get the most recent citation of IUCN data.

To download the range maps, go to the IUCN Red List spatial data downloads page. There you will find the range maps for each vertebrate group and subgroups, such as mammals, birds, amphibians, and reptiles, marine or terrestrial, etc.

To get threat data from the IUCN Red List, you can use the rredlist package. This package allows you to search for species information, get species assessments, and download data from the IUCN Red List.

install.packages("rredlist")
library(rredlist)

To get threat information about a species, you can use the function rl_search. This function allows you to search for species information in the IUCN Red List. You can specify the species name, country, and other parameters to filter the data you want to retrieve.

For example, to search for the threat information of the species Ursus arctos (Brown Bear), you can use the following code:

# Search for threat information of Ursus arctos

rl_threats(name = "Ursus arctos", key = Sys.getenv("IUCN_REDLIST_KEY"))

To learn more and see how to retrieve other information from IUCN, you can check the documentation of the rredlist package here.

Back to top