rugbyAPI
Teams / Head to head
Documentation/Teams/Head to head

Head to head

Archive

Every finished meeting between two teams, newest first, with the running record.

GEThttps://api.rugbyapi.com/v1/head-to-head

Parameters

NameWhat it doesExample
team_aid, requiredThe first team. The summary counts wins from this side.tm_1KTEF3F
team_bid, requiredThe second team.tm_179VXFK

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

Included.

Live

Included.

Response fields

FieldMeaning
team_a, team_bID and name of each
summaryplayed, team_a_wins, team_b_wins, draws
data[]Each match has id, date, kickoff_utc, status, competition, season, and home and away with team id, name and score.

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 Archive.
422bad_parameterA parameter is malformed, or unknown (unknown_parameter names the ones this endpoint takes).
422missing_parameterteam_a or team_b is missing.
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/head-to-head?team_a=tm_1KTEF3F&team_b=tm_179VXFK \
  -H "Authorization: Bearer YOUR_KEY"
$ch = curl_init('https://api.rugbyapi.com/v1/head-to-head?team_a=tm_1KTEF3F&team_b=tm_179VXFK');
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/head-to-head",
    params={"team_a": "tm_1KTEF3F", "team_b": "tm_179VXFK"},
    headers={"Authorization": "Bearer YOUR_KEY"},
)
data = r.json()
const r = await fetch('https://api.rugbyapi.com/v1/head-to-head?team_a=tm_1KTEF3F&team_b=tm_179VXFK', {
  headers: { Authorization: 'Bearer YOUR_KEY' }
});
const data = await r.json();
200ResponseExample from the live archive, lists cut to 3
{
  "team_a": {
    "id": "tm_1KTEF3F",
    "name": "Ospreys"
  },
  "team_b": {
    "id": "tm_179VXFK",
    "name": "Cardiff Rugby"
  },
  "summary": {
    "played": 45,
    "team_a_wins": 30,
    "team_b_wins": 13,
    "draws": 2
  },
  "count": 45,
  "data": [
    {
      "id": "mt_064VTQ5",
      "date": "2026-10-31",
      "kickoff_utc": "2026-10-31T19:45:00Z",
      "status": "finished",
      "competition": {
        "id": "cp_2EW9542",
        "name": "United Rugby Championship"
      },
      "season": {
        "id": "ss_1VSX6S8",
        "name": "2026-27"
      },
      "home": {
        "id": "tm_1KTEF3F",
        "name": "Ospreys",
        "score": 0
      },
      "away": {
        "id": "tm_179VXFK",
        "name": "Cardiff Rugby",
        "score": 26
      }
    },
    {
      "id": "mt_0D698RP",
      "date": "2026-04-24",
      "kickoff_utc": "2026-04-24T18:00:00Z",
      "status": "finished",
      "competition": {
        "id": "cp_2EW9542",
        "name": "United Rugby Championship"
      },
      "season": {
        "id": "ss_2H1294N",
        "name": "2025-26"
      },
      "home": {
        "id": "tm_179VXFK",
        "name": "Cardiff Rugby",
        "score": 24
      },
      "away": {
        "id": "tm_1KTEF3F",
        "name": "Ospreys",
        "score": 21
      }
    },
    {
      "id": "mt_09W7Z7V",
      "date": "2026-01-01",
      "kickoff_utc": "2026-01-01T17:30:00Z",
      "status": "finished",
      "competition": {
        "id": "cp_2EW9542",
        "name": "United Rugby Championship"
      },
      "season": {
        "id": "ss_2H1294N",
        "name": "2025-26"
      },
      "home": {
        "id": "tm_1KTEF3F",
        "name": "Ospreys",
        "score": 33
      },
      "away": {
        "id": "tm_179VXFK",
        "name": "Cardiff Rugby",
        "score": 22
      }
    }
  ]
}