2023-04-25 18:19:08 -04:00
|
|
|
import requests
|
|
|
|
|
import Apikeys
|
2024-01-17 16:44:12 -05:00
|
|
|
import pprint
|
2023-04-25 18:19:08 -04:00
|
|
|
|
2024-01-17 16:44:12 -05:00
|
|
|
pp = pprint.PrettyPrinter(indent=4)
|
|
|
|
|
apikey = Apikeys.SPS
|
|
|
|
|
url = "https://api.northpass.com/v2/training_events"
|
|
|
|
|
headers = {"accept": "application/json", "X-Api-Key": apikey}
|
2023-04-25 18:19:08 -04:00
|
|
|
response = requests.get(url, headers=headers)
|
|
|
|
|
resp = response.json()
|
2024-01-17 16:44:12 -05:00
|
|
|
|
|
|
|
|
for item in resp["data"]:
|
|
|
|
|
name = item["attributes"]["title"]
|
|
|
|
|
print(name)
|
|
|
|
|
# pp.pprint(resp)
|