rugbyAPI
Analytics / Totals and margins
Documentation/Analytics/Totals and margins

Totals and margins

Live

Total points and winning margins: averages, how often common lines are crossed, and margin bands.

GEThttps://api.rugbyapi.com/v1/analytics/totals

Parameters

NameWhat it doesExample
teamstring, optionalOnly matches this team played in.
competitionstring, optionalOnly this competition. IDs come from Competitions.
seasonstring, optionalOnly 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

FieldMeaning
analysisWhich analysis this is, for example totals.
scopeThe team, competition and season asked for, each with its ID and name, or null.
basis.matches_in_scopeFinished matches in the scope.
basis.matches_countedHow many of them this analysis could use.
basis.countedThe rule for which matches count, for example only those whose scoring timeline adds up to the final score.
notesHow the figures are worked out, in plain words.
dataThe figures. With a team, the team's own; without one, the whole scope with a row per team.
built_utcWhen the answer was worked out. Each scope is kept for three hours.

Errors you can get

StatusCodeWhen
400key_in_addressThe key was put in the address. Send it in a header (see Authentication).
401missing_keyNo Authorization: Bearer header, or the key was rotated (invalid_key, revoked_key).
403plan_requiredYour plan is below Live.
422bad_parameterA parameter is malformed, or unknown (unknown_parameter names the ones this endpoint takes).
422missing_parameterNone of team, competition or season was given. A team can be combined with a competition or a season.
429daily_limitToday'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.

Your key Get a free key
curl https://api.rugbyapi.com/v1/analytics/totals?season=ss_2H1294N \
  -H "Authorization: Bearer YOUR_KEY"
$ch = curl_init('https://api.rugbyapi.com/v1/analytics/totals?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/totals",
    params={"season": "ss_2H1294N"},
    headers={"Authorization": "Bearer YOUR_KEY"},
)
data = r.json()
const r = await fetch('https://api.rugbyapi.com/v1/analytics/totals?season=ss_2H1294N', {
  headers: { Authorization: 'Bearer YOUR_KEY' }
});
const data = await r.json();
200ResponseExample from the live archive, lists cut to 3
{
  "analysis": "totals",
  "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, timeline or not."
  },
  "notes": [
    "A line counts a match as over when the total is above it; lines end in .5 so no match lands on one.",
    "Margin bands count decided matches; draws are given on their own. Halves use matches with a recorded half-time score."
  ],
  "data": {
    "matches": 151,
    "total_points": {
      "average": 47.7,
      "median": 47,
      "highest": 93,
      "lowest": 15,
      "bands": [
        {
          "band": "0-29",
          "matches": 11,
          "pct": 7.3
        },
        {
          "band": "30-39",
          "matches": 37,
          "pct": 24.5
        },
        {
          "band": "40-49",
          "matches": 40,
          "pct": 26.5
        }
      ],
      "lines": [
        {
          "line": 35.5,
          "over_pct": 79.5,
          "under_pct": 20.5
        },
        {
          "line": 40.5,
          "over_pct": 66.9,
          "under_pct": 33.1
        },
        {
          "line": 45.5,
          "over_pct": 51.7,
          "under_pct": 48.3
        }
      ]
    },
    "margins": {
      "average": 15.3,
      "draws": 7,
      "draw_pct": 4.6,
      "bands": [
        {
          "band": "1-7",
          "matches": 49,
          "pct": 32.5
        },
        {
          "band": "8-14",
          "matches": 34,
          "pct": 22.5
        },
        {
          "band": "15-21",
          "matches": 24,
          "pct": 15.9
        }
      ]
    },
    "halves": {
      "matches_with_half_time": 151,
      "first_half_avg": 4.3,
      "second_half_avg": 43.4,
      "second_half_higher_pct": 92.7
    },
    "teams": [
      {
        "team": {
          "id": "tm_3M68FPT",
          "name": "Lions"
        },
        "matches": 19,
        "avg_total": 56.5,
        "avg_for": 28.5,
        "avg_against": 28,
        "over_45_5_pct": 73.7,
        "scored_20_plus_pct": 73.7,
        "scored_30_plus_pct": 36.8
      },
      {
        "team": {
          "id": "tm_0FWX7QJ",
          "name": "Bulls"
        },
        "matches": 21,
        "avg_total": 53.2,
        "avg_for": 30.5,
        "avg_against": 22.7,
        "over_45_5_pct": 61.9,
        "scored_20_plus_pct": 66.7,
        "scored_30_plus_pct": 52.4
      },
      {
        "team": {
          "id": "tm_1J9G85H",
          "name": "Ulster"
        },
        "matches": 18,
        "avg_total": 50.8,
        "avg_for": 27.4,
        "avg_against": 23.3,
        "over_45_5_pct": 61.1,
        "scored_20_plus_pct": 83.3,
        "scored_30_plus_pct": 33.3
      }
    ]
  },
  "built_utc": "2026-10-22T03:17:29Z"
}