The API for getting the places that lie within a geographic region seems not working!

I am trying to use the API Place_GetByGeo, but it seems not working.

API: Place_GetByGeo (TfL Unified API)

Request URL: https://api.tfl.gov.uk/Place?activeOnly=true&numberOfPlacesToReturn=1&placeGeo.lat=51.5074&placeGeo.lon=0.1278&app_key=b295d0df1e0c41f6bd9736bfe3c9a8cd&radius=5000

Response:
{
“statusCode”: 404,
“message”: “Resource not found”
}

Welcome @miphan

If you change placeGeo.lat to lat and placeGeo.lon to lon the call works.

https://api.tfl.gov.uk/Place?activeOnly=true&numberOfPlacesToReturn=1&lat=51.5074&lon=0.1278&app_key=b295d0df1e0c41f6bd9736bfe3c9a8cd&radius=5000

You might want to scale down your radius, 5km is a very large sweep.

1 Like

@jamesevans

I think this means that the docs on the page TfL Unified API are wrong!

/ping

You should be using the docs on the new portal (api-portal.tfl.gov.uk), for this endpoint the docs are here:

The old docs should probably either be updated to match or be removed altogether to reduce confusion.

1 Like

Perhaps some 301 codes to the new docs, @jamesevans ?