Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created September 13, 2020 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/027b960df39fef24e373256f0eadaeeb to your computer and use it in GitHub Desktop.
Save JeffersGlass/027b960df39fef24e373256f0eadaeeb to your computer and use it in GitHub Desktop.
import requests
import json
baseUrl = "https://lapi.transitchicago.com/api/1.0/ttarrivals.aspx"
payload = {'key': "da12f3924e734385862aab7ae9b3e514", 'mapid':'40090', 'outputType':'JSON'}
response = requests.get(baseUrl, params=payload)
#response = requests.get(baseUrl)
#print(response.json())
workingObject = response.json()['ctatt']['eta']
for arrival in workingObject:
print(arrival['stpDe'] + " \t\t" + arrival['arrT'][-8:])
#print(json.dumps(workingObject, indent=4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment