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.
npm install --save iucn-red-listimport {
  Country,
  GrowthForms,
  Habitat,
  Measure,
  Region,
  Species,
  Threat,
} from 'iucn-red-list';Only import the modules you need. For example, if you only need the Country and Threat modules:
import {
  Country,
  Threat,
} from 'iucn-red-list';To set your API Key, set the environment variable RED_LIST_TOKEN. Alternatively, you can set the configuration manually:
import { setRedListToken } from 'iucn-red-list';
setRedListToken('<your-token>')To check what version of the IUCN Red List is driving the API:
import { redListVersion } from 'iucn-red-list';
redListVersion().then(data => console.log(data));Be sure to reference the Red List API docs
- Species.fetch()
- Species.count()
- Species.citation()
- Species.byCategory()
- Species.find()
- Species.narrative()
- Species.synonym()
- Species.commonNames()
- Species.countries()
- Species.historical()
Retrieves a list of countries
Country
  .all()
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of species by country
- country(required) - [String] ISO-code of the country for which you want the list of species
Country
  .species({ country: 'AZ' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of plant growth forms by species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region(optional) - [String] If provided, this option will return a regional assessment of the growth forms. Must be a valid region (see Region.all())
GrowthForms
  .fetch({ name: 'Quercus robur', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of habitats by species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region(optional) - [String] If provided, this option will return a regional assessment of the habitats. Must be a valid region (see Region.all())
Habitat
  .fetch({ name: 'Ursus maritimus', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of conservation measures by species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region(optional) - [String] If provided, this option will return a regional assessment of the measures. Must be a valid region (see Region.all())
Measure
  .fetch({ name: 'Ursus maritimus', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of regions
Region
  .all()
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of species in a paginated list of 10,000 species per page.
- page(required) - [Number] Page number to retrieve. First page is- 0
- 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
  .fetch({ page: 2, region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a count of species globally or by region.
- region- [String] Region to filter species count by. Must be a valid region (see Region.all())
Species
  .count({ region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a citation for a given species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species
  .citation({ name: 'Loxodonta Africana' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of species by category
- category(required) - [String] Valid categories are- DD,- LC,- NT,- VU,- EN,- CR,- EW,- EX,- LR/lc,- LR/nt,- LR/cd.
Species
  .category({ category: 'VU' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieve information about a specific species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species
  .find({ id: '22694927' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieve narrative information about a specific species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species
  .narrative({ name: 'Fratercula artica', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));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
- name(required) - [String] Name (or synonym) of species.
Species
  .synonym({ name: 'Loxodonta Africana' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieve list of common names in various languages for a species
- name(required) - [String] Name of species.
Species
  .commonNames({ name: 'Loxodonta Africana' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieve a list of countries of occurrence by species name
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species
  .narrative({ name: 'Ursus maritimus', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieve a list of historical assessments by species name (including the current listing)
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region- [String] If provided, this option will return a regional assessment of the species. Must be a valid region (see Region.all())
Species
  .narrative({ name: 'Ursus maritimus', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieve a direct link to the species page on the Red List website
- name(required) - [String] Name (or synonym) of species.
Species
  .link({ name: 'Loxodonta Africana' })
  .then(data => console.log(data))
  .catch(err => console.log(err));Retrieves a list of threats by species
- name(required) - [String] Name of species. If- nameis not provided,- idmust be provided
- id(required) - [String/Number] ID of species. If- idis not provided,- namemust be provided. If both- idand- nameare provided,- idwill take precedent and- namewill be ignored
- region(optional) - [String] If provided, this option will return a regional assessment of the threats. Must be a valid region (see Region.all())
Threat
  .fetch({ name: 'Fratercula arctica', region: 'europe' })
  .then(data => console.log(data))
  .catch(err => console.log(err));