API v2 feedback

@kueda - Since API v2 requires more API calls (since it’s a much more granular API), have y’all considered increasing the API rate limiting for it? For example, in one script that I converted to API v2 (just to see if it was possible), it took 12-15 API calls per taxon to get the same data that I got with 3 API calls in API v1. So I had to slow down the script by a factor of 5 in order to not hit the API rate limit.

Hey all, I’m using the Swagger/OpenAPI Schema JSON file with API v1 to generate bindings ([1] [2]) so I don’t need to manually write the bindings myself, which is incredibly convenient. Will a schema JSON file be published for API v2?

Also getting this error trying to add “host” or “host plant” fields on this observation https://www.inaturalist.org/observations/150238337

Is the identify page under API v2 going to be modified so that it will preemptively cache information about the upcoming observations so that you don’t have to wait for it to load when you’re identifying quickly? It’s pretty annoying that it flashes “casual” and “location missing” and “NaN” observations for about half a second before actual the data loads.

The radius parameter for the API V2 /observations endpoint does not appear to work.

Example:

V1 returns 6 results here:
https://api.inaturalist.org/v1/observations?user_id=6650&observed_on=2023-04-09&lat=44.609492&lng=-123.278599&not_id=74e86232-2d6b-4a5e-84e3-9c34769bd6db&hrank=family&radius=0.2

V2 returns 29 results here:
https://api.inaturalist.org/v2/observations?fields=(taxon:(name:!t,rank:!t))&user_id=6650&observed_on=2023-04-09&lat=44.609492&lng=-123.278599&not_id=74e86232-2d6b-4a5e-84e3-9c34769bd6db&hrank=family&radius=0.2

On this observation, when I click on the “Species Name” field, the “Loading Suggestions” message comes up and stays indefinitely, without a suggestion. This has happened on Firefox, Edge, and Vivaldi browsers, both yesterday and today. I haven’t gotten a suggestion on this observation since this first occurred. All other observations have been fine.

I can’t reproduce the issue on that observation (anymore?) but I have seen the same thing happen on other observations, in particular usually ones where the computer vision assistance outright fails on API v1 (e.g. this one EDIT: or this one).

agreed, I would also like for it to do at least per-page pre-caching; the issue you describe is still happening regularly.

1 Like

Following up on this. I want to help test the API v2 but this is one of the main things keeping me on v1. It’s frustrating to use the identify page, especially without very fast internet.

1 Like

I’m also seeing the slowness on the identify modal when flicking through observations to identify - cached data doesn’t seem to be used.

This has been mentioned above, but as I haven’t seen it acknowledged, here’s a screenshot comparison of the same observation on a slow connection just after opening with v1 and v2

v2:
image

v1:
image

1 Like

The total observations count in V2 seems to have some additional filter?
Here is an instance where API V2 returns total observations count as one while V1 returns two.
Pay attention to “total_results” value returned by the two APIs
I tried “verifiable” with true and false and I assume not passing it in V2 is equivalent to “any” in V1

Anything else missed out in V2 parameters that is causing this?

VERSION 1
https://api.inaturalist.org/v1/observations?verifiable=any&order_by=observations.id&order=desc&page=1&user_id=reshma6&d1=2023-01-01&d2=2023-05-01&locale=en&preferred_place_id=6681&per_page=1

VERSION 2:
https://api.inaturalist.org/v2/observations?place_id=6681&user_id=reshma6&d1=2023-01-01&d2=2023-05-01&page=1&per_page=1&order_by=id&fields=species_guess%2Cobserved_on%2Ccreated_at_details

it looks like your /v1 request is using preferred_place_id while your /v2 request is filtering by place_id

Oh yeah! You were right @pisum. Wonder how the place_id and preferred_place_id should return different count!. Thanks for pointing that out. Now i could get the right results.

When I open this observation and click on “Species Name” to get a suggestion, it gets stuck on “Loading suggestions”. I can still click “Comment” or Suggest an Identification and it stops “trying”. In other words, it doesn’t lock up, it just never finds a suggestion.

I added a second photo, no change. I ordered the second photo first in the observation, and it found a suggestion properly (it recognized the wasp, not the tiny insect). I have left the observation with both photos, ordered so the problem shows up.

This happens on both Firefox and Edge browsers. Edge doesn’t have any extensions loaded.

Addendum: I corrected the ID from Insecta (which is incorrect) to Collembola, and that solved the problem. Now a suggested genus comes up.

I hope this hasn’t been brought up before, but while we’re on the subject of the Identify tool, I am also having the issue on v2 that when waiting for things to load, if one begins typing (out of frustration perhaps!) an identification based on the main picture before the panel containing previous IDs and comments finishes loading, it will not save the typed ID – that is, nothing happens when trying to click “Save” or hitting enter from the identification field.

The bug described in this bug report also affects API V2: https://forum.inaturalist.org/t/rank-filters-sometimes-show-wrong-results/97/12

e.g. https://www.inaturalist.org/observations?hrank=hybrid&lrank=hybrid&place_id=any

Hello, with the v2, the option to search for similar taxa is no longer available.

V1 with “Visualmente Similar”
Captura de tela 2024-02-09 115113

V2 without the option “Visualmente Similar”
Captura de tela 2024-02-09 114545

1 Like

Does this api support https://www.inaturalist.org/trips/ ?

This afternoon (April 18) the suggested ID hasn’t been working on API V2, but works fine without the test version. This happens on Firefox, Chrome, and Vivialdi browswers, all on Windows 10. I cleared the browser cache, logged out and in, but these had no effect.

When try to use it, I click on “Species name” under “Suggest an Identification” under “Activity”. “Loading suggestions” comes up and stays there, but it never gets to a suggestion.
This seems to occur on all observations. Here’s a sample:

https://www.inaturalist.org/observations/36060036