Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass

JeffersGlass/cta_apiarrivals.py Secret

Created Sep 13, 2020
Embed
What would you like to do?
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)
workingObject = response.json()['ctatt']['eta']
for arrival in workingObject:
print(arrival['stpDe'] + " \t\t" + arrival['arrT'][-8:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.