Access Google Photo API with Python using google-api-python-client

后端 未结 4 2045
轻奢々
轻奢々 2021-02-04 15:46

According to Google API Client Libraries page it is possible to access the Google Photos API using the python client library, but after installing it using pip install -t

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-04 16:13

    I didn't find any example so I took the Drive API v3 example and adapted it to Photos v1 API.

    You can see and use the example.

    The gist is:

    from apiclient.discovery import build
    
    service = build('photoslibrary', 'v1', http=creds.authorize(Http()))
    results = service.albums().list(
        pageSize=10, fields="nextPageToken,albums(id,title)").execute()
    

提交回复
热议问题