Best practices
The data changes only when Travellers Rest gets an update, a few times a year. Treat it as almost static.
Cache
Keep what you fetch. Data responses carry an ETag; send it back and an unchanged answer is an empty
304 Not Modified:
GET /v1/items/milk-stout
If-None-Match: "21aa68262fa66c1b4a3a1c6f4cf6465a"
HTTP/1.1 304 Not Modified
A 304 still counts towards your rate limit, but it saves the download and the parsing. Responses made with a
key are marked Cache-Control: private: cache them in your app, not in a shared proxy.
Do not poll
To notice a new patch, check GET /v1/versions once a day, or subscribe to the
changelog's RSS feed. Polling item endpoints in a loop only eats your limit.
Ask for less
fields=id,slug,namereturns only those fields.ids=12,1522,1544fetches many items in one request.- Lists are paginated with
limit(up to 100) andoffset; followpagination.next.
Say who you are
Send a User-Agent that names your app and how to reach you, for example
MyTavernBot/1.2 (+https://github.com/me/bot). If something goes wrong we can tell you instead of blocking you.