The International Union for Conservation of Nature (IUCN) provides an API to access data from Red List of Threatened Species. This function checks whether data can be accessed from the API. Please note that a token is required to access the API (see below for instructions to obtain a token).
Accessing the IUCN Red List API
You will need to obtain a token for the
IUCN Red List API (if you do not have one
already). To achieve this, please visit the IUCN API website
(https://apiv3.iucnredlist.org/), click the "Generate a token" link at the
top of the web page, and fill out the form to apply for a token.
You should then receive a token shortly after completing
the form (but not immediately). After receiving a token, please open the
.Renviron
file on your computer (e.g., using usethis::edit_r_environ()
).
Next, please add the following text to the file (replacing the string with
the token) and save the file:
="your_actual_token_not_this_string" IUCN_REDLIST_KEY
Please restart your R session. You should now be able to access the IUCN Red
List API. To verify this, please try running the following R code and –
assuming everything works correctly – you should see TRUE
as the output:
# verify access to IUCN Red List API
is_iucn_rl_available()
If these instructions did not work, please consult the documentation for the rredlist package for further details.