Search trains
mb_search_trainsSearch trains between two stations on a travel date, listing every class, price per adult, and live free seats so users can compare available options.
Instructions
Trains between two stations on a date with every class (wagon), its price per adult and free seats.
Seat counts are fresh (not cached). price_toman is per adult; for children, infants or a whole compartment call mb_train_price with the class_id. refund_penalties apply to every class unless a class lists its own. Stops and times: mb_train_stops. No seats left: try mb_train_price_calendar for other days or mb_alternative_routes. A round trip is two calls: the return leg with outbound_class_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Travel date YYYY-MM-DD, e.g. '2026-10-14'. Sales open about 18 days ahead. | |
| sort | No | Order of the trains. | earliest |
| limit | No | Max trains. | |
| quota | No | Seat quota: general (families, mixed), men only, women only, or car transport. | general |
| origin | Yes | Train station id from mb_find_place(mode='train'), e.g. 1 (Tehran) or 191 (Mashhad). | |
| destination | Yes | Train station id from mb_find_place(mode='train'), e.g. 1 (Tehran) or 191 (Mashhad). | |
| available_only | No | Hide sold-out classes and trains with no free seat. | |
| outbound_class_id | No | Round trip, return leg only: the class_id chosen on the outbound leg, e.g. 9847134 (limits the return to the same rail company, as the site does). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||