Function gtfs_server::routes::api::times::times_stop_query[][src]

pub fn times_stop_query(
    rh: State<RoutesHandler>,
    stop_id: String,
    time_search: TimeSearch
) -> Json<ResultArray<Time>>

/times/by-stop/<stop_id>?<time_search>
Gets the Times associated to the specified Stop UID, parametrized as <stop_id>.
The results can be filtered with <time_search> parameters (check TimeSearch)
Returns a ResultArray <Time>

Query Parameters

date

A date on which the time is valid. This field only validates the start_date and end_date fields, this means that you'll still need to check if the requested trip is available in the date weekday.

service_id

Filter by this service_id

monday, tuesday, ..., sunday

When they're set (to either true or false) a filter will be applied on these week days service conditions

at_a

Arrival time is after ... (00:00:00)

at_b

Arrival time is before ... (00:00:00)

dt_a

Departure time is after ... (00:00:00)

dt_b

Departure time is before ... (00:00:00)

trip_id

Filter by trip_id (for example t-32c94c-castagnolacapolinea)

pickup_type

Only show Time Stops with this pickup condition.
For example: RegularlyScheduled

drop_off_type

Only show Time Stops with this drop-off condition.
For example: RegularlyScheduled

stop_sequence

Only show Time Stops with this stop_sequence.
For example: 1

sort_by

Sort by ...
Possible values are available in the TimeSort enum.
For example: arrival_time

Sort order

Ascending (asc) or Descending (desc) These sorting order conditions will only affect the query if sort_by is set.

Example

Transports that reach s-bdf67e-luganostazione (Lugano, Stazione) on a Sunday, between 2PM and 3 PM, sorted by arrival time in Ascending order:

Request

/times/by-stop/s-bdf67e-luganostazione?sunday=true&at_a=14:00:00&at_b=15:00:00&sort_by=arrival_time&sort_order=asc

Response

{
  "result": [
    {
      "trip_id": "t-32c94c-castagnolacapolinea",
      "arrival_time": "14:07:00",
      "departure_time": "14:07:00",
      "stop_id": "s-bdf67e-luganostazione",
      "stop_sequence": 9,
      "pickup_type": "RegularlyScheduled",
      "drop_off_type": "RegularlyScheduled",
      "service_days": [
        false,
        false,
        false,
        false,
        false,
        false,
        true
      ],
      "service_uid": "se-3e10af-ta-b0013",
      "start_date": "2017-12-10",
      "end_date": "2018-12-08"
    },
    {
      "trip_id": "t-3f5dd9-canobbioganna",
      "arrival_time": "14:07:00",
      "departure_time": "14:10:00",
      "stop_id": "s-bdf67e-luganostazione",
      "stop_sequence": 10,
      "pickup_type": "RegularlyScheduled",
      "drop_off_type": "RegularlyScheduled",
      "service_days": [
        false,
        false,
        false,
        false,
        false,
        true,
        true
      ],
      "service_uid": "se-f80c67-ta-b001r",
      "start_date": "2017-12-10",
      "end_date": "2018-12-08"
    },
    (...)
  ],
  "meta": {
    "success": true
  }
}