Building a Discord Chatbot command which can get bustime arrivals for a searched bus stop.
Using the search endpoint and filtering by bus mode, I can get the bus stop ID which appears incorrect because when i run that into the StopPoint/{query}/Arrivals endpoint, it returns empty data. Why might it be doing this, am I using an incorrect endpoint??
Example using from query ‘colliers wood station’
age: 0
api-entity-payload: StopPoint
cache-control: public, must-revalidate, max-age=302400, s-maxage=604800
content-encoding: gzip
content-length: 303
content-type: application/json; charset=utf-8
date: Fri, 23 Jun 2023 08:50:29 GMT
server: cloudflare
via: 1.1 varnish
x-api: StopPoint
x-aspnet-version: 4.0.30319
x-backend: api
x-cache: MISS
x-cacheable: Yes. Cacheable
x-frame-options: deny
x-operation: StopPoint_SearchByPathQueryQueryModesQueryFaresOnlyQueryMaxResultsQueryLines
x-proxy-connection: unset
x-ttl: 604800.000
x-ttl-rule: 0
x-varnish: 791231839
{
"$type": "Tfl.Api.Presentation.Entities.SearchResponse, Tfl.Api.Presentation.Entities",
"query": "colliers wood",
"total": 2,
"matches": [{
"$type": "Tfl.Api.Presentation.Entities.MatchedStop, Tfl.Api.Presentation.Entities",
"icsId": "1000055",
"topMostParentId": "940GZZLUCSD",
"modes": ["tube", "bus"],
"zone": "3",
"id": "940GZZLUCSD",
"name": "Colliers Wood Underground Station",
"lat": 51.41816,
"lon": -0.178086
}, {
"$type": "Tfl.Api.Presentation.Entities.MatchedStop, Tfl.Api.Presentation.Entities",
"icsId": "1014648",
"topMostParentId": "490G00014648",
"modes": ["bus"],
"id": "490G00014648",
"name": "Colliers Wood United Football Club",
"lat": 51.421264,
"lon": -0.253344
}]
}
using the “id” from the 2md result:
age: 0
api-entity-payload: Prediction
cache-control: public, must-revalidate, max-age=30, s-maxage=60
content-encoding: gzip
content-length: 22
content-type: application/json; charset=utf-8
date: Fri, 23 Jun 2023 08:52:04 GMT
server: cloudflare
via: 1.1 varnish
x-api: StopPoint
x-aspnet-version: 4.0.30319
x-backend: api
x-cache: MISS
x-cacheable: Yes. Cacheable
x-frame-options: deny
x-operation: StopPoint_ArrivalsByPathId
x-proxy-connection: unset
x-ttl: 60.000
x-ttl-rule: 0
x-varnish: 1918256092
[]