Getting started
The TavernData API serves the data of Travellers Rest as JSON: items, recipes, prices, crops, shops and more, in the 27 languages the game ships with. It is free. You need an account so that each key has its own limits.
1. Create an account
Register with an email address, Discord or Google, and confirm your email if you used one.
2. Create a key
Open the dashboard, give the key a name (for example the name of your app) and copy it.
The key is shown once; we only keep a hash of it. It looks like td_live_8Kq2…_0SwBID.
Keep it out of your code: put it in an environment variable.
export TAVERN_KEY=td_live_...
3. Make your first request
curl "https://api.taverndata.com/v1/items/milk-stout?lang=pt-PT" \
-H "Authorization: Bearer $TAVERN_KEY"
{
"data": {
"id": 1522,
"slug": "milk-stout",
"name": "Stout de Leite",
"price_per_serving": {
"cheapest": { "copper": 576, "display": "5s 76c" },
"expensive": { "copper": 669, "display": "6s 69c" }
}
},
"meta": { "game_version": "v0.7.6.12.0", "build_id": 25184139, "lang": "pt-PT", "lang_fallback": [] }
}
Every response has the same shape: data, then meta with the game version and the language used, and
pagination on lists. The example is trimmed; the real item has more fields.
From code
const res = await fetch("https://api.taverndata.com/v1/items/milk-stout/price?ingredients=expensive&aging=grand_reserve&quality=superior", {
headers: { Authorization: `Bearer ${process.env.TAVERN_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).detail);
const { data } = await res.json();
console.log(data.per_serving.display); // "11s 73c"
import os
import httpx
r = httpx.get(
"https://api.taverndata.com/v1/rankings/products",
params={"aging": "grand_reserve", "food_type": "drink", "limit": 10},
headers={"Authorization": f"Bearer {os.environ['TAVERN_KEY']}"},
)
r.raise_for_status()
for row in r.json()["data"]:
print(row["rank"], row["item"]["name"], row["per_serving"]["display"])
Next
- Rate limits: what to do when you get a 429.
- Reference: every endpoint, with a "try it" button.
- Complete clients in TypeScript and Python, and a Discord bot, in the
examples/folder of the project.