Introduction
CTA Train Tracker SM is a product currently in the beta testing phase. This document covers the arrivals API, currently under release for testing and evaluation by developers who work with CTA data.
For complete information about the API and tips, see the main CTA Train Tracker API page.
Note that, to use this API, you must agree to our Developers License Agreement and Terms of Use. You’ll also need to apply for a key.
This documentation is also available as a PDF
Revised 04-Aug-2024
Table of Contents
About this document
What this document covers
This document explains how to request information and what information is provided through the single arrivals API. Additional APIs may be released at a later date, and this documentation would then be updated accordingly.
What this document does not cover
This document does not cover information provided through the CTA Customer Alerts API, Google Transit Feed Specification data package nor the CTA Bus Tracker API. Go to our Developer Center for more information on these other data services from CTA.
How information gets into our system
Information in the CTA Train Tracker beta comes from data fed to CTA from its rail infrastructure (unlike buses, our current railcar fleet does not have GPS hardware). This data is then processed by software we use to monitor our rail system which also generates the predictions for train arrivals based on recent train travel times from one point to another. (The software is a product called QuicTrak®.)
Prediction data are combined with other data and polished to help present information in the most meaningful way possible.
Note: QuicTrak is a registered trademark of QEI, Inc.
Some other things you should know
This service is in beta—it may not always be available and may be changed (see DLA for complete details). Here are some notes about what you can expect from the data:
- Predictions for train arrivals are generated as trains move from one section of track to another and for estimated arrivals up to 60 minutes beyond the train’s current position.
- Predictions may be withheld in circumstances where we expect them to be inaccurate, such as during major work, reroutes or unavoidable service disruptions.
- Important tip: Use the Customer Alerts API to determine whether or not an event is affecting service and relay to your end-users when some or all predictions may be affected or unavailable due to an event that affects service.
- When no predictions are available for a station, such as because no train has yet departed a terminal, we offer up to one scheduled departure time in place of a live prediction so long as service is scheduled. Terminal departures are always represented as a scheduled departure, as live information is not presently available until a train leaves.
- Arrival predictions are available for locations where trains pick up passengers (predictions for terminal arrivals and exit-only platforms are not presently available in the data).
- Predictions for a specific train run number are not available at this time—only for arrival/departures from stops where passengers are accepted.
- Internal testing has shown train arrival accuracy averages <±1 minute from prediction times. Average actual variance from predictions may vary as traffic conditions change.
- Unscheduled express runs (where a train runs non-stop from one point on a route to another, such as to space out service following an unavoidable delay) are not expressed in CTA Train Tracker at this time.
- The default daily transaction limit for this API is 100,000 transactions. If you need additional transactions, contact [email protected] with your request. Additionally, there is DoS protection installed on our servers which may trigger a temporary “time-out” if a large number of transactions from a single IP address.
Why we’re providing this API
The hope is that, by publishing this data, it ends up in all sorts of places beyond CTA’s sites and services. By having transit information in as many contexts as people might use it, we can extend our reach and help people make informed decisions which can improve people’s experiences with transit.
If you experience any issues or have any comments regarding this service and related policies, please contact us right away. Your feedback is extremely valuable to us!
Legal notice
By using this API, you agree to our Developer License Agreement and Terms of Use, the latest version of which is included, as of the publication date of this document, in this document’s appendices.
It’s important that you, the developer, understand that this service is provided on an as-is basis and without any guarantees as to availability or accuracy. You must read and agree to the full Developer Terms of Use to use this API.
A few definitions…
There are a few bits of lingo that you’ll find in this document (we’ll try to keep it to a minimum) that we’d like to explain first, so you know what we’re talking about.
- Customer Alert – An entry in our Customer Alerts database which describes a condition that can affect someone’s trip on CTA; see Customer Alerts API for comprehensive alert information, including a special flag for train alerts that indicates whether or not an event may cause Train Tracker to behave less-reliably than normal.
- General Transit Feed Specification (GTFS) – GTFS is used by hundreds of transit agencies to publish their transit data in a format that can be consumed by a wide variety of software applications. A GTFS package is generated, as needed, by transit agencies and can be distributed as a simple .zip file with several comma-delimited text files inside. You can read more about GTFS on gtfs.org. For consistency, the same route IDs and stop IDs are used throughout the Bus Tracker system, the Alerts system as are specified in the CTA GTFS feed (with a few special exceptions—see appendix).
- Delay – In the context of this document, a delayed train is one that has not moved from one track circuit to another for an abnormally long period of time.
- Terminal – A point of departure or terminus on a train route.
Train location data coming soon
We’re working on releasing an API into train location data (like what powers our beta map).
We understand that this is an exciting new feature lots of you have been waiting for, but we just need a little time to finish the development on the API bits. We're sorry we don't have this yet, but we appreciate your patience while we put together something that'll be stable and supported.
Arrivals API
Description
This API produces a list of arrival predictions for all platforms at a given train station in a well-formed XML document. Registration and receipt of an API key is required for use of this API.
Each separate prediction describes a single train, when it’s expected to arrive, and various bits of information that explain where it’s expected to arrive and certain attributes about the train.
Base URL
http://lapi.transitchicago.com/api/1.0/ttarrivals.aspx
Parameters
Use URL query string method.
Name
|
Value
|
Description
|
mapid
|
Numeric station identifier (required if stpid not specified)
|
A single five-digit code to tell the server which station you’d like to receive predictions for. See appendix for information about valid station codes.
|
stpid
|
Numeric stop identifier
(required if mapid not specified)
|
A single five-digit code to tell the server which specific stop (in this context, specific platform or platform side within a larger station) you’d like to receive predictions for. See appendix for information about valid stop codes.
|
max
|
Maximum results (optional)
|
The maximum number you’d like to receive (if not specified, all available results for the requested stop or station will be returned)
|
rt
|
Route code (optional)
|
Allows you to specify a single route for which you’d like results (if not specified, all available results for the requested stop or station will be returned)
|
key
|
Alphanumeric API key
(required)
|
Your unique API key, assigned to you after agreeing to DLA and requesting a key be generated for you.
|
Response fields:
Name
|
Description
|
ctatt
|
Root element
|
./tmst
|
Shows time when response was generated in format:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
./errCd
|
Numeric error code (see appendices)
|
./errNm
|
Textual error description/message (see appendices)
|
./eta
|
Container element (one per individual prediction)
|
././staId
|
Numeric GTFS parent station ID which this prediction is for (five digits in 4xxxx range) (matches “mapid” specified by requestor in query)
|
././stpId
|
Numeric GTFS unique stop ID within station which this prediction is for (five digits in 3xxxx range)
|
././staNm
|
Textual proper name of parent station
|
././stpDe
|
Textual description of platform for which this prediction applies
|
././rn
|
Run number of train being predicted for
|
././rt
|
Textual, abbreviated route name of train being predicted for (matches GTFS routes)
|
././destSt
|
GTFS unique stop ID where this train is expected to ultimately end its service run (experimental and supplemental only—see note below)
|
././destNm
|
Friendly destination description (see note below)
|
././trDr
|
Numeric train route direction code (see appendices)
|
././prdt
|
Date-time format stamp for when the prediction was generated:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
././arrT
|
Date-time format stamp for when a train is expected to arrive/depart:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
././isApp
|
Indicates that Train Tracker is now declaring “Approaching” or “Due” on site for this train
|
././isSch
|
Boolean flag to indicate whether this is a live prediction or based on schedule in lieu of live data
|
././isFlt
|
Boolean flag to indicate whether a potential fault has been detected (see note below)
|
././isDly
|
Boolean flag to indicate whether a train is considered “delayed” in Train Tracker
|
././flags |
Train flags (not presently in use) |
././lat |
Latitude position of the train in decimal degrees |
././lon |
Longitude position of the train in decimal degrees |
././heading |
Heading, expressed in standard bearing degrees (0 = North, 90 = East, 180 = South, and 270 = West; range is 0 to 359, progressing clockwise) |
Sample Request URL:
http://lapi.transitchicago.com/api/1.0/ttarrivals.aspx?key=a8456dcbhf8475683cf7818bca81&mapid=40380&max=5
Remarks:
Stop IDs:
Use stop information in GTFS Stops table for associated geolocation of stops listed here. For purposes of this API, use the parent station ID (4xxxx range of stop ID numbers) to specify a station.
Destination station ID #s:
IDs in destSt refer to the ultimate destination of a train per the information about each train that’s on the move.
These destination station ID #s are only available once a train has departed (on schedule-based predictions, this element will show “0”) and doesn’t necessarily match with what will be indicated on a train’s destination sign (particularly on routes that operate around the whole Loop).
Once a train leaves Midway, its ultimate destination station’s ID is “Midway” because the train will make all stops to the Loop, go around it, and come back to Midway. This allows you to write your own logic on what to show, but we’ve already gone and done the work for you.
The destNm element is the public, friendly-name that should match the destination sign of approaching trains. For example, predictions a train heading toward the Loop on the Orange Line, using this element, will return “Loop” in a result set at Roosevelt, but that same train, even while still Loop-bound, will be listed as being to “Midway” for Harold Washington Library/State-Van Buren, because our system knows that once it gets to Library, it’ll now be considered a Midway-bound train.
Lat/lon/heading: This information is available only for trains that are in-service (i.e., have left their terminals). Some entries are based on our written schedule, as a courtesy, for when live information isn’t available. Schedule-based entries in a response will simply have an empty lat, lon and heading element as location info isn’t available.
Calculating a number of minutes: See Appendix D for extended notes on this subject.
XML Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ctatt">
<xs:complexType>
<xs:sequence>
<xs:element name="tmst" type="xs:string" />
<xs:element name="errCd" type="xs:unsignedByte" />
<xs:element name="errNm" />
<xs:element maxOccurs="unbounded" name="eta">
<xs:complexType>
<xs:sequence>
<xs:element name="staId" type="xs:unsignedShort" />
<xs:element name="stpId" type="xs:unsignedShort" />
<xs:element name="staNm" type="xs:string" />
<xs:element name="stpDe" type="xs:string" />
<xs:element name="rn" type="xs:unsignedShort" />
<xs:element name="rt" type="xs:string" />
<xs:element name="destSt" type="xs:unsignedShort" />
<xs:element name="destNm" type="xs:string" />
<xs:element name="trDr" type="xs:unsignedByte" />
<xs:element name="prdt" type="xs:string" />
<xs:element name="arrT" type="xs:string" />
<xs:element name="isApp" type="xs:unsignedByte" />
<xs:element name="isSch" type="xs:unsignedByte" />
<xs:element name="isDly" type="xs:unsignedByte" />
<xs:element name="isFlt" type="xs:unsignedByte" />
<xs:element name="flags" type="xs:string" />
<xs:element name="lat" type="xs:decimal" />
<xs:element name="lon" type="xs:decimal" />
<xs:element name="heading" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Example
What this request is asking for:
A maximum of one arrival prediction result from the station with the ID #40360. It also passes the API key for authorization (required).
XML Request:
http://lapi.transitchicago.com/api/1.0/ttarrivals.aspx?key=a8456dcbhf8475683cf7818bca81&max=1&mapid=40360
XML Response:
<?xml version="1.0" encoding="UTF-8"?>
<ctatt>
<tmst>20110618 23:26:50</tmst>
<errCd>0</errCd>
<errNm/>
<eta>
<staId>40360</staId>
<stpId>30070</stpId>
<staNm>Southport</staNm>
<stpDe>Service toward Kimball</stpDe>
<rn>419</rn>
<rt>Brn</rt>
<destSt>30249</destSt>
<destNm>Kimball</destNm>
<trDr>1</trDr>
<prdt>20110618 23:26:12</prdt>
<arrT>20110618 23:28:12</arrT>
<isApp>0</isApp>
<isSch>0</isSch>
<isDly>0</isDly>
<isFlt>0</isFlt>
<flags/>
<lat>41.97776</lat>
<lon>-87.77567</lon>
<heading>
299</heading>
</eta>
</ctatt>
JSON Request:
http://lapi.transitchicago. com/api/1.0/ttarrivals.aspx?key=e3875818a4743049&max=1& mapid=40360&outputType=JSON
JSON Response:
{
"ctatt":{
"tmst":"2015-04-30T20:23:53",
"errCd":"0",
"errNm":null,
"eta":[
{
"staId":"40960",
"stpId":"30185",
"staNm":"Pulaski",
"stpDe":"Service toward Loop",
"rn":"726",
"rt":"Org",
"destSt":"30182",
"destNm":"Loop",
"trDr":"1",
"prdt":"2015-04-30T20:23:32",
"arrT":"2015-04-30T20:25:32",
"isApp":"0",
"isSch":"0",
"isDly":"0",
"isFlt":"0",
"flags":null,
"lat":"41.78661",
"lon":"-87.73796",
"heading":"357"
}
]
}
}
Follow This Train API
Description
This API produces a list of arrival predictions for a given train at all subsequent stations for which that train is estimated to arrive, up to 60 minutes in the future or to the end of its trip.
Each separate prediction describes a single train, when it’s expected to arrive, and various bits of information that explain where it’s expected to arrive and certain attributes about the train.
Base URL
lapi.transitchicago.com/api/1.0/ttfollow.aspx
Parameters
Use URL query string method.
Name
|
Value
|
Description
|
runnumber
|
Train Run Number (required)
|
Allows you to specify a single run number for a train for which you’d like a series of upcoming arrival estimations.
|
key
|
Alphanumeric API key
(required)
|
Your unique API key, assigned to you after agreeing to DLA and requesting a key be generated for you.
|
Response fields:
Name
|
Description
|
ctatt
|
Root element
|
./tmst
|
Shows time when response was generated in format:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
./errCd
|
Numeric error code (see appendices)
|
./errNm
|
Textual error description/message (see appendices)
|
./position |
Container element (one per response describing train) |
././lat |
Latitude position of the train in decimal degrees |
././lon |
Longitude position of the train in decimal degrees |
././heading |
Heading, expressed in standard bearing degrees (0 = North, 90 = East, 180 = South, and 270 = West; range is 0 to 359, progressing clockwise) |
./eta
|
Container element (one per individual prediction)
|
././staId
|
Numeric GTFS parent station ID which this prediction is for (five digits in 4xxxx range) (matches “mapid” specified by requestor in query)
|
././stpId
|
Numeric GTFS unique stop ID within station which this prediction is for (five digits in 3xxxx range)
|
././staNm
|
Textual proper name of parent station
|
././stpDe
|
Textual description of platform for which this prediction applies
|
././rn
|
Run number of train being predicted for
|
././rt
|
Textual, abbreviated route name of train being predicted for (matches GTFS routes)
|
././destSt
|
GTFS unique stop ID where this train is expected to ultimately end its service run (experimental and supplemental only—see note below)
|
././destNm
|
Friendly destination description (see note below)
|
././trDr
|
Numeric train route direction code (see appendices)
|
././prdt
|
Date-time format stamp for when the prediction was generated:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
././arrT
|
Date-time format stamp for when a train is expected to arrive/depart:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
././isApp
|
Indicates that Train Tracker is now declaring “Approaching” or “Due” on site for this train
|
././isSch
|
Boolean flag to indicate whether this is a live prediction or based on schedule in lieu of live data
|
././isFlt
|
Boolean flag to indicate whether a potential fault has been detected (see note below)
|
././isDly
|
Boolean flag to indicate whether a train is considered “delayed” in Train Tracker
|
././flags |
Train flags (not presently in use) |
Sample Request URL:
Remarks:
Stop IDs: Use stop information in GTFS Stops table for associated geolocation of stops listed here. For purposes of this API, use the parent station ID (4xxxx range of stop ID numbers) to specify a station.
Destination station ID #s: in destSt refer to the ultimate destination of a train per the information about each train that’s on the move.
These destination station ID #s are only available once a train has departed (on schedule-based predictions, this element will show “0”) and doesn’t necessarily match with what will be indicated on a train’s destination sign (particularly on routes that operate around the whole Loop).
Once a train leaves Midway, its ultimate destination station’s ID is “Midway” because the train will make all stops to the Loop, go around it, and come back to Midway. This allows you to write your own logic on what to show, but we’ve already gone and done the work for you.
The destNm element is the public, friendly-name that should match the destination sign of approaching trains. For example, predictions a train heading toward the Loop on the Orange Line, using this element, will return “Loop” in a result set at Roosevelt, but that same train, even while still Loop-bound, will be listed as being to “Midway” for Harold Washington Library/State-Van Buren, because our system knows that once it gets to Library, it’ll now be considered a Midway-bound train.
Calculating a number of minutes: See Appendix D for extended notes on this subject.
XML Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ctatt">
<xs:complexType>
<xs:sequence>
<xs:element name="tmst" type="xs:string" />
<xs:element name="errCd" type="xs:unsignedByte" />
<xs:element name="errNm" />
<xs:element name="position" />
<xs:complexType>
<xs:sequence>
<xs:element name="lat" type="xs:decimal" />
<xs:element name="lon" type="xs:decimal" />
<xs:element name="heading" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="eta">
<xs:complexType>
<xs:sequence>
<xs:element name="staId" type="xs:unsignedShort" />
<xs:element name="stpId" type="xs:unsignedShort" />
<xs:element name="staNm" type="xs:string" />
<xs:element name="stpDe" type="xs:string" />
<xs:element name="rn" type="xs:unsignedByte" />
<xs:element name="rt" type="xs:string" />
<xs:element name="destSt" type="xs:unsignedShort" />
<xs:element name="destNm" type="xs:string" />
<xs:element name="trDr" type="xs:unsignedByte" />
<xs:element name="prdt" type="xs:string" />
<xs:element name="arrT" type="xs:string" />
<xs:element name="isApp" type="xs:unsignedByte" />
<xs:element name="isSch" type="xs:unsignedByte" />
<xs:element name="isDly" type="xs:unsignedByte" />
<xs:element name="isFlt" type="xs:unsignedByte" />
<xs:element name="flags" type="xs:string" />
<xs:element name="lat" type="xs:decimal" />
<xs:element name="lon" type="xs:decimal" />
<xs:element name="heading" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Example
What this request is asking for:
Upcoming arrivals for a specific run (123, a Blue Line train in the XML example, or 830, a Red Line train, in the JSON example). It also passes the API key for authorization (required).
(For brevity, what would be a longer series of “eta” sequence element is limited to two in this example.)
XML response:
<?xml version="1.0" encoding="utf-8" ?>
<ctatt>
<tmst>20130515 14:11:17</tmst>
<errCd>0</errCd>
<errNm />
<position>
<lat>41.97776</lat>
<lon>-87.77567</lon>
<heading>299</heading>
</position>
<eta>
<staId>40010</staId>
<stpId>30001</stpId>
<staNm>Austin</staNm>
<stpDe>Austin to O'Hare</stpDe>
<rn>123</rn>
<rt>Blue Line</rt>
<destSt>30171</destSt>
<destNm>O'Hare</destNm>
<trDr>1</trDr>
<prdt>20130515 14:10:23</prdt>
<arrT>20130515 14:11:23</arrT>
<isApp>1</isApp>
<isSch>0</isSch>
<isDly>0</isDly>
<isFlt>0</isFlt>
<flags/>
</eta>
<eta>
<staId>40970</staId>
<stpId>30187</stpId>
<staNm>Cicero</staNm>
<stpDe>Cicero to O'Hare</stpDe>
<rn>123</rn>
<rt>Blue Line</rt>
<destSt>30171</destSt>
<destNm>O'Hare</destNm>
<trDr>1</trDr>
<prdt>20130515 14:10:23</prdt>
<arrT>20130515 14:15:23</arrT>
<isApp>0</isApp>
<isSch>0</isSch>
<isDly>0</isDly>
<isFlt>0</isFlt>
<flags/>
</eta>
</ctatt>
JSON request:
http://lapi.transitchicago.com/api/1.0/ttfollow.aspx?key=e3875818a474304&runnumber=830&outputType=JSON
JSON response (for run 830):
{
"ctatt":{
"tmst":"2015-04-30T20:28:37",
"errCd":"0",
"errNm":null,
"position":{
"lat":"42.01588",
"lon":"-87.66909",
"heading":"310"
},
"eta":[
{
"staId":"40900",
"stpId":"30173",
"staNm":"Howard",
"stpDe":"Howard (Red Line Terminal Arrival)",
"rn":"830",
"rt":"Red Line",
"destSt":"30173",
"destNm":"Howard",
"trDr":"1",
"prdt":"2015-04-30T20:27:58",
"arrT":"2015-04-30T20:28:58",
"isApp":"1",
"isSch":"0",
"isDly":"0",
"isFlt":"0",
"flags":null
}
]
}
}
Locations API
Description
This API produces a list of in-service trains and basic info and their locations for one or more specified ‘L’ routes.
Each separate entry describes a single train and provides coordinate, geospatial heading, certain train attributes and next stop information.
Base URL
lapi.transitchicago.com/api/1.0/ttpositions.aspx
Parameters:
Use URL query string method.
Name
|
Value
|
Description
|
rt
|
Train route(s) (required)
|
Allows you to specify one or more routes for which you’d like train location information.
|
key
|
Alphanumeric API key
(required)
|
Your unique API key, assigned to you after agreeing to DLA and requesting a key be generated for you.
|
Response fields:
Name
|
Description
|
ctatt
|
Root element
|
./tmst
|
Shows time when response was generated in format:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
./errCd
|
Numeric error code (see appendices)
|
./errNm
|
Textual error description/message (see appendices)
|
./route name=
|
Container element (one per route in response), name attribute indicates route per GTFS-matching route identifiers (see appendices)
|
././train
|
Container element (one per train in response)
|
./././rn
|
Run number
|
./././destSt
|
GTFS unique stop ID where this train is expected to ultimately end its service run (experimental and supplemental only—see note below)
|
./././destNm
|
Friendly destination description (see note below)
|
./././trDr
|
Numeric train route direction code (see appendices)
|
./././nextStaId
|
Next station ID (parent station ID matching GTFS)
|
./././nextStpId
|
Next stop ID (stop ID matching GTFS)
|
./././nextStaNm
|
Proper name of next station
|
./././prdt
|
Date-time format stamp for when the prediction was generated:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
./././arrT
|
Date-time format stamp for when a train is expected to arrive/depart:
yyyyMMdd HH:mm:ss (24-hour format, time local to Chicago)
|
./././isApp
|
Indicates that Train Tracker is now declaring “Approaching” or “Due” on site for this train
|
./././isDly
|
Boolean flag to indicate whether a train is considered “delayed” in Train Tracker
|
./././flags
|
Train flags (not presently in use)
|
./././lat
|
Latitude position of the train in decimal degrees
|
./././lon
|
Longitude position of the train in decimal degrees
|
./././heading
|
Heading, expressed in standard bearing degrees (0 = North, 90 = East, 180 = South, and 270 = West; range is 0 to 359, progressing clockwise)
|
XML Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ctatt">
<xs:complexType>
<xs:sequence>
<xs:element name="tmst" type="xs:string" />
<xs:element name="errCd" type="xs:unsignedByte" />
<xs:element name="errNm" />
<xs:element maxOccurs="unbounded" name="route">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="train">
<xs:complexType>
<xs:sequence>
<xs:element name="rn" type="xs:unsignedShort" />
<xs:element name="destSt" type="xs:unsignedShort" />
<xs:element name="destNm" type="xs:string" />
<xs:element name="trDr" type="xs:unsignedByte" />
<xs:element name="nextStaId" type="xs:unsignedShort" />
<xs:element name="nextStpId" type="xs:unsignedShort" />
<xs:element name="nextStaNm" type="xs:string" />
<xs:element name="prdt" type="xs:string" />
<xs:element name="arrT" type="xs:string" />
<xs:element name="isApp" type="xs:unsignedByte" />
<xs:element name="isDly" type="xs:unsignedByte" />
<xs:element name="flags" type="xs:string" />
<xs:element name="lat" type="xs:decimal" />
<xs:element name="lon" type="xs:decimal" />
<xs:element name="heading" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Example:
XML Response:
<?xml version="1.0" encoding="utf-8" ?>
<ctatt>
<tmst>20130610 15:00:21</tmst>
<errCd>0</errCd>
<errNm />
<route name="red">
<train>
<rn>804</rn>
<destSt>30173</destSt>
<destNm>Howard</destNm>
<trDr>1</trDr>
<nextStaId>41400</nextStaId>
<nextStpId>30269</nextStpId>
<nextStaNm>Roosevelt</nextStaNm>
<prdt>20130610 14:58:48</prdt>
<arrT>20130610 14:59:48</arrT>
<isApp>1</isApp>
<isDly>0</isDly>
<flags />
<lat>41.86579</lat>
<lon>-87.62736</lon>
<heading>358</heading>
</train>
<train>
<rn>808</rn>
<destSt>30173</destSt>
<destNm>Howard</destNm>
<trDr>1</trDr>
<nextStaId>40510</nextStaId>
<nextStpId>30099</nextStpId>
<nextStaNm>Garfield</nextStaNm>
<prdt>20130610 14:58:03</prdt>
<arrT>20130610 15:00:03</arrT>
<isApp>0</isApp>
<isDly>0</isDly>
<flags />
<lat>41.78697</lat>
<lon>-87.6187</lon>
<heading>81</heading>
</train>
</route>
</ctatt>
JSON Request:
http://lapi.transitchicago.com/api/1.0/ttpositions.aspx?key=4ba28f6b2b8843bf9cef1c0fcc05f874&rt=red&outputType=JSON
JSON Response:
{
"ctatt":{
"tmst":"2015-04-30T20:29:44",
"errCd":"0",
"errNm":null,
"route":[
{
"@name":"red",
"train":[
{
"rn":"827",
"destSt":"30173",
"destNm":"Howard",
"trDr":"1",
"nextStaId":"40650",
"nextStpId":"30125",
"nextStaNm":"North/Clybourn",
"prdt":"2015-04-30T20:29:24",
"arrT":"2015-04-30T20:31:24",
"isApp":"0",
"isDly":"0",
"flags":null,
"lat":"41.90383",
"lon":"-87.63685",
"heading":"269"
}
]
}
]
}
}
Appendices
Appendix A: Route ID Quick Reference
CTA ‘L’
‘L’ routes (rapid transit train services) are identified as follows:
- Red = Red Line (Howard-95th/Dan Ryan service)
- Blue = Blue Line (O’Hare-Forest Park service)
- Brn = Brown Line (Kimball-Loop service)
- G = Green Line (Harlem/Lake-Ashland/63rd-Cottage Grove service)
- Org = Orange Line (Midway-Loop service)
- P = Purple Line (Linden-Howard shuttle service)
- Pink = Pink Line (54th/Cermak-Loop service)
- Y = Yellow Line (Skokie-Howard [Skokie Swift] shuttle service)
Note: In the separate Customer Alerts API, alerts that apply specifically to the Purple Line Express (but not Purple Line Local/Shuttle service north of Howard) will use the additional route designator “Pexp”. When integrating Customer Alert information into your code project, be sure to account that alerts applying to the Purple Line may have either route designator “P” or “Pexp” (or both).
Appendix B: Station IDs
Each bus or train stop on the CTA system, as you’ll see if you look at the “stops” table in our Google Transit Feed Specification feed, has its own unique identifier. This helps to power trip planners such as the Google Maps transit directions capability in identifying individual locations and paths where vehicles make stops along a route in each direction.
Note, however, that in the GTFS data, most train stations have three entries in the stops table—one in each direction, with a third entry that covers the entire station facility, known as the “parent stop.” We’ve numbered our stops differently, using the following convention:
0-29999 = Bus stops
30000-39999 = Train stops
40000-49999 = Train stations (parent stops)
The API accepts and responds with both train stop IDs and station IDs to allow you maximum flexibility in how you build your application.
More help
A
complete list of CTA 'L' stops is also available from the City of Chicago's Data Portal, which offers API's to download these lists in machine-readable formats.
Example from GTFS
For example, Southport, on the Brown Line has three entries in our GTFS table (only relevant rows shown here):
stop_id,stop_code,stop_name,stop_lat,stop_lon,location_type,parent_station,wheelchair_boarding
30070,,"Southport",41.943744,-87.663619,0,40360,1
30071,,"Southport",41.943744,-87.663619,0,40360,1
40360,,"Southport",41.943744,-87.663619,1,,1
The first two represent specific stops in GTFS—one for each direction from the Southport station (toward Loop or toward Kimball).
The third entry is the associated parent station GTFS, which represents the entire station facility known as “Southport” inside of which these separate “stops” are grouped.
Note that while Southport’s parent entry and individual stop entries all have the same basic attributes, this may vary in some stations for map clarity and to assist trip planners (particularly where bus stops also reference a parent station at a larger transfer facility like the transit center at Jefferson Park).
How these look in the API
In the Arrivals API, for example, responses for Southport might include either:
<staId>40360</staId>
<stpId>30071</stpId>
<staNm>Southport</staNm>
<stpDe>Service toward Loop</stpDe>
Or
<staId>40360</staId>
<stpId>30070</stpId>
<staNm>Southport</staNm>
<stpDe>Service toward Kimball</stpDe>
This allows you to reference GTFS for a variety of things, and also provides you additional descriptive information which helps you explain results to your customers, depending on how you wish to present them.
Parent Stop ID Quick Reference
This is a list of the parent stops and their associated ID# in GTFS.
A complete list of CTA 'L' stops is also available from the City of Chicago's Data Portal, which offers API's to download these lists in machine-readable formats.
Descriptive station name
|
StopID
|
18th |
40830 |
35th-Bronzeville-IIT |
41120 |
35th/Archer |
40120 |
43rd |
41270 |
47th (Green Line) |
41080 |
47th (Red Line) |
41230 |
51st |
40130 |
54th/Cermak |
40580 |
63rd |
40910 |
69th |
40990 |
79th |
40240 |
87th |
41430 |
95th |
40450 |
Adams/Wabash |
40680 |
Addison (Blue Line) |
41240 |
Addison (Brown Line) |
41440 |
Addison (Red Line) |
41420 |
Argyle |
41200 |
Armitage |
40660 |
Ashland/63rd |
40290 |
Ashland (Green, Pink Lines) |
40170 |
Ashland (Orange Line) |
41060 |
Austin (Blue Line) |
40010 |
Austin (Green Line) |
41260 |
Belmont (Red, Brown, Purple Lines) |
41320 |
Belmont (Blue Line) |
40060 |
Berwyn |
40340 |
Bryn Mawr |
41380 |
California (Pink Line) |
40440 |
California (Green Line) |
41360 |
California (Blue Line-O'Hare Branch) |
40570 |
Central Park |
40780 |
Central (Green Line) |
40280 |
Central (Purple Line) |
41250 |
Cermak-Chinatown |
41000 |
Cermak-McCormick Place |
41690 |
Chicago (Blue Line) |
41410 |
Chicago (Brown Line) |
40710 |
Chicago (Red Line) |
41450 |
Cicero (Pink Line) |
40420 |
Cicero (Blue Line-Forest Park Branch) |
40970 |
Cicero (Green Line) |
40480 |
Clark/Division |
40630 |
Clark/Lake |
40380 |
Clinton (Blue Line) |
40430 |
Clinton (Green Line) |
41160 |
Conservatory |
41670 |
Cumberland |
40230 |
Damen (Brown Line) |
40090 |
Damen (Green Line) |
41710 |
Damen (Pink Line) |
40210 |
Damen (Blue Line-O'Hare Branch) |
40590 |
Davis |
40050 |
Dempster |
40690 |
Dempster-Skokie |
40140 |
Diversey |
40530 |
Division |
40320 |
Cottage Grove |
40720 |
Forest Park |
40390 |
Foster |
40520 |
Francisco |
40870 |
Fullerton |
41220 |
Garfield (Green Line) |
40510 |
Garfield (Red Line) |
41170 |
Grand (Blue Line) |
40490 |
Grand (Red Line) |
40330 |
Granville |
40760 |
Halsted (Green Line) |
40940 |
Halsted (Orange Line) |
41130 |
Harlem (Blue Line-Forest Park Branch) |
40980 |
Harlem (Green Line) |
40020 |
Harlem (Blue Line-O'Hare Branch) |
40750 |
Harold Washington Library-State/Van Buren |
40850 |
Harrison |
41490 |
Howard |
40900 |
Illinois Medical District |
40810 |
Indiana |
40300 |
Irving Park (Blue Line) |
40550 |
Irving Park (Brown Line) |
41460 |
Jackson (Blue Line) |
40070 |
Jackson (Red Line) |
40560 |
Jarvis |
41190 |
Jefferson Park |
41280 |
Kedzie (Brown Line) |
41180 |
Kedzie (Pink Line) |
41040 |
Kedzie (Green Line) |
41070 |
Kedzie-Homan (Blue Line) |
40250 |
Kedzie (Orange Line) |
41150 |
Kimball |
41290 |
King Drive |
41140 |
Kostner |
40600 |
Lake |
41660 |
Laramie |
40700 |
LaSalle |
41340 |
LaSalle/Van Buren |
40160 |
Lawrence |
40770 |
Linden |
41050 |
Logan Square |
41020 |
Loyola |
41300 |
Main |
40270 |
Midway |
40930 |
Monroe (Blue Line) |
40790 |
Monroe (Red Line) |
41090 |
Montrose (Blue Line) |
41330 |
Montrose (Brown Line) |
41500 |
Morgan |
41510 |
Morse |
40100 |
North/Clybourn |
40650 |
Noyes |
40400 |
Oak Park (Blue Line) |
40180 |
Oak Park (Green Line) |
41350 |
Oakton-Skokie |
41680 |
O'Hare |
40890 |
Paulina |
41310 |
Polk |
41030 |
Pulaski (Pink Line) |
40150 |
Pulaski (Blue Line-Forest Park Branch) |
40920 |
Pulaski (Green Line) |
40030 |
Pulaski (Orange Line) |
40960 |
Quincy/Wells |
40040 |
Racine |
40470 |
Ridgeland |
40610 |
Rockwell |
41010 |
Roosevelt |
41400 |
Rosemont |
40820 |
Sedgwick |
40800 |
Sheridan |
40080 |
South Boulevard |
40840 |
Southport |
40360 |
Sox-35th |
40190 |
State/Lake |
40260 |
Thorndale |
40880 |
UIC-Halsted |
40350 |
Washington/Wabash |
41700 |
Washington/Wells |
40730 |
Washington (Blue Line) |
40370 |
Wellington |
41210 |
Western (Brown Line) |
41480 |
Western (Pink Line) |
40740 |
Western (Blue Line-Forest Park Branch) |
40220 |
Western (Blue Line-O'Hare Branch) |
40670 |
Western (Orange Line) |
40310 |
Wilson |
40540 |
Individual Stop IDs Quick Reference
This is a list of the parent stops and their associated ID# in GTFS.
A complete list of CTA 'L' stops is also available from the City of Chicago's Data Portal, which offers API's to download these lists in machine-readable formats.
Stop_ID
|
Descriptive Stop Name
|
Normal traffic flow to:
|
Parent Stop_ID
|
30162 |
18th |
West |
40830 |
30161 |
18th |
East |
40830 |
30214 |
35-Bronzeville-IIT |
South |
41120 |
30213 |
35-Bronzeville-IIT |
North |
41120 |
30023 |
35th/Archer |
South |
40120 |
30022 |
35th/Archer |
North |
40120 |
30246 |
43rd |
South |
41270 |
30245 |
43rd |
North |
41270 |
30209 |
47th (Green Line) |
North |
41080 |
30210 |
47th (Green Line) |
South |
41080 |
30237 |
47th (Red Line) |
North |
41230 |
30238 |
47th (Red Line) |
South |
41230 |
30024 |
51st |
North |
40130 |
30025 |
51st |
South |
40130 |
30114 |
54th/Cermak |
West |
40580 |
30113 |
54th/Cermak |
East |
40580 |
30177 |
63rd |
North |
40910 |
30178 |
63rd |
South |
40910 |
30192 |
69th |
South |
40990 |
30191 |
69th |
North |
40990 |
30046 |
79th |
North |
40240 |
30047 |
79th |
South |
40240 |
30276 |
87th |
South |
41430 |
30275 |
87th |
North |
41430 |
30088 |
95th |
North |
40450 |
30089 |
95th |
South |
40450 |
30131 |
Adams/Wabash |
North (Outer Loop) |
40680 |
30132 |
Adams/Wabash |
South (Inner Loop) |
40680 |
30240 |
Addison (Blue Line) |
South |
41240 |
30239 |
Addison (Blue Line) |
North |
41240 |
30278 |
Addison (Brown Line) |
South |
41440 |
30277 |
Addison (Brown Line) |
North |
41440 |
30273 |
Addison (Red Line) |
North |
41420 |
30274 |
Addison (Red Line) |
South |
41420 |
30230 |
Argyle |
South |
41200 |
30229 |
Argyle |
North |
41200 |
30127 |
Armitage |
North |
40660 |
30128 |
Armitage |
South |
40660 |
30056 |
Ashland/63rd |
East |
40290 |
30057 |
Ashland/63rd |
West |
40290 |
30033 |
Ashland (Green, Pink Lines) |
West |
40170 |
30032 |
Ashland (Green, Pink Lines) |
East |
40170 |
30205 |
Ashland (Orange Line) |
North |
41060 |
30206 |
Ashland (Orange Line) |
South |
41060 |
30001 |
Austin (Blue Line) |
East |
40010 |
30002 |
Austin (Blue Line) |
West |
40010 |
30243 |
Austin (Green Line) |
East |
41260 |
30244 |
Austin (Green Line) |
West |
41260 |
30255 |
Belmont |
North |
41320 |
30256 |
Belmont |
South |
41320 |
30257 |
Belmont |
North |
41320 |
30258 |
Belmont |
South |
41320 |
30013 |
Belmont (Blue Line) |
South |
40060 |
30012 |
Belmont (Blue Line) |
North |
40060 |
30067 |
Berwyn |
South |
40340 |
30066 |
Berwyn |
North |
40340 |
30267 |
Bryn Mawr |
North |
41380 |
30268 |
Bryn Mawr |
South |
41380 |
30087 |
California (Pink Line) |
West |
40440 |
30086 |
California (Pink Line) |
East |
40440 |
30266 |
California (Green Line) |
West |
41360 |
30265 |
California (Green Line) |
East |
41360 |
30111 |
California (Blue Line-O'Hare Branch) |
North |
40570 |
30112 |
California (Blue Line-O'Hare Branch) |
South |
40570 |
30151 |
Central Park |
East |
40780 |
30152 |
Central Park |
West |
40780 |
30054 |
Central (Green Line) |
East |
40280 |
30055 |
Central (Green Line) |
West |
40280 |
30241 |
Central-Purple |
North |
41250 |
30242 |
Central-Purple |
South |
41250 |
30194 |
Cermak-Chinatown |
South |
41000 |
30193 |
Cermak-Chinatown |
North |
41000 |
30381 |
Cermak-McCormick Place |
North |
41690 |
30382 |
Cermak-McCormick Place |
South |
41690 |
30271 |
Chicago (Blue Line) |
North |
41410 |
30272 |
Chicago (Blue Line) |
South |
41410 |
30137 |
Chicago (Brown Line) |
North |
40710 |
30138 |
Chicago (Brown Line) |
South |
40710 |
30280 |
Chicago (Red Line) |
South |
41450 |
30279 |
Chicago (Red Line) |
North |
41450 |
30082 |
Cicero (Pink Line) |
East |
40420 |
30083 |
Cicero (Pink Line) |
West |
40420 |
30188 |
Cicero-Forest Park |
West |
40970 |
30187 |
Cicero-Forest Park |
East |
40970 |
30009 |
Cicero (Green Line) |
West |
40480 |
30094 |
Cicero (Green Line) |
East |
40480 |
30122 |
Clark/Division |
South |
40630 |
30121 |
Clark/Division |
North |
40630 |
30074 |
Clark/Lake (Elevated) |
East (Inner Loop) |
40380 |
30075 |
Clark/Lake (Elevated) |
West (Outer Loop) |
40380 |
30375 |
Clark/Lake (Subway) |
North |
40380 |
30374 |
Clark/Lake (Subway) |
South |
40380 |
30084 |
Clinton (Blue Line) |
East |
40430 |
30085 |
Clinton (Blue Line) |
West |
40430 |
30221 |
Clinton (Green, Pink Lines) |
East |
41160 |
30222 |
Clinton (Green, Lines) |
West |
41160 |
30291 |
Conservatory |
East |
41670 |
30292 |
Conservatory |
West |
41670 |
30045 |
Cumberland |
South |
40230 |
30044 |
Cumberland |
North |
40230 |
30018 |
Damen (Brown Line) |
North |
40090 |
30019 |
Damen (Brown Line) |
South |
40090 |
30387 |
Damen (Green Line) |
East |
41710 |
30388 |
Damen (Green Line) |
West |
41710 |
30040 |
Damen (Pink Line) |
East |
40210 |
30041 |
Damen (Pink Line) |
West |
40210 |
30116 |
Damen (Blue Line-O'Hare Branch) |
South |
40590 |
30115 |
Damen (Blue Line-O'Hare Branch) |
North |
40590 |
30010 |
Davis |
North |
40050 |
30011 |
Davis |
South |
40050 |
30134 |
Dempster |
South |
40690 |
30133 |
Dempster |
North |
40690 |
30026 |
Dempster-Skokie |
North |
40140 |
30027 |
Dempster-Skokie |
South |
40140 |
30103 |
Diversey |
North |
40530 |
30104 |
Diversey |
South |
40530 |
30062 |
Division |
North |
40320 |
30063 |
Division |
South |
40320 |
30139 |
Cottage Grove |
East |
40720 |
30140 |
Cottage Grove |
West |
40720 |
30077 |
Forest Park |
West |
40390 |
30076 |
Forest Park |
East |
40390 |
30101 |
Foster |
North |
40520 |
30102 |
Foster |
South |
40520 |
30168 |
Francisco |
South |
40870 |
30167 |
Francisco |
North |
40870 |
30233 |
Fullerton |
North |
41220 |
30236 |
Fullerton |
South |
41220 |
30235 |
Fullerton |
North |
41220 |
30234 |
Fullerton |
South |
41220 |
30099 |
Garfield (Green Line) |
North |
40510 |
30100 |
Garfield (Green Line) |
South |
40510 |
30223 |
Garfield (Red Line) |
North |
41170 |
30224 |
Garfield (Red Line) |
South |
41170 |
30096 |
Grand (Blue Line) |
South |
40490 |
30095 |
Grand (Blue Line) |
North |
40490 |
30064 |
Grand (Red Line) |
North |
40330 |
30065 |
Grand (Red Line) |
South |
40330 |
30148 |
Granville |
South |
40760 |
30147 |
Granville |
North |
40760 |
30184 |
Halsted (Green Line) |
West |
40940 |
30183 |
Halsted (Green Line) |
East |
40940 |
30215 |
Halsted (Orange Line) |
North |
41130 |
30216 |
Halsted (Orange Line) |
South |
41130 |
30189 |
Harlem-Forest Park |
East |
40980 |
30190 |
Harlem-Forest Park |
West |
40980 |
30004 |
Harlem (Green Line) |
West |
40020 |
30003 |
Harlem (Green Line) |
East |
40020 |
30145 |
Harlem (Blue Line-O'Hare Branch) |
North |
40750 |
30146 |
Harlem (Blue Line-O'Hare Branch) |
South |
40750 |
30165 |
Harold Washington Library-State/Van Buren |
East (Outer Loop) |
40850 |
30166 |
Harold Washington Library-State/Van Buren |
West (Inner Loop) |
40850 |
30285 |
Harrison |
North |
41490 |
30286 |
Harrison |
South |
41490 |
30176 |
Howard |
South |
40900 |
30175 |
Howard |
North |
40900 |
30173 |
Howard |
North |
40900 |
30174 |
Howard |
South |
40900 |
30158 |
Illinois Medical District |
West |
40810 |
30157 |
Illinois Medical District |
East |
40810 |
30059 |
Indiana |
South |
40300 |
30058 |
Indiana |
North |
40300 |
30107 |
Irving Park (Blue Line) |
North |
40550 |
30108 |
Irving Park (Blue Line) |
South |
40550 |
30282 |
Irving Park (Brown Line) |
South |
41460 |
30281 |
Irving Park (Brown Line) |
North |
41460 |
30015 |
Jackson (Blue Line) |
South |
40070 |
30014 |
Jackson (Blue Line) |
North |
40070 |
30110 |
Jackson (Red Line) |
South |
40560 |
30109 |
Jackson (Red Line) |
North |
40560 |
30228 |
Jarvis |
South |
41190 |
30227 |
Jarvis |
North |
41190 |
30248 |
Jefferson Park |
South |
41280 |
30247 |
Jefferson Park |
North |
41280 |
30225 |
Kedzie (Brown Line) |
North |
41180 |
30226 |
Kedzie (Brown Line) |
South |
41180 |
30201 |
Kedzie (Pink Line) |
East |
41040 |
30202 |
Kedzie (Pink Line) |
West |
41040 |
30208 |
Kedzie (Green Line) |
West |
41070 |
30207 |
Kedzie (Green Line) |
East |
41070 |
30048 |
Kedzie-Homan |
East |
40250 |
30049 |
Kedzie-Homan |
West |
40250 |
30219 |
Kedzie (Orange Line) |
North |
41150 |
30220 |
Kedzie (Orange Line) |
South |
41150 |
30249 |
Kimball |
North |
41290 |
30250 |
Kimball |
South |
41290 |
30217 |
King Drive |
East |
41140 |
30218 |
King Drive |
West |
41140 |
30117 |
Kostner |
East |
40600 |
30118 |
Kostner |
West |
40600 |
30289 |
Lake |
North |
41660 |
30290 |
Lake |
South |
41660 |
30136 |
Laramie |
West |
40700 |
30135 |
Laramie |
East |
40700 |
30261 |
LaSalle |
East |
41340 |
30262 |
LaSalle |
West |
41340 |
30031 |
LaSalle/Van Buren |
West (Inner Loop) |
40160 |
30030 |
LaSalle/Van Buren |
East (Outer Loop) |
40160 |
30150 |
Lawrence |
South |
40770 |
30149 |
Lawrence |
North |
40770 |
30204 |
Linden |
South |
41050 |
30203 |
Linden |
North |
41050 |
30197 |
Logan Square |
North |
41020 |
30198 |
Logan Square |
South |
41020 |
30251 |
Loyola |
North |
41300 |
30252 |
Loyola |
South |
41300 |
30052 |
Main |
North |
40270 |
30053 |
Main |
South |
40270 |
30090 |
Merchandise Mart |
North |
40460 |
30091 |
Merchandise Mart |
South |
40460 |
30182 |
Midway |
South |
40930 |
30181 |
Midway |
North |
40930 |
30153 |
Monroe (Blue Line) |
North |
40790 |
30154 |
Monroe (Blue Line) |
South |
40790 |
30212 |
Monroe (Red Line) |
South |
41090 |
30211 |
Monroe (Red Line) |
North |
41090 |
30259 |
Montrose (Blue Line) |
North |
41330 |
30260 |
Montrose (Blue Line) |
South |
41330 |
30288 |
Montrose (Brown Line) |
South |
41500 |
30287 |
Montrose (Brown Line) |
North |
41500 |
30296 |
Morgan |
West |
41510 |
30295 |
Morgan |
East |
41510 |
30021 |
Morse |
South |
40100 |
30020 |
Morse |
North |
40100 |
30126 |
North/Clybourn |
South |
40650 |
30125 |
North/Clybourn |
North |
40650 |
30078 |
Noyes |
North |
40400 |
30079 |
Noyes |
South |
40400 |
30034 |
Oak Park (Blue Line) |
East |
40180 |
30035 |
Oak Park (Blue Line) |
West |
40180 |
30263 |
Oak Park (Green Line) |
East |
41350 |
30264 |
Oak Park (Green Line) |
West |
41350 |
30297 |
Oakton-Skokie |
North |
41680 |
30298 |
Oakton-Skokie |
South |
41680 |
30172 |
O'Hare |
South |
40890 |
30171 |
O'Hare |
North |
40890 |
30254 |
Paulina |
South |
41310 |
30253 |
Paulina |
North |
41310 |
30200 |
Polk |
West |
41030 |
30199 |
Polk |
East |
41030 |
30029 |
Pulaski (Pink Line) |
West |
40150 |
30028 |
Pulaski (Pink Line) |
East |
40150 |
30180 |
Pulaski (Blue Line-Forest Park Branch) |
West |
40920 |
30179 |
Pulaski (Blue Line-Forest Park Branch) |
East |
40920 |
30005 |
Pulaski (Green Line) |
East |
40030 |
30006 |
Pulaski (Green Line) |
West |
40030 |
30186 |
Pulaski (Orange Line) |
South |
40960 |
30185 |
Pulaski (Orange Line) |
North |
40960 |
30008 |
Quincy/Wells |
South (Outer Loop) |
40040 |
30007 |
Quincy/Wells |
North (Inner Loop) |
40040 |
30092 |
Racine |
East |
40470 |
30093 |
Racine |
West |
40470 |
30120 |
Ridgeland |
West |
40610 |
30119 |
Ridgeland |
East |
40610 |
30196 |
Rockwell |
South |
41010 |
30195 |
Rockwell |
North |
41010 |
30080 |
Roosevelt (Elevated) |
North |
41400 |
30081 |
Roosevelt (Elevated) |
South |
41400 |
30270 |
Roosevelt (Subway) |
South |
41400 |
30269 |
Roosevelt (Subway) |
North |
41400 |
30159 |
Rosemont |
North |
40820 |
30160 |
Rosemont |
South |
40820 |
30156 |
Sedgwick |
South |
40800 |
30155 |
Sedgwick |
North |
40800 |
30017 |
Sheridan |
South |
40080 |
30016 |
Sheridan |
North |
40080 |
30293 |
Sheridan |
North |
40080 |
30294 |
Sheridan |
South |
40080 |
30164 |
South Boulevard |
South |
40840 |
30163 |
South Boulevard |
North |
40840 |
30071 |
Southport |
South |
40360 |
30070 |
Southport |
North |
40360 |
30037 |
Sox-35th |
South |
40190 |
30036 |
Sox-35th |
North |
40190 |
30051 |
State/Lake |
West (Outer Loop) |
40260 |
30050 |
State/Lake |
East (Inner Loop) |
40260 |
30169 |
Thorndale |
North |
40880 |
30170 |
Thorndale |
South |
40880 |
30069 |
UIC-Halsted |
West |
40350 |
30068 |
UIC-Halsted |
East |
40350 |
30383 |
Washington/Wabash |
North (Outer Loop) |
41700 |
30384 |
Washington/Wabash |
South (Inner Loop) |
41700 |
30141 |
Washington/Wells |
North (Inner Loop) |
40730 |
30142 |
Washington/Wells |
South (Outer Loop) |
40730 |
30073 |
Washington (Blue Line) |
South |
40370 |
30072 |
Washington (Blue Line) |
North |
40370 |
30098 |
Washington (Red Line) |
South |
40500 |
30097 |
Washington (Red Line) |
North |
40500 |
30232 |
Wellington |
South |
41210 |
30231 |
Wellington |
North |
41210 |
30283 |
Western (Brown Line) |
North |
41480 |
30284 |
Western (Brown Line) |
South |
41480 |
30143 |
Western (Pink Line) |
East |
40740 |
30144 |
Western (Pink Line) |
West |
40740 |
30043 |
Western (Blue Line-Forest Park Branch) |
West |
40220 |
30042 |
Western (Blue Line-Forest Park Branch) |
East |
40220 |
30130 |
Western (Blue Line-O'Hare Branch) |
South |
40670 |
30129 |
Western (Blue Line-O'Hare Branch) |
North |
40670 |
30060 |
Western (Orange Line) |
North |
40310 |
30061 |
Western (Orange Line) |
South |
40310 |
30106 |
Wilson |
South |
40540 |
30105 |
Wilson |
North |
40540 |
30385 |
Wilson |
South |
40540 |
30386 |
Wilson |
North |
40540 |
Appendix C: Route Direction Code Quick Reference
In the Arrivals API response, you’ll see a train direction (“trDr”) element. These values represent what you might describe as an “operational” direction—it’s not expressive of the physical direction of a train at its current location so much as the big-picture route direction (even though it often coincides).
How a train’s direction is defined here loosely translates to a “northbound” (trDr=1) or “southbound” (trDr=5) direction, it can be a little tricky to imagine how that applies to routes such as the Blue Line.
Also, note that this value represents the current operational direction of the train as of when the prediction was generated, not which operational direction it’ll have once it reaches a given station that it’s predicted to reach. For example, an Orange Line train that’s at Halsted on its way to the Loop will be shown as such, even for predictions at Harold Washington Library-State/Van Buren by which time it’ll have changed to being a train to Midway the moment it enters the Loop.
Here’s a quick reference to help you understand what these values mean, on a per-route basis:
Red Line
1 = Howard-bound
5 = 95th/Dan Ryan-bound
Blue Line
1 = O’Hare-bound
5 = Forest Park-bound
Brown Line
1 = Kimball-bound
5 = Loop-bound
Green Line
1 = Harlem/Lake-bound
5 = Ashland/63rd- or Cottage Grove-bound (toward 63rd St destinations)
Orange Line
1 = Loop-bound
5 = Midway-bound
Purple Line
1 = Linden-bound
5 = Howard- or Loop-bound
Pink Line
1 = Loop-bound
5 = 54th/Cermak-bound
Yellow Line
1 = Skokie-bound
5 = Howard-bound
Appendix D: Insight into Polishing Your Output from the Experts
While the raw information alone is powerful, it’s helpful to interpret results and present them in such a way that can make them more meaningful for your customers.
Delays
The CTA Train Tracker service looks at how long it’s been since a train has moved from one track circuit to the next and identifies delays if a train appears to not be moving.
The “isDly” element is an expression of whether or not we’ve detected the likelihood that a train is delayed. If the value of isDly = 1, then consider indicating that the train is delayed rather than simply representing the last prediction, which might be growing stale (which you could compare timestamps to determine, independently).
Schedule faults
The isFlt element in the results indicates what we call a “schedule fault” in the context of Train Tracker. A fault on an ETA that is schedule-based (isSch=1) indicates that the scheduled arrival time given might not be feasible to serve due to the lack of a scheduled departure having occurred. Our system is designed to do some math in order to calculate whether or not a scheduled arrival is feasible based on minimum travel times from a terminal to where the arrival is being estimated for.
Note that this doesn’t necessarily mean that there are delays or that service is not good at the time—it only means that a train didn’t leave when the planned schedule had provisioned. Transit systems are complex and delays are sometimes unavoidable; our transportation managers use a variety of strategies, including making on-the-go schedule modifications, to maintain service levels (particularly during peak periods when trains leave every few minutes) and provide the best possible service. This is normal and provides a better service to our customers.
Events that affect prediction quality
Some construction or unplanned events that affect service (particularly if they cause trains to be routed differently than normal) can affect the quality of predictions in Train Tracker. While we work to improve back-end exception handling, we can alert users that the quality of predictions may be affected by a current event (or altogether unavailable). In certain situations where we know the information may be unreliable, we may temporarily stop offering predictions for all or portions of a route, which will also be reflected in the API. Our Customer Alerts API Alerts Feed contains a special “Train Tracker impact” flag (element “ttim”) to indicate when works are affecting prediction quality.
Calculating a number of minutes until arrival from this data
To calculate the number of minutes until arrival (so you can say “4 min” instead of 2:35 p.m., for example, we recommend comparing arrT to prdt – this will give you the number of minutes we calculated from when a train last moved into a new track circuit until when it should get to a station.
The reason for this is because the arrival time value is actually based on how long it should take to get from where the train was when its location was last updated in our prediction database, weighted in such a way to improve prediction accuracy, which happens on a frequent cycle.
The reason we represent this information in date-time form is for added flexibility in defining your own logic, as it allows you to show clock times or make computations as you feel is best for your code project, and can be more meaningful if your app doesn’t update very frequently.
Thus, it gives you the control to compare arrT to prdt if you do have the capability to update frequently, but, if not, you might then also consider other, more advanced scenarios, where you weight that comparison against the age of your last update. (It’s your app, so it’s really all up to you!)
Additionally, note that output for the arrT element, at least at this stage in the beta (we are open to your feedback as developers), is a minimum of 60 seconds from most recent prediction generation (trains disappear from result sets once they actually reach the station).
Due Trains
We show “due” or “approaching” on trains which are expected to arrive shortly because “1 min” is a very short period of time, and encourage you to consider doing the same.
Accessibility
We work very hard to design our Web services to be fully accessible to people with a wide range of levels of ability, including people with limited or no vision, limited mobility, cognitive disabilities and more.
While it’s up to you how to implement our data in your product and to what lengths you go to cater to audiences who are less able to interact with technology than others, we strongly encourage you to take into consideration accessibility implications on whatever platform you write for and to make sure your incorporation of public transit information helps the whole public, to the best of your ability.
We encourage you to catch up on accessibility standards such as those laid out in the Federal Section 508 guidelines, the Illinois Information Technology Accessibility Act (IITAA), as well as staying up on modern Web or software accessibility best practices. It’ll lead to better products for you and everyone who might benefit from them.
Appendix E: Error Codes
Error codes are given in the event an unexpected request was made or if an error in processing occurred. A good response comes with an error code of 0.
Arrivals API Error Codes
Error Code
|
Error Name
|
Error Explanation
|
0
|
OK
|
No error.
|
100
|
Required parameter [value] is missing.
|
The query string does not contain one of the required parameters, currently: "mapid or stpid", "key".
|
101
|
Invalid API key
|
The value for the required parameter "key" is not a valid API key.
|
102
|
Maximum Daily CTA Train Tracker API usage exceeded.
|
The number of successful API Requests using the supplied "key" have exceeded the maximum daily value.
|
103
|
Invalid mapid: [value]
|
At least one of the supplied values for the "mapid" parameter is not valid. The first invalid id is returned.
|
104
|
Mapid's need to be integers: [value]
|
At least one of the supplied values for the "mapid" parameter is not an integer value. The first invalid id is returned.
|
105
|
Maximum of mapid's you can request is 4.
|
A maximum of 4 values may be specified for the parameter "mapid". More than 4 were supplied.
|
106
|
Invalid Route Identifier: [value]
|
At least one of the supplied values for the "rt" parameter is invalid. Supported values are: "Red", "Blue", "Brn", "G", "Org", "P", "Pink", "Y".
|
107
|
Maximum of rt's you can request is 4.
|
A maximum of 4 values may be specified for the parameter "rt". More than 4 were supplied.
|
108
|
Invalid stpId specified: [value]
|
At least one of the supplied values for the "stpId" parameter is invalid. The first invalid value is returned.
|
109
|
Maximum of stpid's you can request is 4.
|
A maximum of 4 values may be specified for the parameter "stpId". More than 4 were supplied.
|
110
|
Invalid max specified: [value]
|
A non-integer value was specified for the "max" parameter.
|
111
|
Parameter 'max' must be a positive integer.
|
A value less than 1 was specified for the "max" parameter. The value must be an integer greater than zero.
|
112
|
Stpid's need to be integers: [value]
|
At least one of the supplied values for the "stpid" parameter is not an integer value. The first invalid id is returned.
|
500
|
Invalid parameter: [value]
|
The query string contains a parameter that is not supported by the train tracker API, currently supported parameters are: "mapid", "key", "rt", "stpid", "max".
|
900
|
Server Error
|
A server error occurred.
|
Follower API Error Codes
Error Code
|
Error Name
|
Error Explanation
|
100
|
Required parameter [value] is missing.
|
One or more of the required parameters is missing. For this API, the required parameters are: “runnumber”, and “key”
|
101
|
Invalid API key.
|
The supplied API key was not a valid API key.
|
102
|
Maximum daily Train Tracker API usage exceeded.
|
The daily usage limit for the supplied key has been exceeded.
|
500
|
Invalid parameter [value].
|
Valid parameters for this API are: “runnumber”, and “key”.
|
501
|
No trains with runnumber [value] were found.
|
The indicated train may have left service or may simply be incorrect.
|
502
|
Unable to determine upcoming stops.
|
The indicated train has an unexpected exit station id, and the system cannot reliably determine which predictions to report.
|
503
|
Unable to find predictions
|
The train exists, however none of the available predictions are for active stations.
|
Locations API Error Codes
Error code
|
Message
|
Description
|
100
|
Required parameter [value] is missing.
|
One of the required parameters (rt, key) was not provided.
|
101
|
Invalid API key.
|
The API key given in the parameter ‘key’ was either not found or inactive.
|
102
|
Maximum daily Train Tracker API usage exceeded.
|
Key usage has exceeded daily limits. Limits are reset at midnight.
|
106
|
Invalid route identifier: [value].
|
Valid route identifiers are: red, blue, brn, g, org, p, pink, y
|
107
|
Maximum number of rt’s per request is 8.
|
No more than 8 routes can be issued per request. Note duplicates are counted but not returned.
|
500
|
Invalid parameter: [value]
|
The indicated parameter is not valid. Valid parameters are: rt, key.
|