iNaturalist API desktop usage without creating an App?

assuming you’re talking about pyinaturalist, @jcook is probably going to be the one who can provide the most information about it.

i’m pretty sure that pyinaturalist can hit both the old deprecated version of the API and the current v1 API, and you should probably use the v1 API. when i read the documentation for pyinaturalist.v1.observations.create_observation, it does seem to indicate that it will attempt to use an access token acquired through an iNat App oAuth flow, and i think the iNat POST /v1/observations can use an access token acquired that way, but the v1 endpoint i think is really designed to use a JWT which can be acquired from https://www.inaturalist.org/users/api_token. (you can programmatically get the JWT by first getting an oAuth access token and then hitting /users/api_token, but if you’re signed into iNaturalist, you could just manually navigate to /users/api_token, and then manually copy the JWT from the json response.)

i’m not sure if there’s a way to use pyinaturalist.v1.observations.create_observation with a JWT. i don’t see it in the documentation, but you might be able to find something about that the in the GitHub repo, or maybe jcook will be provide more info.

that said, i’m fairly certain you could create observations by posting directly to the iNat API (without going through pyiNaturalist) using just the JWT (and without having to set up an app and programmatically getting the access token).

but just be aware of the new guidelines regarding machine-generated content. currently, official guidelines indicate that “Writing a script to create observations from a manually curated local folder of your images and metadata on your desktop” is acceptable behavior. but then when i read this forum post, it sort of sounds like they may have intended to limit scripts (although i’m not sure how they could do so except just by banning IPs or user accounts). anyway, that was my long way of saying that you should be careful to follow the new rules – whatever they are – so that you don’t get your account banned.

EDIT: in a later response to this post, i note that part of this post is incorrect. see the reply for more details.

1 Like