Status 300 (Multiple Choices) for Journey API

Journey API returns status 300 (Multiple Choices) for some queries between exisitng NaptaIds. Here are several samples. Looks like some stations like new New Cross and Upminster are affected.

Abbey Wood to New Cross: https://api.tfl.gov.uk/Journey/JourneyResults/910GABWDXR/to/910GNWCROSS?app_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&date=20221013&time=1200"

Abbey Wood to Upminster: https://api.tfl.gov.uk/Journey/JourneyResults/910GABWDXR/to/910GUPMNSP6?app_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&date=20221013&time=1200"

Acton Central to New Cross:
/Journey/JourneyResults/910GACTNCTL/to/910GNWCROSS?app_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&date=20221013&time=1200

Acton to Upminster:
/Journey/JourneyResults/910GACTONML/to/910GUPMNSP6?app_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&date=20221013&time=1200

Acton to Willesden Junction LL:
/Journey/JourneyResults/910GACTONML/to/910GWLSDNJL?app_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&date=20221013&time=1200

Is there a reason not using 910GABWD and 940GZZLUUPM rather than these platform-specific locations

I’m getting NaptanIds from the Stoppoint API.

  1. Abbey Wood
    910GABWDXR is NaptanId for “Abbey Wood” on “elizabeth-line”:

image

910GABWD is 910GABWD “Abbey Wood (London) Rail Station” on “national-rail”:

[Can’t add more than one screenshot as a I’m a new user]

  1. Upminster

“910GUPMNSP6” is “Upminster Rail Station” without any lines/modes - how can it be possible?

image

There’s another “Upminster Rail Station” with “910GUPMNSTR” and lines (“national-rail”,“overground”)

[Can’t add more than 1 screenshot as I’m a new user]

Is it bad data or should I distinguish them somehow?

And “940GZZLUUPM” is “Upminster Underground Station” on “tube”

@Ilya If there’s a “hub” Naptan code, it’s always better to use that!

Also, the Journey Planner can be used with comma separated lat,lon too.

Could you explain a little of what you are trying to achieve with your grid?

Apologies for a late reply - I was away

Both “Upminster Rail Stations” (910GUPMNSP6 & 910GUPMNSTR) from above have hubNaptanCode (same HUBUPM)

The 910GUPMNSP6 doesn’t have any lines info, modes, properties or children so I think I should use the other one I believe.

However, why two of them exist? I’ve noticed that even location differs slightly:
“lon”: 0.250884 vs “lon”: 0.25088

“Upminster station” is actually THREE stations. The C2C line, the District Line and the London Overground line. The lines are not totally not connected: the Overground is connected to the rest of the rail network at Romford, and the District line isn’t connected to the National Rail network (mainly because the Underground uses third-rail DC current and the C2C line is overhead AC power, both with different signalling systems).

image

Hey, I’m getting the same 300 status when trying to do a journey between two post codes.

Here are some examples:

https://api.tfl.gov.uk/journey/journeyresults/SE156BG/to/WC1X8AL
https://api.tfl.gov.uk/journey/journeyresults/e139gg/to/WC1X8AL

Any idea what’s going on or how I can handle this?

@Toofy Welcome

I think you need to ensure you have valid postcodes before you call the API:

https://api.tfl.gov.uk/Journey/JourneyResults/E20%201BT/to/w1a%201aa

You can validate the “inner” part using the PAF: I’m don’t think that there that there is a west-central 1X.

Hey @briantist thanks for your reply.

There most definitely is a WC1X, but you put me on the right track. The ‘from’ parts have incorrect inner post codes, so I guess I will handle this as an error.

Maybe 300 potentially isn’t the right status code to respond with though? :wink:

1 Like

It’s not by decision! I personally find that TfL has the most logical and helpful error codes of all the public APIs I use. Ever tried voi https://api.voiapp.io/ ? :roll_eyes:

I personally find that all the Microsoft-based “$type” things in the TfL output somewhat redundant, but otherwise it’s almost wholly consistent and logical.

SE15 6BG, WC1X 8AL and E13 9GG are all valid postcodes, according to https://www.royalmail.com/find-a-postcode

I think perhaps TFL’s API is overdue for having its postcode database updated.

1 Like

WC1X 8AL has existed since 1980, a quick Google search revealed and appears to be a genuine area rather than a business-specific one. I suspect.that TfL has updated it’s postcode list at least once since 1980!

1 Like