Skip to content

WebSocket lifecycle

  1. Open wss://api.infoplaza.com/v1/transit/implanner with your api_key query parameter. Protobuf is the default; add mode=json for JSON.
  2. Send a planning request.
  3. Add each result to your journey list as it arrives.
  4. Finish the loading state when the server closes the completed search.

A successful search ends with a normal close (code 1000). Open a new connection for the next search.

FormatSendReceive
JSONA text planTrip envelopeText PlanResult objects
ProtobufAn encoded PlanRequestBinary PlanResult messages

Protobuf is recommended for applications: its compact binary messages reduce data transfer and support efficient encoding and decoding. See Protobuf & TypeScript to generate your client.

Both formats can receive a text JSON error envelope. Check the frame type first, then decode the message.

OutcomeShow
Result messageThe returned journeys
More work in progressFinding more options…
Completed with no journeysA suggestion to change the time or preferences
Error message or failed connectionThe error and a retry action

Close the previous connection and start a new one when the traveller changes their search. If you reuse an active connection, a newly submitted request replaces the in-progress request.

Use the runnable client · Decode responses