0

How do I get the JSON response from this, when I print the response I just get the response status of 200 instead of the JSON tree.

headers = {
    'accept': 'application/json',
    'Authorization': 'Bearer 123456789',
}

params = (
    ('interval', 'month'),
)

response = requests.get('https://api.peakon.com/v1/engagement/overview', headers=headers, params=params)

print(response)
squareskittles
  • 11,997
  • 7
  • 31
  • 48
Arron
  • 27
  • 8
  • 4
    `response.json()`? – tomjn Sep 19 '19 at 14:13
  • For future reference, the inbuilt python function 'dir()' returns a list of the attributes of an object, So in this case using dir(response) would return a list of all the methods you can call on 'response' including json, which is the one you want – Jerome Paddick Sep 19 '19 at 14:27

1 Answers1

0

print(response.json()) should give the the data formatted as JSON for this response.

galfisher
  • 1,119
  • 1
  • 13
  • 22