Get project members v1 API call missing taxa & observation counts

When making a call to /v1/projects/#/members, I would expect observations_count and taxa_count to be set for all members returned. However, what I find is that the first 5 members from the first two pages page have these counts, and the rest of the members have them all set to zero. For example, these 4 URLs exhibit the problem I’m seeing:

https://api.inaturalist.org/v1/projects/33276/members?page=1
https://api.inaturalist.org/v1/projects/33276/members?page=2
https://api.inaturalist.org/v1/projects/33276/members?page=3
https://api.inaturalist.org/v1/projects/33276/members?page=4

If you look at page 3, you’ll find our number one observer is present & shows as having 0 taxa & 0 observations:

{"id":457117,"project_id":33276,"user_id":420537,"created_at":"2019-01-26T04:11:44+00:00","updated_at":"2019-05-21T23:43:38+00:00","role":"manager","observations_count":0,"taxa_count":0,"user":{"icon":"https://static.inaturalist.org/attachments/users/icons/420537/thumb.jpeg?1559522637","name":"Ethan Maitra","id":420537,"login":"astrobirder","icon_url":"https://static.inaturalist.org/attachments/users/icons/420537/medium.jpeg?1559522637","orcid":null}}

Edit: In light of my goal stated in the comments below & discovery of a different API call more suited to fulfilling that goal, it is not a priority for me that this issue be fixed, but is only something odd I noticed in my exploration of the API docs & experimentation. In fact, the counts of observations and species per member is not really what I want: it is how people are doing vs. other competitors in the yearlisting people are interested in, apart from whether or not they are members of the project. Therefore, the /v1/observations/observers call is the appropriate one to determine this.

1 Like

For what it is worth I only obtain observations_count and taxa_count for the first five on page one. After that all are zero. You noted that you were seeing counts for the first five on the first two pages, and I cannot replicate that behavior for page two. All zeros is what I see after the first five on page one. Page two, three are all zeroes for me.

Could be I had edited the url in testing with Chrome and pressed enter but the page didn’t refresh. Thanks for checking.

1 Like

My goal is to populate a Discord embed with # of observations & rank (and equivalent percentile of all observers), and do the same for # of species. With that goal in mind, I went to the project page to compare the API call that is the topic of this thread vs. whatever the project page is using and found the calls are different. The project page uses these two calls:

https://api.inaturalist.org/v1/observations/observers?verifiable=any&spam=false&project_id=33276&locale=en
https://api.inaturalist.org/v1/observations/observers?project_id=33276&ttl=120&v=1577302176000&preferred_place_id=&locale=en&order_by=species_count

The API doc doesn’t explain the role that ttl=120 and v=1577302176000 have, but since the calls are back to back, I am guessing it might be to take advantage of having cached the results from the prior call so that the 2nd call only needs to return the same results with the alternate sort order.

Since these calls are reliably returning the numbers I am interested in, I plan to use them instead of the call that is missing those numbers (and besides, is for members in the project, not observers, which is what I really want!)

1 Like