Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fxn get_inat_obs with invalid name produces error #34

Open
vijaybarve opened this issue Jun 27, 2019 · 4 comments
Open

fxn get_inat_obs with invalid name produces error #34

vijaybarve opened this issue Jun 27, 2019 · 4 comments
Labels
Milestone

Comments

@vijaybarve
Copy link
Contributor

> get_inat_obs(taxon_name ="abcxyz", geo = TRUE, quality = "research", maxresults = 10000000)
Error in get_inat_obs(taxon_name = "abcxyz", geo = TRUE, quality = "research",  : 
  Your search returned too many results, please consider breaking it up into smaller chunks by year or month
@LDalby
Copy link
Contributor

LDalby commented Jun 27, 2019

What version of the package are you running?

Stepping through the code I can see your search gives 13407895 results. So I think the error message is actually OK.
Your maxresults value would throw an error in the dev version of the package. Currently you need to break up your search so you get less than 10000 results per call.

@vijaybarve
Copy link
Contributor Author

In this case the name is invalid. taxon_name = "abcxyz" And the return value of 13407895 is all research grade records. So trying to figure out how to handle that.

@vijaybarve
Copy link
Contributor Author

@kueda is this expected behavior of the API?

@stragu
Copy link
Collaborator

stragu commented Aug 26, 2020

Thanks, @vijaybarve . This is indeed a limitation of the old API. Moving to the new API will fix that, as it returns 0 results as expected, rather than every single observation in the database.

See for example this API request: https://api.inaturalist.org/v1/observations?q=abcxyz&order=desc&order_by=created_at

@stragu stragu added this to the 0.2 milestone Aug 26, 2020
@stragu stragu added the API v1 label Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants