Bulk Selection of Observations to Add to a Project

conceptually, it’s relatively straightforward to add an observation to a traditional project via the API. the most basic way for a Windows user to do this is probably to just run this from the command prompt (cmd.exe):

curl "https://api.inaturalist.org/v1/projects/%project_id%/add" -X "POST" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: %jwt%" -d "{\"observation_id\": %observation_id%}"

… substituting the three parameters above for appropriate values:

  • %project_id% for the numeric id of your project
  • %jwt% for a JSON web token, which can be obtained from: https://www.inaturalist.org/users/api_token
  • %observation_id% for the numeric id of the observation you want to add

if you have another observation, just run the same command again, this time with the new %observation_id% value. keep repeating, as needed.

you could prepare multiple command lines – one for each observation – and paste them all to the command prompt, and they will execute one after the other. (i might do up to 100 at a time, just to make sure you’re not exceeding API request limits and so that you can catch errors as they occur.) or you could do some fancier scripting to make this a little more automated / parameterized. or you could adapt the same concepts to your scripting language or other tool of choice…

here are some ideas for how to get a list of observation ids: https://forum.inaturalist.org/t/search-by-location-accuracy-under-edit-observations-batch-edit/21399/5.

1 Like