title: Access Google Affiliate Network product feed via the Google Search API for Shopping
body: <p>I would like to access my Google Affiliate Network product feed via the Google search API for shopping. I would like to do this from a backend Python library i'm developing. Has anyone done something like this?</p>
  
  <p>I have the following:</p>
  
  <ul>
  <li>A Google account </li>
  <li>Enabled Search API for Shopping in the Google API Console and got
  an API key (for server apps) and a client ID + client secret (for installed applications).   </li>
  <li>A GAN account and got the pid.   </li>
  <li>Several advertiser who approved me so i have products available in my product feed.</li>
  </ul>
  
  <p><strong>OAuth2 Python Code:</strong></p>
  
  <pre><code>from apiclient.discovery import build
  from oauth2client.client import OAuth2WebServerFlow
  from oauth2client.tools import run
  from oauth2client.django_orm import Storage
  from models import CredentialsModel 
  
  storage = Storage(CredentialsModel, 'name', 'GAN Reporting', 'credentials')
  credentials = storage.get()
  
  if credentials is None or credentials.invalid == True:
      flow = OAuth2WebServerFlow(
          client_id=MyClientID,
          client_secret=MyClientSecret,
          scope='https://www.googleapis.com/auth/shoppingapi',
          user_agent='cleverblocks/1.0',
          access_type='offline')
      credentials = run(flow, storage)
  
  http = httplib2.Http()
  credentials.authorize(http)
  client = build('shopping', 'v1', http=http,
      developerKey=MyAPIKey)
  resource = client.products()
  request = resource.list(source='gan:MyGANPid', country='US')
  return request.execute()
  </code></pre>
  
  <p>Running this i get back the following error (HttpError 412):</p>
  
  <blockquote>
    <p>no advertisers are registered for the given publisher</p>
  </blockquote>
  
  <p>The user I am using to authenticate is listed on the GAN->settings->users section.</p>
  
  <p>I've been hacking at this from all directions to the point where I'm now starting to think this API is broken. Has anyone managed to access GAN product feed via the Search API for Shopping? </p>
  
  <p>Any help is appreciated. </p>