Schedule Information API
Command: load
Inputs
Parameter | Description |
---|---|
cmd=load | Requests estimated load factor for specified train(s). (Required) |
key=<key> | API registration key. (Required) |
ld1=<ssssrrtt> | First train to get the estimated load factor for. The format for this parameter is a four letter station code, a two digit route (left padded with 0 if needed) and a two digit train id. The train id (trainIdx) information is included in the <leg> element of the results of a arrive/depart request. (Required) |
ld2=<ssssrrtt> | Second train to get the estimated load factor for. The format for this parameter is a four letter station code, a two digit route (left padded with 0 if needed) and a two digit train id. The train id (trainIdx) information is included in the <leg> element of the results of a arrive/depart request. (Optional) |
ld3=<ssssrrtt> | Third train to get the estimated load factor for. The format for this parameter is a four letter station code, a two digit route (left padded with 0 if needed) and a two digit train id. The train id (trainIdx) information is included in the <leg> element of the results of a arrive/depart request. (Optional) |
st=<W|S|H> | Schedule type for this request. Schedule type is a single character representing Weekday (W), Saturday (S) or Sunday/Holiday (H). (Required) |
Notes
The load factor command takes from 1 to 3 ld parameters, each representing the start of a trip leg so that for any given trip you can get information for the entire trip in a single call. Currently there are only load factor estimates for Weekday schedules.
As an example of how this would be used, say you want to find the load information for a trip between Ashby and Colma. That trip has either 1 leg (Millbrae Line) or 2 legs (Fremont --> SFIA lines). To get the load factor for each of those trips, you might use the following calls: http://api.bart.gov/api/sched.aspx?cmd=load&ld1=ASHB0746&st=w&key=MW9S-E7SL-26DU-VV8V to get the Millbrae trip information and http://api.bart.gov/api/sched.aspx?cmd=load&ld1=ASHB0446&ld2=MCAR0159&st=w&key=MW9S-E7SL-26DU-VV8V for the Fremont to SFIA trip, which has a transfer at MCAR.
Currently the official BART website shows the estimated load factor for the train at the origin station and at any transfer stations.
XML Results
Sample
<?xml version="1.0" encoding="utf-8"?> <root> <uri> <![CDATA[http://ad.sfbart.org/api/sched.aspx?cmd=load&ld1=WDUB1130&ld2=BAYF0331&ld3=19TH0217&st=w]]> </uri> <load> <request schedueType="W" scheduleID="31"> <leg id="0" station="WDUB" route="11" trainId="30" load="1"></leg> <leg id="1" station="BAYF" route="3" trainId="31" load="1"></leg> <leg id="2" station="19TH" route="2" trainId="17" load="1"></leg> </request> </load> </root>
Notes
The results will display as many leg elements as there were ld parameters specified on the API call. If a load factor is not found for a given schedule type or ld specified, the load attribute will be "-1", otherwise a load of 1-3 will be displayed.