title: Python Google Photos API List Items in Album
body: <p>I am having trouble extending the API calls required to list album ids to be able to list the items contained in the album.  An example of what I have done to retrieve album ids appears below.  Beyond that example, I include my attempt to extend this script to be able to list the items contained in a specific album.</p>
  
  <pre><code>from httplib2 import Http
  from oauth2client import file, client, tools
  from apiclient.discovery import build
  
  SCOPES = 'https://www.googleapis.com/auth/photoslibrary.readonly'
  store = file.storage('credentials.json')
  creds = store.get()
  if not creds or creds.invalid:
      flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
      creds = tools.run_flow(flow, store)
  service = build('photoslibrary', 'v1', http=creds.authorize(Http()))
  
  hasNextPageToken = False
  nextPageToken = ""
  
  results = service.albums().list(pageSize=10).execute()
  
  if 'nextPageToken' in results:
      hasNextPageToken = True
      nextPageToken = results['nextPageToken']
      for album in results['albums']:
          albumId = album['id']
          print(albumId)
  </code></pre>
  
  <p>Now, for the code that I am attempting to modify from the example above to be able to list the items in a given album defined by <code>albumId</code>:</p>
  
  <pre><code>from httplib2 import Http
  from oauth2client import file, client, tools
  from apiclient.discovery import build
  
  SCOPES = 'https://www.googleapis.com/auth/photoslibrary.readonly'
  store = file.storage('credentials.json')
  creds = store.get()
  if not creds or creds.invalid:
      flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
      creds = tools.run_flow(flow, store)
  service = build('photoslibrary', 'v1', http=creds.authorize(Http()))
  
  hasNextPageToken = False
  nextPageToken = ""
  albumId = [albumIdFromPreviousStep]
  results = service.mediaItems().search(pageSize=10,albumId=albumId).execute()
  </code></pre>
  
  <p>When I attempt to print the <code>results</code>, I receive an error about receiving an unexpected keyword argument, <code>albumId</code>.</p>
  
  <p>The api call is formatted differently for search, it is <code>https://photoslibrary.googleapis.com/v1/mediaItems:search</code> </p>
  
  <p>Is the error stemming from the : <code>mediaItems:search</code> which invalidates the variable in Python?  Or is it related to the fact that the search call is a POST rather than a GET?  Or, something else?</p>