Google Photos API: Identify "motion photos" - google-photos

For media items that are "motion photos", the Google Photos API allows you to append "=dv" to the base URL of a media item to get the item as a "video/mp4". Without the =dv, the item comes back as a "image/jpeg". This works more or less as described in the docs.
What I can't figure out is how to tell whether or not a given item is a motion photo. The metadata returned for motion photos looks to be the same as for regular photos. Is there something I'm missing or do I need to try loading each photo as a video and handling the 404s?

Related

Fetch a random photo from Google Photos with API

I want to write an app that fetches a random photo from my Google Photos set of photos using the Google Photos API. This is the new Google Photos, not the old one that was linked to a Google Drive.
In my review of the API Docs, it seems that you can list albums, and perhaps list what the albums contain, but it's not obvious to me how to download a photo itself. Can anyone figure it out?
Try with this API: https://developers.google.com/photos/library/reference/rest/v1/mediaItems/list
It lets you list the photos from your library and returns two parameters, productUrl and baseUrl, that you could use to get the photo.

Google Photos API - Can I access existing enrichments?

I'm using the Google Photos Java API to create a small program to access the contents of a pre-existing album. I have been able to get code up and running that can report the album's name, and the media items it contains and so on, but not the text added between photos. I understand that the API considers these texts a form of enrichment and I can see there are functions for adding such enrichments to an album, but is there any way to list the enrichments already in an album? Or otherwise access the text a user has previous added between photos via the platform's desktop browser interface?
Unfortunately the Google Photos Library API does not provide a way to access existing album enrichments when accessing the contents of an album.
This has been filed as a feature request on the issue tracker for the API. You can 'star' it to draw attention to it and be notified of any updates: https://issuetracker.google.com/129050144

accessing videos uploaded to a page via the Graph API

I need to fetch videos uploaded by users to a Facebook Page.
I'd have expected them to show up in https://graph.facebook.com/me/videos/uploaded, but it appears this only covers videos I've uploaded to my profile, not to a page.
The only place I can find that these show up is https://graph.facebook.com/PageName/tagged, but there they're crammed in amongst all the other stuff and I can't filter to find just the authenticated user's uploads to the page.
Is there a way to get only a specific user's video uploads / tags to a page?
OK, if we’re just talking videos posted to the wall here, I guess you could get that info querying the FQL stream table.
Filter it by:
source_id: The ID of the page whose wall the post is on
actor_id: The ID of the user that published the post
type: "128" - Video posted
Information about the video should be in the attachment column.

How to assign a past date while uploading a photo via Facebook Graph API, so that it gets placed at the right point in Timeline?

Using the Facebook Graph API, I have been able to upload a photo. It is an old scanned photo. I would now like to modify the timestamp, so that it is shown at the appropriate point in the timeline. Does the API provide a way to do this?
Here is an article that says we can assign past dates to Facebook Timeline Posts - http://www.allfacebook.com/facebook-timeline-timestamp-2011-10 . I want to assign a past date to a photo I uploaded, and I would like to do it via the Graph API. Any leads would be helpful.

The Facebook Graph API does not include videos in wall posts

I'm using the Graph API to read some wall posts from a Facebook group. I get an array with post objects containing the expected information except for one entry with the type "status" which is a posted video.
But I do not get any information about the video. There is no difference between a default text-only post. How can I access the video URL, thumbnail, etc.?
Edit:
The video is a "native" facebook video. I do not fully understand the various types of posts. When you post a plain url facebook grabs the meta information and displays them properly. But it seems this is not included in the api output.
Where are the differences between shared contens, status updates including urls and status updates with photos or videos?