R Client for the eBird Database of Bird Observations

A programmatic client for the eBird database (< https://ebird.org/home>), including functions for searching for bird observations by geographic location (latitude, longitude), eBird hotspots, location identifiers, by notable sightings, by region, and by taxonomic name.


rebird: wrapper to the eBird API

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. R-CMD-check Codecov testcoverage rstudio mirrordownloads cranversion

rebird is a package to interface with the eBird webservices.

eBird is a real-time, online bird checklist program. For more information, visit their website: https://ebird.org/home

The API for the eBird webservices can be accessed here: https://documenter.getpostman.com/view/664302/S1ENwy59?version=latest

Install

You can install the stable version from CRAN

install.packages("rebird")

Or the development version from Github

install.packages("devtools")
devtools::install_github("ropensci/rebird")

Direct use of rebird

Load the package:

library("rebird")

The eBird API server requires users to provide an API key, which is linked to your eBird user account. You can pass it to the ‘key’ argument in rebird functions, but we highly recommend storing it as an environment variable called EBIRD_KEY in your .Renviron file. If you don’t have a key, you can obtain one from https://ebird.org/api/keygen.

You can keep your .Renviron file in your global R home directory (R.home()), your user’s home directory (Sys.getenv("HOME")), or your current working directory (getwd()). Remember that .Renviron is loaded once when you start R, so if you add your API key to the file you will have to restart your R session. See ?Startup for more information on R’s startup files.

Furthermore, functions now use species codes, rather than scientific names, for species-specific requests. We’ve made the switch easy by providing the species_code function, which converts a scientific name to its species code:

species_code('sula variegata')
#> Peruvian Booby (Sula variegata): perboo1
#> [1] "perboo1"

The species_code function can be called within other rebird functions, or the species code can be specified directly.

eBird Taxonomy

The eBird taxonomy is internally stored in rebird and can be called using

rebird::tax
#> # A tibble: 18,631 × 15
#>    sciName   comName speciesCode
#>    <chr>     <chr>   <chr>      
#>  1 Struthio… Common… ostric2    
#>  2 Struthio… Somali… ostric3    
#>  3 Struthio… Common… y00934     
#>  4 Casuariu… Southe… soucas1    
#>  5 Casuariu… Dwarf … dwacas1    
#>  6 Casuariu… Northe… norcas1    
#>  7 Dromaius… Emu     emu1       
#>  8 Apteryx … Southe… sobkiw1    
#>  9 Apteryx … Southe… sobkiw2    
#> 10 Apteryx … Southe… sobkiw3    
#> # ℹ 18,621 more rows
#> # ℹ 12 more variables:
#> #   category <chr>,
#> #   taxonOrder <dbl>,
#> #   bandingCodes <chr>,
#> #   comNameCodes <chr>,
#> #   sciNameCodes <chr>, …

While the internal taxonomy is kept up to date with each package (current version is 2026), it could be outdated if a new taxonomy is made available before the package is updated. You can obtain the latest eBird taxonomy by running

new_tax <- ebirdtaxonomy()

Sightings at location determined by latitude/longitude

Search for bird occurrences by latitude and longitude point

ebirdgeo(species = species_code('spinus tristis'), lat = 42, lng = -76)
#> American Goldfinch (Spinus tristis): amegfi
#> # A tibble: 35 × 13
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 amegfi      American… Spinus…
#>  2 amegfi      American… Spinus…
#>  3 amegfi      American… Spinus…
#>  4 amegfi      American… Spinus…
#>  5 amegfi      American… Spinus…
#>  6 amegfi      American… Spinus…
#>  7 amegfi      American… Spinus…
#>  8 amegfi      American… Spinus…
#>  9 amegfi      American… Spinus…
#> 10 amegfi      American… Spinus…
#> # ℹ 25 more rows
#> # ℹ 10 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>, …

Recent observations at a region

Search for bird occurrences by region and species name

ebirdregion(loc = 'US', species = 'btbwar')
#> # A tibble: 32 × 13
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 btbwar      Black-th… Setoph…
#>  2 btbwar      Black-th… Setoph…
#>  3 btbwar      Black-th… Setoph…
#>  4 btbwar      Black-th… Setoph…
#>  5 btbwar      Black-th… Setoph…
#>  6 btbwar      Black-th… Setoph…
#>  7 btbwar      Black-th… Setoph…
#>  8 btbwar      Black-th… Setoph…
#>  9 btbwar      Black-th… Setoph…
#> 10 btbwar      Black-th… Setoph…
#> # ℹ 22 more rows
#> # ℹ 10 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>, …

Recent observations at hotspots

Search for bird occurrences by a given hotspot

ebirdregion(loc = 'L99381')
#> # A tibble: 71 × 14
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 cangoo      Canada G… Branta…
#>  2 mallar3     Mallard   Anas p…
#>  3 redhea      Redhead   Aythya…
#>  4 rinduc      Ring-nec… Aythya…
#>  5 gresca      Greater … Aythya…
#>  6 lessca      Lesser S… Aythya…
#>  7 buffle      Bufflehe… Buceph…
#>  8 commer      Common M… Mergus…
#>  9 y00475      American… Fulica…
#> 10 ribgul      Ring-bil… Larus …
#> # ℹ 61 more rows
#> # ℹ 11 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>, …

Nearest observations of a species

Search for a species’ occurrences near a given latitude and longitude

nearestobs(species_code('branta canadensis'), 42, -76)
#> Canada Goose (Branta canadensis): cangoo
#> # A tibble: 22 × 13
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 cangoo      Canada G… Branta…
#>  2 cangoo      Canada G… Branta…
#>  3 cangoo      Canada G… Branta…
#>  4 cangoo      Canada G… Branta…
#>  5 cangoo      Canada G… Branta…
#>  6 cangoo      Canada G… Branta…
#>  7 cangoo      Canada G… Branta…
#>  8 cangoo      Canada G… Branta…
#>  9 cangoo      Canada G… Branta…
#> 10 cangoo      Canada G… Branta…
#> # ℹ 12 more rows
#> # ℹ 10 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>, …

Recent notable sightings

Search for notable sightings at a given latitude and longitude

ebirdnotable(lat = 42, lng = -70)
#> # A tibble: 2,732 × 14
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 bkhgul      Black-he… Chroic…
#>  2 bkhgul      Black-he… Chroic…
#>  3 shshaw      Sharp-sh… Accipi…
#>  4 truswa      Trumpete… Cygnus…
#>  5 greegr      Great Eg… Ardea …
#>  6 moublu      Mountain… Sialia…
#>  7 greegr      Great Eg… Ardea …
#>  8 vesspa      Vesper S… Pooece…
#>  9 vesspa      Vesper S… Pooece…
#> 10 rehwoo      Red-head… Melane…
#> # ℹ 2,722 more rows
#> # ℹ 11 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, lat <dbl>,
#> #   lng <dbl>, obsValid <lgl>,
#> #   obsReviewed <lgl>,
#> #   locationPrivate <lgl>, …

or a region

ebirdnotable(locID = 'US-NY-109')
#> # A tibble: 17 × 13
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 rehwoo      Red-head… Melane…
#>  2 x01134      American… Larus …
#>  3 fiespa      Field Sp… Spizel…
#>  4 x01134      American… Larus …
#>  5 x01134      American… Larus …
#>  6 redcro      Red Cros… Loxia …
#>  7 easpho      Eastern … Sayorn…
#>  8 easpho      Eastern … Sayorn…
#>  9 x01134      American… Larus …
#> 10 x01134      American… Larus …
#> 11 fiespa      Field Sp… Spizel…
#> 12 comyel      Common Y… Geothl…
#> 13 chispa      Chipping… Spizel…
#> 14 chispa      Chipping… Spizel…
#> 15 x01134      American… Larus …
#> 16 redcro      Red Cros… Loxia …
#> 17 chispa      Chipping… Spizel…
#> # ℹ 10 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>,
#> #   locationPrivate <lgl>, …

Historic Observations

Obtain a list of species reported on a specific date in a given region

ebirdhistorical(loc = 'US-VA-003', date = '2019-02-14',max = 10)
#> # A tibble: 10 × 13
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 cangoo      Canada G… Branta…
#>  2 mallar3     Mallard   Anas p…
#>  3 gnwtea      Green-wi… Anas c…
#>  4 killde      Killdeer  Charad…
#>  5 baleag      Bald Eag… Haliae…
#>  6 belkin1     Belted K… Megace…
#>  7 carwre      Carolina… Thryot…
#>  8 whtspa      White-th… Zonotr…
#>  9 norcar      Northern… Cardin…
#> 10 canvas      Canvasba… Aythya…
#> # ℹ 10 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>,
#> #   locationPrivate <lgl>, …

or a hotspot

ebirdhistorical(loc = 'L196159', date = '2019-02-14', fieldSet = 'full')
#> # A tibble: 14 × 27
#>    speciesCode comName   sciName
#>    <chr>       <chr>     <chr>  
#>  1 annhum      Anna's H… Calypt…
#>  2 ribgul      Ring-bil… Larus …
#>  3 glwgul      Glaucous… Larus …
#>  4 amecro      American… Corvus…
#>  5 bkcchi      Black-ca… Poecil…
#>  6 bushti      Bushtit   Psaltr…
#>  7 pacwre1     Pacific … Nannus…
#>  8 houfin      House Fi… Haemor…
#>  9 purfin      Purple F… Haemor…
#> 10 amegfi      American… Spinus…
#> 11 daejun      Dark-eye… Junco …
#> 12 sonspa      Song Spa… Melosp…
#> 13 spotow      Spotted … Pipilo…
#> 14 rewbla      Red-wing… Agelai…
#> # ℹ 24 more variables:
#> #   locId <chr>, locName <chr>,
#> #   obsDt <chr>, howMany <int>,
#> #   lat <dbl>, lng <dbl>,
#> #   obsValid <lgl>,
#> #   obsReviewed <lgl>,
#> #   locationPrivate <lgl>, …

Information on a given region or hotspot

Obtain detailed information on any valid eBird region

ebirdregioninfo("CA-BC-GV")
#> # A tibble: 1 × 5
#>   region  minX  maxX  minY  maxY
#>   <chr>  <dbl> <dbl> <dbl> <dbl>
#> 1 Metro… -123. -122.  49.0  49.6

or hotspot

ebirdregioninfo("L196159")
#> # A tibble: 1 × 16
#>   locId name  latitude longitude
#>   <chr> <chr>    <dbl>     <dbl>
#> 1 L196… Vanc…     49.3     -123.
#> # ℹ 12 more variables:
#> #   countryCode <chr>,
#> #   countryName <chr>,
#> #   subnational1Name <chr>,
#> #   subnational1Code <chr>,
#> #   subnational2Code <chr>,
#> #   subnational2Name <chr>, …

Obtain a list of eBird species codes for all species recorded in a region

ebirdregionspecies("GB-ENG-LND")
#> # A tibble: 406 × 1
#>    speciesCode
#>    <chr>      
#>  1 wfwduc1    
#>  2 fuwduc     
#>  3 bahgoo     
#>  4 empgoo     
#>  5 snogoo     
#>  6 rosgoo     
#>  7 gragoo     
#>  8 swagoo1    
#>  9 x00776     
#> 10 gwfgoo     
#> # ℹ 396 more rows

or a hotspot

ebirdregionspecies("L5803024")
#> # A tibble: 192 × 1
#>    speciesCode
#>    <chr>      
#>  1 gragoo     
#>  2 gwfgoo     
#>  3 tunbeg1    
#>  4 pifgoo     
#>  5 bargoo     
#>  6 cangoo     
#>  7 x00758     
#>  8 mutswa     
#>  9 tunswa     
#> 10 whoswa     
#> # ℹ 182 more rows

Obtain a list of all subregions within an eBird region

ebirdsubregionlist("subnational1","US")
#> # A tibble: 51 × 2
#>    code  name                
#>    <chr> <chr>               
#>  1 US-AL Alabama             
#>  2 US-AK Alaska              
#>  3 US-AZ Arizona             
#>  4 US-AR Arkansas            
#>  5 US-CA California          
#>  6 US-CO Colorado            
#>  7 US-CT Connecticut         
#>  8 US-DE Delaware            
#>  9 US-DC District of Columbia
#> 10 US-FL Florida             
#> # ℹ 41 more rows

Checklist Feed

Obtain a list of checklists submitted on a given date at a region or hotspot

ebirdchecklistfeed(loc = "L207391", date = "2020-03-24", max = 5)
#> # A tibble: 5 × 9
#>   locId   subId  userDisplayName
#>   <chr>   <chr>  <chr>          
#> 1 L207391 S6617… David Wood     
#> 2 L207391 S6617… Sofia Prado-Ir…
#> 3 L207391 S6619… Jeffrey Gantz  
#> 4 L207391 S6617… Ann Gurka      
#> 5 L207391 S7098… Barbara Olson  
#> # ℹ 6 more variables:
#> #   numSpecies <int>,
#> #   obsDt <chr>, obsTime <chr>,
#> #   isoObsDate <chr>,
#> #   subID <chr>, loc <chr>

View Checklist

Obtain all information on a specific checklist

ebirdchecklist("S139153079")
#> # A tibble: 99 × 25
#>    subId      protocolId locId
#>    <chr>      <chr>      <chr>
#>  1 S139153079 P22        L17  
#>  2 S139153079 P22        L17  
#>  3 S139153079 P22        L17  
#>  4 S139153079 P22        L17  
#>  5 S139153079 P22        L17  
#>  6 S139153079 P22        L17  
#>  7 S139153079 P22        L17  
#>  8 S139153079 P22        L17  
#>  9 S139153079 P22        L17  
#> 10 S139153079 P22        L17  
#> # ℹ 89 more rows
#> # ℹ 22 more variables:
#> #   groupId <chr>,
#> #   durationHrs <dbl>,
#> #   allObsReported <lgl>,
#> #   subComments <chr>,
#> #   creationDt <chr>, …

Hotspots in a region or nearby coordinates

Obtain a list of hotspots within a region

ebirdhotspotlist("CA-NS-HL")
#> # A tibble: 313 × 10
#>    locId     locName countryCode
#>    <chr>     <chr>   <chr>      
#>  1 L2334369  Abraha… CA         
#>  2 L7003818  Admira… CA         
#>  3 L1765807  Admira… CA         
#>  4 L12227034 Armdal… CA         
#>  5 L12690538 Armdal… CA         
#>  6 L2390509  Bald R… CA         
#>  7 L7598385  Bayers… CA         
#>  8 L11019120 Beaver… CA         
#>  9 L1872934  Bedfor… CA         
#> 10 L12134597 Bedfor… CA         
#> # ℹ 303 more rows
#> # ℹ 7 more variables:
#> #   subnational1Code <chr>,
#> #   subnational2Code <chr>,
#> #   lat <dbl>, lng <dbl>,
#> #   latestObsDt <chr>,
#> #   numSpeciesAllTime <int>, …

or within a radius of up to 50 kilometers, from a given set of coordinates.

ebirdhotspotlist(lat = 30, lng = -90, dist = 10)
#> No region code provided, locating hotspots using lat/lng
#> # A tibble: 56 × 10
#>    locId     locName countryCode
#>    <chr>     <chr>   <chr>      
#>  1 L6025517  Algier… US         
#>  2 L3886471  Armstr… US         
#>  3 L727179   Audubo… US         
#>  4 L6665071  BAEA N… US         
#>  5 L6666949  BAEA N… US         
#>  6 L50491229 Bayou … US         
#>  7 L2423926  Bayou … US         
#>  8 L725034   Bayou … US         
#>  9 L37730406 Bayou … US         
#> 10 L727232   Chalme… US         
#> # ℹ 46 more rows
#> # ℹ 7 more variables:
#> #   subnational1Code <chr>,
#> #   subnational2Code <chr>,
#> #   lat <dbl>, lng <dbl>,
#> #   latestObsDt <chr>,
#> #   numSpeciesAllTime <int>, …

rebird and other packages

How to use rebird

This package is part of a richer suite called spocc - Species Occurrence Data, along with several other packages, that provide access to occurrence records from multiple databases. We recommend using spocc as the primary R interface to rebird unless your needs are limited to this single source.

auk vs. rebird

Those interested in eBird data may also want to consider auk, an R package that helps extracting and processing the whole eBird dataset. The functions in rebird are faster but mostly limited to accessing recent (i.e. within the last 30 days) observations, although ebirdfreq() does provide historical frequency of observation data. In contrast, auk gives access to the full set of ~ 500 million eBird observations. For most ecological applications, users will require auk; however, for some use cases, e.g. building tools for birders, rebird provides a quicker and easier way to access data. rebird and auk are both part of the rOpenSci project.

API requests covered by rebird

The 2.0 APIs have considerably been expanded from the previous version, and rebird only covers some of them. The webservices covered are listed below; if you’d like to contribute wrappers to APIs not yet covered by this package, feel free to submit a pull request!

data/obs

  • [x] Recent observations in a region: ebirdregion()
  • [x] Recent notable observations in a region: ebirdnotable()
  • [x] Recent observations of a species in a region: ebirdregion()
  • [x] Recent nearby observations: ebirdgeo()
  • [x] Recent nearby observations of a species: ebirdgeo()
  • [x] Nearest observations of a species: nearestobs()
  • [x] Recent nearby notable observations: ebirdnotable()
  • [ ] Recent checklists feed
  • [x] Historic observations on a date: ebirdhistorical()

product

  • [ ] Top 100
  • [x] Checklist feed on a date: ebirdchecklistfeed()
  • [ ] Regional statistics on a date
  • [x] Species list for a region: ebirdregionspecies()
  • [x] View Checklist: ebirdchecklist()

ref/geo

  • [ ] Adjacent Regions

ref/hotspot

  • [x] Hotspots in a region: ebirdhotspotlist()
  • [x] Nearby hotspots: ebirdhotspotlist()
  • [x] Hotspot Info: ebirdregioninfo()

ref/taxonomy

  • [x] eBird Taxonomy: ebirdtaxonomy()
  • [ ] Taxonomic Forms
  • [x] Taxonomy Versions: ebirdtaxonomyversion()
  • [ ] Taxonomic Groups

ref/region

  • [x] Region Info: ebirdregioninfo()
  • [x] Sub Region List: ebirdsubregionlist()

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for rebird in R doing citation(package = 'rebird')
  • Please note that the ‘rebird’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ropensci_footer

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rebird")

1.4.0 by Sebastian Pardo, a day ago


https://docs.ropensci.org/rebird/, https://github.com/ropensci/rebird


Report a bug at https://github.com/ropensci/rebird/issues


Browse source code at https://github.com/cran/rebird


Authors: Rafael Maia [aut] , Scott Chamberlain [aut] (ORCID: , Andy Teucher [aut] , Guy Babineau [ctb] , Marianna Foos [ctb] , David Bradnum [ctb] , Dave Slager [ctb] , Richard Littauer [ctb] , Sebastian Pardo [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports methods, utils, stats, httr, jsonlite, dplyr, assertthat

Suggests knitr, rmarkdown, testthat, covr, vcr, withr


Imported by spocc.


See at CRAN