Hello,
The API parameter has no effect. It is a vestige that has been left in place in case someone is experimenting with older methods that are still hanging around in the code base, which might read this parameter.
However, it would be questionable to do so. The reason the parameter is disabled is that it is algorithmically invalid to apply a cutoff value to a variable that is not one of the optimization objectives. This is referred to as a "resource limiting problem” in the operations research literature. OTP contains (or at least did in the past) code that allows finding Pareto-optimal paths, which enables capping transfers, but it turned out to be excessively slow on larger networks.
At first it seems intuitive to just discard paths at the point where they exceed a certain number of transfers, and this approach has cropped up from time to time in open source transit routing software. But limiting resources in searches that are not specifically designed to support such limiting will occasionally yield cryptic, inexplicable results that are difficult to debug. It just doesn’t work as expected, and the reasons are well documented.
Instead, to provide reasonable performance we optimize a single generalized cost variable, which is a composite of many different factors (one of which is the number of transfers). The appropriate way to get less transfers in this setting is to increase the cost of each transfer, not cap the number of transfers. This applies across the board in the current incarnation of OTP: you can’t actually cap the number of anything, but you can adjust the per unit cost of many things.
Other alternative algorithms like RAPTOR naturally find the set of Pareto-optimal paths on two variables, travel time and number of transfers. That’s one reason we’ve put a lot of effort into implementing RAPTOR, and are debating integrating our RAPTOR implementation into OTP.
Regards,