What is the rate limit or quota for the API?


#1

Originally asked by Ben:

[…] speaking of rate limit, I was wondering whether these were documented per API request type. On the unified API page (https://api.tfl.gov.uk/), the time shown below the GET label (5 mins for /BikePoint for example) corresponds to the time between two refreshes of the dataset, and not the rate limit, if I understand correctly?


#2

Yes the time shown on the API documentation page is the TTL in the cache – so it’s the minimum time between refreshes of data. (You can see more detail about cache hits/misses and age etc. if you examine the HTTP headers in each each response, see below). As for quotas, unfortunately they are not currently made visible for the user accounts on https://api-portal.tfl.gov.uk.

Contact us if you are having issues with quota limits.

Relevant caching headers from Varnish:

curl -I "https://api.tfl.gov.uk/StopPoint/940GZZLUVIC"
HTTP/1.1 200 OK
...
Age: 85
Api-Entity-Payload: StopPoint
Cache-Control: public, must-revalidate, max-age=43200, s-maxage=86400
Via: 1.1 varnish
...
X-Cache: HIT
X-Cache-Hits: 1
X-Cacheable: Yes. Cacheable
X-Hash-Url: /stoppoint/940gzzluvic
X-TTL: 86400.000
X-TTL-RULE: 0
...