birdfacts
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v2View latest version
A robust, layered bird facts API that provides regionally-relevant bird information with fun facts and rich descriptions.
- Regional Bird Selection: Uses eBird API to get locally relevant birds
- Fun Facts: API Ninjas for engaging bird facts
- Rich Descriptions: Wikipedia API for detailed information and images
- Smart Caching: Reduces API calls and improves response times
- Graceful Fallbacks: Multiple data sources ensure reliable responses
Get a random bird fact with regional relevance.
Query Parameters:
region(optional): Region code (e.g., "US-CA" for California)lat(optional): Latitude for location-based resultslng(optional): Longitude for location-based results
Response:
{ "name": "Scarlet Macaw", "scientificName": "Ara macao", "fact": "Scarlet macaws are known for their striking red, yellow, and blue plumage...", "wikipedia": { "summary": "The scarlet macaw is a large red, yellow, and blue Central and South American parrot...", "image": "https://upload.wikimedia.org/wikipedia/commons/9/9f/Ara_macao_01.jpg", "url": "https://en.wikipedia.org/wiki/Scarlet_macaw" }, "region": "Amazon Basin", "source": "regional" }
Get birds observed in a specific region.
Health check endpoint.
- Backend: Hono framework with TypeScript
- Caching: Val Town Blob storage for API response caching
- APIs: eBird, API Ninjas, Wikipedia
- Error Handling: Graceful fallbacks between data sources
EBIRD_API_KEY: eBird API keyAPI_NINJAS_KEY: API Ninjas key (optional, has free tier)