photos.google.com/activities/photo_likes - call in javascript
Asked Answered
N

4

7

https://photos.google.com/activities/photos_likes returns likes photos in shared albums. I would like to use the photoslibrary api or the activities api to find liked photos in shared albums.

However, I cannot find the documentation on how to do this using activities api or from the photoslibrary api. I have tried the photoslibrary api mediaitems.search, however, it does not seem to include photos_likes as a metadata value.

Which metadata value or tag from the photoslibrary api mediaitems.search can I use to find liked photos in shared albums? if this is the wrong api, which one should I use?

Nielson answered 2/11, 2018 at 19:52 Comment(2)
I found an API reference for them here developers.google.com/photos/library/reference/rest and I found their guides for this API here developers.google.com/photos/library/guides/overviewGrovel
Thanks- I have already poured over these references. The 'photos_likes' is a new tag that replaces 'Favorites' in shared albums. It allows multiple users to 'heart', aka photos_likes, a photo and have that information shared. It can't be searched the same as 'Favorites'. return gapi.client.photoslibrary.mediaItems.search({ "resource": {} }) .then(function(response) { console.log("Response", response); } doesn't show this tag - where is it stored and how can access in js?Nielson
O
2

So far (05 October 2021), this feature is not available, you can just filter it by favorite (which is not what you want).

I open an issue to ask a feature improvement, you can star it to make it more visible to the Google Photos API team : https://issuetracker.google.com/issues/202032850

Obfuscate answered 5/10, 2021 at 8:24 Comment(1)
Indeed, it seems that you are right ;) I leave my answer visible, if anyone needs to filter by favorite ^^Steiner
S
0

I don't know if we are talking about the same feature, but I've just been able, with the api explorer, to retrieve a photo I "starred" (favorite).

Please use this link to the api.

If it doesn't fill the body of the request, here it is :

{
  "filters": {
    "mediaTypeFilter": {
      "mediaTypes": [
        "PHOTO"
      ]
    },
    "featureFilter": {
      "includedFeatures": [
        "FAVORITES"
      ]
    }
  }
}

So you would try to POST this body to https://photoslibrary.googleapis.com/v1/mediaItems:search or adapt it for the gapi.client

Response structure :

{
  "mediaItems": [
    {
      "id": "XXX",
      "productUrl": "https://photos.google.com/lr/photo/YYY",
      "baseUrl": "https://lh3.googleusercontent.com/lr/ZZZ",
      "mimeType": "image/jpeg",
      "mediaMetadata": {
        "creationTime": "2021-09-05T11:25:23Z",
        "width": "4608",
        "height": "3072",
        "photo": {
          "cameraMake": "NIKON CORPORATION",
          "cameraModel": "NIKON D3100",
          "focalLength": 18,
          "apertureFNumber": 6.3,
          "isoEquivalent": 100,
          "exposureTime": "0.004999999s"
        }
      },
      "filename": "DSC_0083.JPG"
    }
  ]
}

Please let me know if this answer is relevant, I hope so ;)

(ok, this is not javascript, but credentials is another nightmare :D )

Steiner answered 2/10, 2021 at 22:3 Comment(0)
M
0

try passing file extensions as parameters to mediaitems.search i.e.: mediaitems.search(jpg,png)

Miksen answered 4/10, 2021 at 21:59 Comment(0)
B
0

Try passing in file extensions parameters as an object, specifying it in the "filters"? See here for reference: https://developers.google.com/photos/library/reference/rest/v1/mediaItems/search

{
  "albumId": string,
  "pageSize": integer,
  "pageToken": string,
  "filters": {
    object (Filters)
  },
  "orderBy": string
}
Bernabernadene answered 5/10, 2021 at 5:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.