IUCN Red List
IUCN Red List API wrapper for Node.js
This project uses modern ES2016+ syntax, which means you can use promises (as shown in the documentation) or async/await.
Installation
npm install --save iucn-red-list
Usage
;
Only import the modules you need. For example, if you only need the Country
and Threat
modules:
;
To set your API Key, set the environment variable RED_LIST_TOKEN
. Alternatively, you can set the configuration manually:
;
Checking the Red List version
To check what version of the IUCN Red List is driving the API:
;;
Be sure to reference the Red List API docs
Country - Country information
Growth Forms - Plant growth form information
Habitat - Species habitat information
Measure - Species conservation measures information
Region - Region information
Species - Published species on the Red List
- Species.fetch()
- Species.count()
- Species.citation()
- Species.byCategory()
- Species.find()
- Species.narrative()
- Species.synonym()
- Species.commonNames()
- Species.countries()
- Species.historical()
Threat - Species threat information
Country.all()
Retrieves a list of countries
Country all ;
Country.species(options)
Retrieves a list of species by country
options
(required) - [Object]
country
(required) - [String] ISO-code of the country for which you want the list of species
Country ;
GrowthForm.fetch(options)
Retrieves a list of plant growth forms by species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
(optional) - [String] If provided, this option will return a regional assessment of the growth forms. Must be a valid region (see Region.all())
GrowthForms ;
Habitat.fetch(options)
Retrieves a list of habitats by species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
(optional) - [String] If provided, this option will return a regional assessment of the habitats. Must be a valid region (see Region.all())
Habitat ;
Measure.fetch(options)
Retrieves a list of conservation measures by species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
(optional) - [String] If provided, this option will return a regional assessment of the measures. Must be a valid region (see Region.all())
Measure ;
Region.all()
Retrieves a list of regions
Region all ;
Species.fetch(options)
Retrieves a list of species in a paginated list of 10,000 species per page.
options
(required) - [Object]
page
(required) - [Number] Page number to retrieve. First page is0
region
(optional) - [String] If provided, this option will return a regional assessment of the available species. Must be a valid region (see Region.all())
Species ;
Species.count(options)
Retrieves a count of species globally or by region.
options
(required) - [Object]
region
- [String] Region to filter species count by. Must be a valid region (see Region.all())
Species ;
Species.citation(options)
Retrieves a citation for a given species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species ;
Species.byCategory(options)
Retrieves a list of species by category
options
(required) - [Object]
category
(required) - [String] Valid categories areDD
,LC
,NT
,VU
,EN
,CR
,EW
,EX
,LR/lc
,LR/nt
,LR/cd
.
Species ;
Species.find(options)
Retrieve information about a specific species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species ;
Species.narrative(options)
Retrieve narrative information about a specific species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species ;
Species.synonym(options)
Retrieve information about synonyms via an accepted species name, or vice versa i.e. this call tells you if there are synonyms for the species name, or whether it's a synonym of an accepted name
options
(required) - [Object]
name
(required) - [String] Name (or synonym) of species.
Species ;
Species.commonNames(options)
Retrieve list of common names in various languages for a species
options
(required) - [Object]
name
(required) - [String] Name of species.
Species ;
Species.countries(options)
Retrieve a list of countries of occurrence by species name
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species ;
Species.historical(options)
Retrieve a list of historical assessments by species name (including the current listing)
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species ;
Species.synonym(options)
Retrieve a direct link to the species page on the Red List website
options
(required) - [Object]
name
(required) - [String] Name (or synonym) of species.
Species link name: 'Loxodonta Africana' ;
Threat.fetch(options)
Retrieves a list of threats by species
options
(required) - [Object]
name
(required) - [String] Name of species. Ifname
is not provided,id
must be providedid
(required) - [String/Number] ID of species. Ifid
is not provided,name
must be provided. If bothid
andname
are provided,id
will take precedent andname
will be ignoredregion
(optional) - [String] If provided, this option will return a regional assessment of the threats. Must be a valid region (see Region.all())
Threat ;