Rest and travel
LiveDays of rest since the last match and distance from home, against wins and margins.
Parameters
| Name | What it does | Example |
|---|---|---|
teamstring, optional | Only matches this team played in. | |
competitionstring, optional | Only this competition. IDs come from Competitions. | |
seasonstring, optional | Only this season. IDs come from a competition's Seasons. | ss_2H1294N |
Any other parameter is refused with a 422 naming the ones this endpoint takes, so a typo never silently returns everything.
What each plan returns
Free key
Not included. Returns 403 with the upgrade link.
Archive
Not included. Returns 403 with the upgrade link.
Live
Included.
Response fields
| Field | Meaning |
|---|---|
analysis | Which analysis this is, for example totals. |
scope | The team, competition and season asked for, each with its ID and name, or null. |
basis.matches_in_scope | Finished matches in the scope. |
basis.matches_counted | How many of them this analysis could use. |
basis.counted | The rule for which matches count, for example only those whose scoring timeline adds up to the final score. |
notes | How the figures are worked out, in plain words. |
data | The figures. With a team, the team's own; without one, the whole scope with a row per team. |
built_utc | When the answer was worked out. Each scope is kept for three hours. |
Errors you can get
| Status | Code | When |
|---|---|---|
400 | key_in_address | The key was put in the address. Send it in a header (see Authentication). |
401 | missing_key | No Authorization: Bearer header, or the key was rotated (invalid_key, revoked_key). |
403 | plan_required | Your plan is below Live. |
422 | bad_parameter | A parameter is malformed, or unknown (unknown_parameter names the ones this endpoint takes). |
422 | missing_parameter | None of team, competition or season was given. A team can be combined with a competition or a season. |
429 | daily_limit | Today's lookups are used. Resets at 00:00 UTC. |
Every error has the same shape. All error codes
Try it live
Runs this call from your browser with your own key and shows what comes back.
curl https://api.rugbyapi.com/v1/analytics/rest-travel?season=ss_2H1294N \
-H "Authorization: Bearer YOUR_KEY"$ch = curl_init('https://api.rugbyapi.com/v1/analytics/rest-travel?season=ss_2H1294N'); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_KEY'], CURLOPT_RETURNTRANSFER => true, ]); $data = json_decode(curl_exec($ch), true);
import requests r = requests.get( "https://api.rugbyapi.com/v1/analytics/rest-travel", params={"season": "ss_2H1294N"}, headers={"Authorization": "Bearer YOUR_KEY"}, ) data = r.json()
const r = await fetch('https://api.rugbyapi.com/v1/analytics/rest-travel?season=ss_2H1294N', { headers: { Authorization: 'Bearer YOUR_KEY' } }); const data = await r.json();
200ResponseExample from the live archive, lists cut to 3
{
"analysis": "rest-travel",
"scope": {
"team": null,
"competition": {
"id": "cp_2EW9542",
"name": "United Rugby Championship"
},
"season": {
"id": "ss_2H1294N",
"name": "2025-26"
}
},
"basis": {
"matches_in_scope": 151,
"matches_counted": 151,
"counted": "Every finished match with a final score. Rest needs the team's previous match in the last 60 days; travel needs both grounds placed on the map."
},
"notes": [
"Rest is the days since the team's previous match in any competition we hold. A gap over 60 days, such as the first match of a season, is left out.",
"Travel is the straight-line distance from the team's usual home ground (where it has played most home matches) to the match ground.",
"A rest advantage is two days or more between the sides. Rows count both sides of every match."
],
"data": {
"matches": 151,
"rest": [
{
"band": "short",
"days": "0-6",
"matches": 52,
"won": 23,
"drawn": 5,
"lost": 24,
"win_pct": 44.2,
"avg_for": 21.3,
"avg_against": 23.2,
"avg_margin": -1.9
},
{
"band": "normal",
"days": "7-8",
"matches": 147,
"won": 72,
"drawn": 6,
"lost": 69,
"win_pct": 49,
"avg_for": 24.5,
"avg_against": 23.9,
"avg_margin": 0.6
},
{
"band": "long",
"days": "9-13",
"matches": 10,
"won": 6,
"drawn": 1,
"lost": 3,
"win_pct": 60,
"avg_for": 28.9,
"avg_against": 22.2,
"avg_margin": 6.7
}
],
"travel": [
{
"band": "home",
"km": "0-50",
"matches": 113,
"won": 80,
"drawn": 5,
"lost": 28,
"win_pct": 70.8,
"avg_for": 29,
"avg_against": 19.7,
"avg_margin": 9.2,
"avg_km": 1
},
{
"band": "near",
"km": "51-500",
"matches": 37,
"won": 15,
"drawn": 1,
"lost": 21,
"win_pct": 40.5,
"avg_for": 20.2,
"avg_against": 23.6,
"avg_margin": -3.4,
"avg_km": 274
},
{
"band": "far",
"km": "501-2000",
"matches": 23,
"won": 6,
"drawn": 2,
"lost": 15,
"win_pct": 26.1,
"avg_for": 18.1,
"avg_against": 24.4,
"avg_margin": -6.3,
"avg_km": 1232
}
],
"rest_advantage": {
"matches": 21,
"fresher_side_won": 9,
"drawn": 1,
"fresher_side_lost": 11,
"fresher_side_win_pct": 42.9
}
},
"built_utc": "2026-10-22T03:17:29Z"
}