Google Affiliate Networkの商品フィードにショッピング用のGoogle検索APIからアクセスしたいと考えています。私は開発中のバックエンドのPythonライブラリからこれをやりたいと思います。誰もこれのような何かをしましたか?ショッピング用Google検索APIを使用してGoogle Affiliate Networkの商品フィードにアクセスする
- のGoogleアカウント
- 有効検索GoogleのAPIコンソールでのショッピングのためのAPIと (サーバ・アプリケーションのための)APIキーとクライアントID +クライアント秘密だ(:
私には、以下の持っていますインストールされたアプリケーションの場合)。
- GANアカウントで、pidを取得しました。
- 私を承認した広告主様は、商品フィードで商品を利用できます。
のOAuth2 Pythonのコード:
のために登録されていない:何の広告主が指定した出版社
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()
これを実行するには、私は次のエラー(HttpError 412)を取り戻します
認証に使用しているユーザーは、 e GAN-> settings-> usersセクション。
私は今、このAPIが壊れていると思っているところまで、あらゆる方向からハッキングしています。誰かがSearch API for Shopping経由でGAN製品フィードにアクセスできましたか?
何か助けていただければ幸いです。