[問題] Google API server account 認證後問題

看板Python作者 (ChaN)時間7年前 (2018/03/29 01:51), 編輯推噓2(203)
留言5則, 2人參與, 7年前最新討論串1/1
大家好,我想要透過 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://www.ptt.cc/bbs/Python/M.1522259491.A.90E.html

03/29 03:23, 7年前 , 1F
service.reviews().list(packageName='...').execute()
03/29 03:23, 1F

03/29 03:39, 7年前 , 2F
03/29 03:39, 2F

03/30 17:03, 7年前 , 3F
你好,我順利抓到資料了,但 maxResults=100 的情況下
03/30 17:03, 3F

03/30 17:03, 7年前 , 4F
有某些 app 回來的數量不一定,像這個網址只返回十個
03/30 17:03, 4F

03/30 17:03, 7年前 , 5F
03/30 17:03, 5F
文章代碼(AID): #1QkzOZaE (Python)
文章代碼(AID): #1QkzOZaE (Python)