作者chan15 (ChaN)
看板Python
标题[问题] Google API server account 认证後问题
时间Thu Mar 29 01:51:27 2018
大家好,我想要透过 Google API 去爬一些 APP 星星数量,我找到了
https://developers.google.com/android-publisher/reply-to-reviews#retrieving_a_set_of_reviews
但我是要从 server 端撷取不会透过登入界面,所以我使用 service account 的 solution
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
程式码运作起来没有错误,但官方范例是 sqladmin,我不知道怎麽找 androidpublisher 的
from google.oauth2 import service_account
SCOPES = ['
https://www.googleapis.com/auth/androidpublisher']
SERVICE_ACCOUNT_FILE = 'account.json'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
from apiclient.discovery import build
try:
service = build('androidpublisher', 'v2', credentials=credentials)
except Exception as e:
print(str(e))
请问有 Google API 使用经验的大大知道怎麽找到自己想要的 API 方式对应下方这个结果嘛
GET
https://www.googleapis.com/androidpublisher/v2/applications/your_package_name/reviews?access_token=your_auth_token
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 122.116.234.173
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1522259491.A.90E.html
1F:推 ckc1ark: service.reviews().list(packageName='...').execute() 03/29 03:23
3F:→ chan15: 你好,我顺利抓到资料了,但 maxResults=100 的情况下 03/30 17:03
4F:→ chan15: 有某些 app 回来的数量不一定,像这个网址只返回十个 03/30 17:03