Hi, I know I can view all of my own comments on the web by going to this link, and that I can post/update/delete comments with these API endpoints. But is there a way to programmatically get a list of all my comment IDs?
(E. g. if a taxon has been renamed and I want to add to all my comments mentioning it, “now known as ___”, for the benefit of future readers, which I could easily do via script if I had, like, a JSON file of comment IDs.)
I also mean specifically comments, not just identifications which may or may not have comments attached.
There doesn’t seem to be a way currently, but I just wanted to double-check.
if you can’t or won’t describe your use case, or if you don’t know what your use case is, it’s hard to say whether there’s an efficient way to get the information. you’re not a particularly prolific observer, nor a particularly prolific identifier. so it’s probably not a big deal to get the data. but the best way to do it will vary by use case.
I believe the only way to get observation comments is via the /observations endpoint. So if you’re only interested in comments on your own observations, that would be simple enough: get all of your own observations, then get the comment IDs from there.
If you want to include comments on any observations, that’s a little trickier, since there’s no way to filter observations that you’ve commented on. The next best thing is to start with identifications, with the assumption that you’ve added an identification for most or all observations you’ve commented on:
fetch all your identifications (https://api.inaturalist.org/v1/identifications?user_login=arachnoto)
get the observation IDs from that response
fetch those observations
get the comment IDs from that response
I would also be interested if anyone has an easier way to accomplish that, though.
Well, I really just wanted to play with the data, but one thing I might use it for is seeing what taxa I comment on most. (Perhaps even making a phylogenetic tree of them.) So it would help to have a list of the observation IDs I’ve commented on. Does that help?
You’re right, I don’t have a ton of comments so I could probably just scrape the pages, but I was hoping there was a quicker way.
Ah, I sometimes? often? don’t add an identification when I comment. Sometimes it’s because it’s already been identified by many people, sometimes it’s because I actually can’t ID it and I’m just making a suggestion or asking for more information. Thanks though!
if you’re going with this approach, you don’t need your second and third step, since each identification object in the response from step 1 will contain more or less a full nested observation object