1
私は融合テーブル用のPythonラッパーを作成しています。 サービスにアクセスするためにGoogleサービスアカウントを使用することにしました。私のコードは次のとおりです。Googleサービスアカウントを使用する際の認証の問題。認証されていない使用の1日の制限を超えています。引き続き使用するにはサインアップが必要
import httplib2
from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
scopes = ['https://www.googleapis.com/auth/fusiontables']
credentials = ServiceAccountCredentials.from_json_keyfile_name('__Remak APIS-37c11e21531ad.json', scopes)
http = httplib2.Http()
if not credentials.access_token:
credentials.refresh(http)
service = build('fusiontables', 'v2', http=http)
def test():
table_id = '1esH-YayZegZH69VsiVBq0YK9hxgP-JWTCljRuQUZy'
print(service.query().sql(sql='SELECT * FROM {}'.format(table_id)).execute(http=http))
if __name__ == '__main__':
test()
出力は次のようになります。私は確かに達していないために値幅制限がある理由は、このAPIを有効に
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/fusiontables/v2/query?alt=json&sql=SELECT+%2A+FROM+1esH-YayrtegZH6VsiVBq0YK9hxgP-JWTCljRuQUZy returned "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.">
。私も同様の話題で答えを見つけようとしましたが、成功しませんでした。
事前に
をありがとう