How to use TfL API for getting line status during provided dates


#1

I try to use:
Gets the line status for given line ids during the provided dates e.g Minor Delays
/Line/{ids}/Status/{StartDate}/to/{EndDate}

I am trying various date formats (not clear in documentation!) for parameters startDate and endDate, for instance using 2017-05-01 and 2017-05-31,
that is the request URL is:
https://api.tfl.gov.uk/Line/victoria/Status/{StartDate}/to/{EndDate}?detail=true&startDate=2017-05-01&endDate=2017-05-31

but I get following 404 message when testing the service (button Try):
{
"$type": “Tfl.Api.Presentation.Entities.ApiError, Tfl.Api.Presentation.Entities”,
“timestampUtc”: “2017-06-18T14:12:25.6365186Z”,
“exceptionType”: “EntityNotFoundException”,
“httpStatusCode”: 404,
“httpStatus”: “NotFound”,
“relativeUri”: “/Line/victoria/Status/%7BStartDate%7D/to/%7BEndDate%7D?detail=true&startDate=2017-05-01&endDate=2017-05-31”,
“message”: “Resource not found: http://api:8001/Line/victoria/Status/{StartDate}/to/{EndDate}?detail=true&startDate=2017-05-01&endDate=2017-05-31
}

What is incorrect in my request?


#2

Hi Herve,

I believe the syntax of your request should be:

https://api.tfl.gov.uk/Line/victoria/Status/2017-05-01/to/2017-05-31?detail=true

However, our API doesn’t currently hold historical disruptions data - it will only return results for live or planned disruptions in the present/future.

Thanks,
James
TfL Online Operations


#3

Hi James,
thank you very much for your answer.
Just to know, is it planned to have the service getting historical data?