Nuthatch API v2.3.1
An api for birds. Now with images!
This project is a free easy-to-use API with basic bird data. Currently, it includes an index of over 1000 birds.
Versions
- 1.0.0 - Initial release
- 1.1.0 - Images included! Public use images compiled using Unsplash as well as my personal photography collection. This was done via an automated process from free images and not all of the ids were accurate. Please report mislabeled images. lastelmsoft@gmail.com
- 2.0.0 - Added Western European species and added paging of bird list. Deprecated old /birds list endpoint and limited it to 200 species
- 2.0.1 - Added Visual Scripter page. For more info visit swagger-visual-scripter - More Western European species photos.
- 2.1.0 - Added checklists!
- Adds first write endpoints! POST /checklists
- Add up to 25 checklists, allowing the people to keep track of which birds they've seen
- 2.2.0 - Updated default request limit to 500/hr
- 2.3.0 - Improved validation
- 2.3.1 - Added and corrected some images. Thanks to the birding community for your help maintaining an accurate list!
Future updates
- Expand beyond North-American and European birds
- Expand images
- Include color info
Documentation
The api is documented using Swagger
You will first need an API-Key which you can generate HERE
Contribute
Our database could use more info! Photography and ID help would be appreciated as well as any coding time.
This is an open-source project. Contact the developer for more info
How to use
Example code:
A simple and not particularly interesting example of how you might use Nuthatch API
function fillBirdList() {
fetch('/v2/birds?family=Troglodytidae&hasImg=true', { //Get some wrens
headers: {
'api-key': 'YOUR_API_KEY_HERE'
}
})
.then((response) => {
if (!response.ok) {
throw new Error('Network response was not OK');
}
return response.json();
})
.then((data) => {
let birdListContainer = document.getElementById("birdList");
for(let i=0; i<5; i++) {
let bird = data["entities"][i];
//Row
let birdRow = document.createElement("div");
birdRow.className = "row";
let birdDiv = document.createElement("div");
birdDiv.className = "third";
birdDiv.innerHTML = `<h2>${bird["name"]}</h2><ul><li>${bird["sciName"]}</li><li>Conservation Status: ${bird["status"]}</li></ul>`;
//Image
let imgDiv = document.createElement("div");
imgDiv.className = "third";
let image = document.createElement("img");
image.setAttribute("src", bird["images"].length ? bird["images"][0] : "noBird.png");
image.setAttribute("width", "500");
imgDiv.appendChild(image);
birdRow.appendChild(birdDiv);
birdRow.appendChild(imgDiv);
birdListContainer.appendChild(birdRow);
}
})
.catch((error) => {
console.error('There has been a problem with your fetch operation:', error);
});
}
fillBirdList();