Plan a journey
plan_journeyEvery practical way to get from one place to another: direct trains with their fares per class, journeys with one change of train, flights, mixed train-and-flight itineraries, and GOVERNMENT BUSES from the state road transport corporations, priced from their own reservation systems. This is the whole answer in one call. Place ids come from find_place.
Use it for bus questions too. On a large share of the corridors these corporations serve there is no through train at all — Mysuru to Mangaluru runs twenty-five buses a day and not one direct train — so a journey this tool answers with a bus is often the only through service that exists, not a second-best.
Pass train_class when the traveller has named one ("3A", "sleeper") and every train is priced in it; leave it out and each train is priced in every class we have evidence it carries. Pass modes: "trains_only" when they have said train — do not ask them to choose otherwise, because the point of this planner is that they do not have to. Pass arrive_by: true when they named a time they must BE somewhere rather than a time they want to leave.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Place id from find_place | |
| date | Yes | Travel date in IST. Today is allowed; the past is refused. | |
| from | Yes | Place id from find_place | |
| limit | No | How many of EACH kind to return. Raise it only if the traveller asks to see more. | |
| modes | No | Restrict the answer. Default 'any' ranks trains, flights and government buses together — leave it out unless the traveller has actually named a mode. 'trains_only' and 'flights_only' both drop the buses. | any |
| quota | No | GN | |
| arrive_by | No | When true, `date` is the day they must ARRIVE, and journeys may depart the day before. | |
| train_class | No | Price every train in this class: 2S Second Sitting, SL Sleeper, CC AC Chair Car, 3E AC 3 Economy, 3A AC 3 Tier, 2A AC 2 Tier, 1A First AC, EC Executive Chair Car. Omit to price each train in every class we know it carries. | |
| ask_preferences | No | Whether to ask the traveller for a travel class when they have not named one. Set false for automated or bulk use. | |
| include_connections | No | Journeys with one change of train. 'auto' searches for them when direct trains are thin, which is when they matter; 'always' searches regardless and costs a few more seconds. | auto |