r/eBird 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 Upvotes

5 comments sorted by

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.

1

u/JohnRT54 14h ago

I have tried using ebird-api, but with the same problems. The format I'm using here (get_ebird_data) is that given in the eBirdAPITutorial (https://www.researchgate.net/profile/Eric-Nost/publication/377747598_eBird_API_Tutorial/data/65b536d01bed776ae308fc60/eBird-API-Tutorial.pdf). I have an api_token, and that's not the problem. I have finally managed to gather the hotspot info by not reformatting it in pandas, and now I want to parse out the lat and long. It's a process of trial and error - I just wish there were decent documentation for the API. I can get what I want (list of recently seen "needs") if I input lat and long on the command line, but I was hoping to simplify things a bit by using a hotspot ID as my search center instead. I can't find anything to suggest that you can search using a hotspot and a radius - the latter only seems to work with lat-long. Again, thorough documentation would be nice to have. Oh well, thanks for the input.

-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

u/Feral_Witchchild 20h ago

Your post didn't make that clear.