I\'ve been reading more or less every StackOverflow question about Google Photos, and still I haven\'t figured out the answer.
I need, for my Rails app, to get the url o
Use the Search
call, (https://developers.google.com/photos/library/reference/rest/v1/mediaItems/search) with an empty search string, retrieves all media items.
I have recently built a tool to backup all my photos (https://github.com/dtylman/gitmoo-goog), following is an example in golang
to list the entire library:
import "google.golang.org/api/photoslibrary/v1"`
func ListAll(svc *photoslibrary.Service) error {
hasMore := true
req := &photoslibrary.SearchMediaItemsRequest{PageSize: 50}
for hasMore {
items, err := svc.MediaItems.Search(req).Do()
if err != nil {
return err
}
for _, m := range items.MediaItems {
fmt.Println(m)
}
req.PageToken = items.NextPageToken
if req.PageToken == "" {
hasMore = false
}
}
return nil
}