API

Sections

Theme switcher

Real Time

Real Time data can be used to track the progress of trips, vehicle details, route and stop information for both scheduled and live tracked trips.

Please note that this is an enterprise API feature. Reach out to your Partnership Manager for more information about unlocking this and other advanced features.

Authentication

To securely access the API, requests must be authenticated using the Authorization header. Below is the method for including authentication credentials in API requests.

Required Header:

  • Authentication: This header should contain a token in the format ‘Bearer {token}ʼ. Format: Authentication: Bearer {retailer_api_token}

API Workflow

  1. Authenticate using the above process
  2. Get real time info by booking ID

API Examples

Sample Request to /realtime/v1/trips/match/by-booking/{booking_id}

JSON
{
"trips": [
{
"id": "601877",
"status": "arrived",
"route": "A9",
"operator_code": "NEXP",
"operator_name": "NX Start Hill",
"odometry": {
"current_latitude": null,
"current_longitude": null,
"current_forward_azimuth_degrees": 358,
"current_speed_kph": 0,
"last_update_time": "2024-10-17T14:38:01+01:00",
"current_stop_station_id": "GBLONLQE",
"closest_shape_point": null,
"current_status": "STOPPED_AT"
},
"vehicle": {
"id": "BF21 CYZ",
"registration": "SH315 - BF21 CYZ",
"display_name": "SH315 - BF21 CYZ",
"description": "CAETANO"
},
"stops": [
{
"sequence": 0,
"station_id": "GBLONSAI",
"station_name": "London Stansted Airport Coach Station",
"latitude": 51.889397,
"longitude": 0.2637,
"scheduled_time": "2024-10-17T13:40:00+01:00",
"live_time": "2024-10-17T13:41:23+01:00",
"occupancy_after_stop": 37,
"platform": null
},
{
"sequence": 1,
"station_id": "GBLONLQE",
"station_name": "London Stratford City Bus Station",
"latitude": 51.543976,
"longitude": -0.00373,
"scheduled_time": "2024-10-17T14:30:00+01:00",
"live_time": "2024-10-17T14:23:45+01:00",
"occupancy_after_stop": 0,
"platform": null
}
],
"shape": [
{
"latitude": 51.88924,
"longitude": 0.26355
},
{
"latitude": 51.88918,
"longitude": 0.2636
}
]
}
]
}
] }

If the trip has not started yet or does not have Real Time data then service will respond with an error message:

JSON
{
"error": "TripNotFoundError",
"message": "Trip not found"
}

Name

Mandatory

Format

Description

id

Yes

String

A unique Identifier for the trip.

status

Yes

Enum

The current status of the trip. Allowed values:

  • Arrived
  • No dta
  • Scheduled
  • Delayed
  • Cancelled
  • On time

route

Yes

String

The route code that the trip is following.

operator_code

Yes

String

A code representing the operator of the trip.

operator_name

Yes

String

The name of the operator managing the trip.

odometry

Yes

List

An object containing detailed positioning and movement data for the trip.

current_latitude

No

Float

The current latitude of the vehicle.

current_longitude

No

Float

The current longitude of the vehicle.

current_forward_azimuth_degrees

No

Integer

The current forward azimuth (orientation) of the vehicle in degrees.

current_speed_kph

No

Integer

The current speed of the vehicle in kilometers per hour.

last_update_time

No

DateTime

The timestamp of the last update to the odometry data.

current_stop_station_id

No

String

The ID of the current or next stop station

closest_shape_point

No

List

The closest point in the route shape to the current position.

latitude

Yes

Float

The latitude of the shape stop.

longitude

Yes

Float

The longitude of the shape stop.

current_status

Yes

Enum

The current status of the vehicle in relation to stops. Allowed values:

  • STOPPED_AT
  • IN_TRANSIT_TO

vehicle

Yes

List

Contains information about the vehicle being used for the trip.

id

No

String

A unique identifier for the vehicle.

registration

No

String

The registration information of the vehicle.

display_name

No

String

A display name for the vehicle, often including the registration information.

description

No

String

A short description of the vehicle type or model.

stops

Yes

List

An array of stop objects, detailing each stop along the trip's route.

sequence

Yes

Integer

The order of the stop in the trip.

station_id

Yes

String

A unique identifier for the stop station.

station_name

Yes

String

The name of the stop station.

latitude

Yes

Float

The latitude of the stop station.

longitude

Yes

Float

The longitude of the stop station.

scheduled_time

Yes

DateTime

The scheduled time for the trip to reach this stop.

live_time

No

DateTime

The actual time the trip reached this stop.

occupancy_after_stop

No

Integer

The number of passengers after leaving the stop.

platform

No

String

The platform at the stop.

shape

Yes

List

An array of latitude and longitude points defining the geographic path of the trip.

latitude

Yes

Float

The latitude of the shape point.

longitude

Yes

Float

The longitude of the shape point.

Was this section helpful?

What made this section unhelpful for you?

On this page
  • Real Time
View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot