Skip to main content
 首页 » 编程设计

python之从 App Annie API 中提取数据之Python

2025年05月04日29itcoder

我需要使用 Python 从 App Annie 的 API 中提取一些数据。但是我无法连接。我仔细检查了我的 API key 和“文档”。有谁知道我如何通过他们的 API 进行连接?我不断收到 401 未授权访问错误。

https://support.appannie.com/hc/en-us/articles/204208864-3-Authentication

import json 
import requests 
 
url = 'https://api.appannie.com/v1.2/apps/ios/app/12345678/reviews?start_date=2012-01-01&end_date=2012-02-01&countries=US' 
key = 'Authorization: bearer b7e26.........' 
 
response = requests.get(url, key)    #After running up to this I get 401 
 
data = json.loads(response.json())  #data is a dictionary 

请您参考如下方法:

您需要在 HTTP header 中指定您的 api key :

response = requests.get(url, 
                        headers={'Authorization':'bearer b7e26.........'})