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 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
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")
rebirdLoad 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.
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()
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>, …
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>, …
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>, …
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>, …
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>, …
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>, …
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
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>
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>, …
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 packagesrebirdThis 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. rebirdThose 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.
rebirdThe 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!
ebirdregion()ebirdnotable()ebirdregion()ebirdgeo()ebirdgeo()nearestobs()ebirdnotable()ebirdhistorical()ebirdchecklistfeed()ebirdregionspecies()ebirdchecklist()ebirdhotspotlist()ebirdhotspotlist()ebirdregioninfo()ebirdtaxonomy()ebirdtaxonomyversion()ebirdregioninfo()ebirdsubregionlist()rebird in R doing
citation(package = 'rebird')