tjfrahme tjfrahme - 2 months ago 66
Python Question

Pulling Data from App Annie API - Python

I need to pull some data from App Annie's API using Python. However I am unable to connect. I double checked my API key and the "documentation". Does anyone know how I can connect through their API? I keep getting a 401 unauthorized access error.

import json
import requests

url = ''
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


You need to specify your api key in the HTTP header:

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