Photo detail endpoint for API

Platform(s): API

URLs (aka web addresses) of any pages, if relevant:

Description of need: I’m building a Lightroom plugin that synchronizes between Lightroom and iNaturalist. I’d like the ability to match photos that I’ve already (ie, prior to the plugin) uploaded to iNaturalist with photos in my Lightroom catalog. That requires some information, like the timestamp of the photo (the time of the observation may not match, especially if there are multiple photos attached to it), filename, etc, to find matches in the catalog.

It looks like there’s been some prior discussion on this topic:

In the issue on Github @kueda says “I’m not opposed to a photo detail endpoint in principle, or including the sourcing information we have in our database, so if someone else wants to build that, cool.”

I’d be happy to build this functionality if it is allowed.

Feature request details:

GET https://api.inaturalist.org/v1/photos/:id should return something like

{
  ...
  "results": [
    "id": 12345,
    "user_id": 67890,
    ... all other fields returned by POST /photos except to_observation ...
    "associated_observation_ids": [1, 2, 3],  # Or fully related objects
    "metadata": {
       "filename": "_DSC12345.jpg",
       "width": 1000,
       "height": 1000,
       ... whatever would be returned by https://github.com/inaturalist/inaturalist/blob/main/app/helpers/photos_helper.rb#L6 (just without the key being transformed to title-case), and with the same visibility/logged-in restrictions ...
    }
  ]
}

I’ve created an incomplete implementation

https://github.com/rcloran/inaturalist/commit/6231ded82c2739dc49b2a2bd40a48a0161f3fb2f
https://github.com/rcloran/inaturalistjs/commit/3fd253b451b57f449e6acbc1ce08ae4dd382e86c
https://github.com/rcloran/iNaturalistAPI/commit/8c1c7362bea6cf3b988fb555d8ca4bc6a1161dab

As far as I can tell I’d only need to add tests and API documentation to the INaturalistAPI commit for this to be ready for a pull request, but I hope it demonstrates concretely what I’m requesting here. I’m happy to complete the work (and implement any other requested changes) if this feature is approved.

1 Like

Yes, please! I need this as well for my iNaturalist to BOLD script.

1 Like

@kueda - What do you think of this? @rcloran is willing to do the development work (much of which is already done). Would someone be willing to merge this if he completes it?

1 Like

As currently https://www.inaturalist.org/photos/ does return these information on iNat website, I’d think there has to be an API endpoint already?? Really would like to be able to get photos details, especially filename to batch matching files.

1 Like

Same - want to get original filename, original timestamp for matching to Lightroom database (e.g. to pull in taxon and common name into title and keywords fields.)