StopPoint Fares not working fine with all stations

Hello,
I currently investigate the problem, that the fare calculation with the following endpoint:

https://api.tfl.gov.uk/StopPoint/940GZZLUWLO/FareTo/940GZZLUTCR

is working fine. But with station naptan ids not starting with 940 it’s not working.

For exmaple when I search the following route:

https://api.tfl.gov.uk/journey/journeyresult3s/51.519938,-0.175459/to/51.503223,-0.118510?date=20240418&time=1800

I got some naptan ids like 910GPADTON. When I use this 910… ids I only get an empty result from the fares api endpoint (mentioned above)

Thanks in advance for an answer.

Welcome @BenL to the world of Naptans

The 940GZZLU prefix is to the three letter codes found in the PDF in the “London
Underground Published Codes” column

The 910G prefix codes are usually network rail stations, rather than ones owned by London Underground Limited.

940GZZDL is the prefix for DLR stations.

Hi Briantist,
thanks for the fast answer. I understand the prefix codes now. Thanks you very much. But how can I calculate the Fares with NaptanIds from the Journey Endpoint? Do I have to convert the 910 to 940? Is fare calculation from 910… not possible?

Thanks in advance.

Ben

OK.

The apis can match the functions of Single fare finder - Transport for London

However, the whole national rail ticketing system is a tangled mess of fares, that depends on time of date, route taken, day-of-week, if there is a return, your age and dizzing range of discount cards.

You can get these from the National Rail Enquires OLJP - Online Journey Planner Data Feeds | National Rail

Having said that if you use the TfL SFF it can do London to London fares, so these should be possible because there are “pay as you go (contactless or Oyster) is accepted.”

this - https://api.tfl.gov.uk/Journey/JourneyResults/910GMWRWSTN/to/910GMLHB - appears to work as a request.

Hi Ben, the 910 code will need to be used with one where’s a valid journey. i.e. you can’t do a valid journey between Paddington Rail station and Regent’s Park Underground station. For that, you need to use the 940 code for Paddington. Unfortunately the system is not geared to incorporate the interchange at the start or end of the journey.

As you can see if you make these calls, they return journeys where there’s a valid route.

Paddington to Regent’s Park:

https://api.tfl.gov.uk/StopPoint/940GZZLUPAC/FareTo/940GZZLURGP

Paddington to Iver:

https://api.tfl.gov.uk/StopPoint/910GPADTON/FareTo/910GIVER

However, the interchange is incorporated into the end-to-end calculation. For instance, if you interchange between tube and Elizabeth line at Paddington, this will return a fare:

https://api.tfl.gov.uk/StopPoint/910GIVER/FareTo/940GZZLURGP

You need to be careful with working out the start/end code of the journey.

I hope that makes sense!

Many thanks,
James

1 Like