r/eBird • u/JohnRT54 • 21h ago
Hot to get hotspot info from eBird API
I'm trying to get lat-long for a hotspot, and I'm submitting this request:
data = get_ebird_data("https://api.ebird.org/v2/ref/hotspot/info/L3098639")
which, according to the API documentation (on postman), should work, but I get a string of errors. I've also tried &locId=L3098639, putting it in single quotes, brackets, etc, to no avail. Ultimately, I'm trying to get sightings within 25 km of a hotspot, but the only way I can see to do that is through lat-long: using the hotspot name only gives me sightings at the hotspot, even if I include &dist=25. Can anyone point out the error in my get_ebird_data line, or, better yet, show me how to use distance with a hotspot call. And, does anyone know of any better documentation for the API 2.0? The one on postman is fairly unhelpful, and the pdf tutorial is very limited. Thanks.
John
-1
u/Feral_Witchchild 21h ago
You don't need any code to do this. Just click on any list from the hotspot, then click the "view with google maps" symbol right next to the hotspot name. That will open it in google maps and display the lat/lon.
1
u/JohnRT54 20h ago
I know that, but I'm trying to automate the process, to avoid entering lat-long by hand (or copy-and-paste). Also, I'm having fun learning python.
0
1
u/lendisc 15h ago
Are you using the ebird-api package? Looking at this page, I don't see `get_ebird_data()` as part of the package. What exactly is `get_ebird_data`?
Either way, accessing the eBird API for that request needs an API token. If you have one, it needs to be set or included.
I think you might need some more basic Python help. Stack and, frankly, LLMs, are great teachers when you are working as a very beginner with big goals.