# Sports API
> Search sports teams and players, fetch detailed team profiles (stadium, league, founding year, badges) and browse leagues across football (soccer) and 30+ other sports. Powered by TheSportsDB.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/sports-api/..."
```

## Pricing
- **Free** (Free) — 2,500 calls/Mo, 2 req/s
- **Basic** ($9/Mo) — 45,000 calls/Mo, 6 req/s
- **Pro** ($29/Mo) — 220,000 calls/Mo, 15 req/s
- **Mega** ($79/Mo) — 750,000 calls/Mo, 40 req/s

## Endpoints

### Sports

#### `GET /v1/leagues` — List leagues (all or filtered)

**Parameters:**
- `sport` (query, optional, string) — Sport (e.g. Soccer) Example: `Soccer`
- `country` (query, optional, string) — Country (e.g. England) Example: `England`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sports-api/v1/leagues?sport=Soccer&country=England"
```

**Response:**
```json
{
    "data": {
        "count": 5,
        "sport": "Soccer",
        "country": "England",
        "leagues": [
            {
                "id": "4570",
                "name": "EFL Cup",
                "sport": "Soccer",
                "alternate": "Football League Cup, Carabao Cup"
            },
            {
                "id": "4847",
                "name": "EFL Trophy",
                "sport": "Soccer",
                "alternate": "English Football League Trophy"
            },
            {
                "id": "5225",
                "name": "England Non League Div One Isthmian North",
                "sport": "Soccer",
                "alternate": "Non League Div One - Isthmian North"
            },
            {
                "id": "5226",
                "name": "England Non League Div One Isthmian South",
                "sport": "Soccer",
                "alternate": "Non League Div One - Isthmian South Central"
            },
            {
                "id": "5228",
                "name": "England Non League Div One Southern Central",
                "sport": "Soccer",
                "alternate": "Non League Div One - Southern South"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-29T23:46:51.014Z",
        "request_id": "12ab4aa2-52a4-4f87-824d-af58e34e4574"
    },
    "status": "ok",
    "message": "Leagues retrieved successfully",
    "success": true
}
```

#### `GET /v1/players` — Search players by name

**Parameters:**
- `q` (query, required, string) — Player name Example: `Messi`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sports-api/v1/players?q=Messi"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "query": "Messi",
        "players": [
            {
                "id": "34146370",
                "born": "1987-06-24",
                "name": "Lionel Messi",
                "team": "Inter Miami",
                "sport": "Soccer",
                "thumb": "https://r2.thesportsdb.com/images/media/player/thumb/kpfsvp1725295651.jpg",
                "height": null,
                "weight": null,
                "position": "Right Winger",
                "description": null,
                "nationality": "Argentina",
                "birth_location": null
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-29T23:46:51.534Z",
        "request_id": "ee2410f4-9965-4f63-bc7f-ab4b60d0a0d1"
    },
    "status": "ok",
    "message": "Players retrieved successfully",
    "success": true
}
```

#### `GET /v1/team` — Team details by id

**Parameters:**
- `id` (query, required, string) — Numeric team id Example: `133604`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sports-api/v1/team?id=133604"
```

**Response:**
```json
{
    "data": {
        "id": "133604",
        "logo": null,
        "name": "Arsenal",
        "badge": null,
        "sport": "Soccer",
        "league": "English Premier League",
        "country": "England",
        "stadium": "Emirates Stadium",
        "website": "www.arsenal.com",
        "alternate": "Arsenal Football Club, AFC, Arsenal FC",
        "description": "Arsenal Football Club is a professional football club based in Islington, London, England, that plays in the Premier League, the top flight of English football. The club has won 13 League titles, a record 13 FA Cups, 2 League Cups, 15 FA Community Shields, 1 League Centenary Trophy, 1 UEFA Cup Winners' Cup and 1 Inter-Cities Fairs Cup.\r\n\r\nArsenal was the first club from the South of England to join The Football League, in 1893, and they reached the First Division in 1904. Relegated only once, in 1913, they continue the longest streak in the top division, and have won the second-most top-flight…",
        "formed_year": "1892",
        "stadium_capacity": "60338",
        "stadium_location": null
    },
    "meta": {
        "timestamp": "2026-05-29T23:46:51.933Z",
        "request_id": "b9bedb78-1db5-4827-a95d-c78dfc0e1ac6"
    },
    "status": "ok",
    "message": "Team retrieved successfully",
    "success": true
}
```

#### `GET /v1/teams` — Search teams by name

**Parameters:**
- `q` (query, required, string) — Team name Example: `Arsenal`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sports-api/v1/teams?q=Arsenal"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "query": "Arsenal",
        "teams": [
            {
                "id": "133604",
                "logo": null,
                "name": "Arsenal",
                "badge": null,
                "sport": "Soccer",
                "league": "English Premier League",
                "country": "England",
                "stadium": "Emirates Stadium",
                "website": "www.arsenal.com",
                "alternate": "Arsenal Football Club, AFC, Arsenal FC",
                "description": "Arsenal Football Club is a professional football club based in Islington, London, England, that plays in the Premier League, the top flight of English football. The club has won 13 League titles, a record 13 FA Cups, 2 League Cups, 15 FA Community Shields, 1 League Centenary Trophy, 1 UEFA Cup Winners' Cup and 1 Inter-Cities Fairs Cup.\r\n\r\nArsenal was the first club from the South of England to join The Football League, in 1893, and they reached the First Division in 1904. Relegated only once, in 1913, they continue the longest streak in the top division, and have won the second-most top-flight…",
                "formed_year": "1892",
                "stadium_capacity": "60338",
                "stadium_location": null
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-29T23:46:52.277Z",
        "request_id": "864a12a0-a07e-4d41-a813-5a808e4c1253"
    },
    "status": "ok",
    "message": "Teams retrieved succe
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/sports-api
OpenAPI spec: https://www.oanor.com/api/sports-api/openapi.json
