Skip to content

dannyfritz/ebird-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ebird-client

npm License Travis

This is a client to interact with the ebird 2.0 API.

Written in TypeScript to improve usage ergonomics.

Installation

$ npm install ebird-client

Example

Example in TypeScript.

import EbirdClient, { Detail } from "ebird-client";

const ebird = new EbirdClient(process.env.API_KEY!); //Get your API_KEY from eBird

const denver = {
  latitude: 39.742043,
  longitude: -104.991531,
};
ebird.recentNearbyNotableObservations({
  lat: denver.latitude,
  lng: denver.longitude,
  maxResults: 2,
})
  .then((data) => console.log(data));
[ { "speciesCode": "lbbgul",
    "comName": "Lesser Black-backed Gull",                    
    "sciName": "Larus fuscus",
    "locId": "L2141651",
    "locName": "Valmont Overlook (Legion Park)",              
    "obsDt": "2019-03-30 18:05",
    "howMany": 1,
    "lat": 40.016268,
    "lng": -105.1891619,
    "obsValid": false,
    "obsReviewed": false,
    "locationPrivate": false },
  { "speciesCode": "easpho",
    "comName": "Eastern Phoebe",
    "sciName": "Sayornis phoebe",                             
    "locId": "L271803",
    "locName": "Stalker Lake State Wildlife Area",            
    "obsDt": "2019-03-30 17:17",
    "howMany": 1,
    "lat": 40.0853843,
    "lng": -102.2761784,
    "obsValid": false,
    "obsReviewed": false,
    "locationPrivate": false } ]

Documentation

Refer to the ebird 2.0 API docs for usage.