rugbyAPI
Platform / Search

Search

Free

Find a competition, team or player by name and get its ID.

GEThttps://api.rugbyapi.com/v1/search

Parameters

NameWhat it doesExample
qstring, requiredWhat to look for, at least 2 characters. Matches competitions, teams and players by name.Ospre

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

Included.

Archive

Included.

Live

Included.

Response fields

FieldMeaning
data[].typecompetition, team or player
data[].id, nameThe ID to use in other calls, and the name
data[].region, country, teamContext: region for a competition, country for a team, current team for a player

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).
422bad_parameterA parameter is malformed, or unknown (unknown_parameter names the ones this endpoint takes).
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/search?q=Ospre \
  -H "Authorization: Bearer YOUR_KEY"
$ch = curl_init('https://api.rugbyapi.com/v1/search?q=Ospre');
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/search",
    params={"q": "Ospre"},
    headers={"Authorization": "Bearer YOUR_KEY"},
)
data = r.json()
const r = await fetch('https://api.rugbyapi.com/v1/search?q=Ospre', {
  headers: { Authorization: 'Bearer YOUR_KEY' }
});
const data = await r.json();
200ResponseExample from the live archive, lists cut to 3
{
  "count": 1,
  "data": [
    {
      "type": "team",
      "id": "tm_1KTEF3F",
      "name": "Ospreys",
      "country": "Wales"
    }
  ]
}