This project retrieves data from the eBird API using Python. It fetches species codes for all recorded observations in Pennsylvania (PA) and retrieves all recent observations in PA. The retrieved data is saved in CSV format for further analysis and processing. I haven't yet decided what I'd like to do with this information, but I'm just glad that I have it.
- Python 3.x
- Requests library
- pandas library
- dotenv library
-
Clone the repository:
git clone https://github.com/nicole440/dryocopus-pileatus.git
-
Install the required dependencies using pip:
pip install requests
-
Set up the API key:
-
Obtain an API key from the eBird website.
-
Create a .env file in the project root directory.
-
Add the following line to the .env file:
EBIRD_API_KEY=your-api-key
Replace your-api-key with your actual eBird API key.
-
-
Run each cell of the Jupyter Notebook. This will make API calls to retrieve the species codes and recent observations data from eBird.
-
Data files:
- The species codes for all recorded observations in PA will be saved as pa_species.csv.
- The recent observations in PA will be saved as recent_observations.csv. You can use these CSV files for further analysis, processing, or visualization.
The .env file is excluded from version control to protect your API key. Make sure not to commit it to your repository. Remember to respect the terms of use and any applicable data usage guidelines provided by eBird when working with the data obtained from their API.
eBird Basic Dataset. Version: EBD_relApr-2023. Cornell Lab of Ornithology, Ithaca, New York. Apr 2023.