admin管理员组文章数量:1417426
I wanted to see if anyone here has experience using the iNaturalist API because I'm having an issue with it. I built a web page using Python, but I'm not sure if I'm making the request incorrectly or if there's another issue.
Most of the observations I receive in the API response are missing the name of the observation (scientific name). I don't really understand why this is happening. Here’s how I’m making the request:`
import requests
url = ";
params = {
"taxon_name": "Plantae",
"lat": 40.7128, # Example latitude
"lng": -74.0060, # Example longitude
"radius": 10, # Search radius in km
"per_page": 50,
"order_by": "observed_on"
}
response = requests.get(url, params=params)
data = response.json()
for obs in data.get("results", []):
taxon = obs.get("taxon", {})
scientific_name = taxon.get("name", "Unknown")
print(f"Scientific Name: {scientific_name}")
Sometimes I get correct scientific names, but in most cases, the "name" field is missing. I’m wondering if I need to change something in my request or if the API just doesn’t always return this data.
Has anyone encountered this issue before? Any advice would be greatly appreciated! Thanks in advance!
本文标签: pythoniNaturalist API – Missing observation names in responseStack Overflow
版权声明:本文标题:python - iNaturalist API – Missing observation names in response? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745265599a2650579.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论