# Tournament Scheduler API
> Generate tournament schedules — entirely locally. The roundrobin endpoint builds a full round-robin fixture list in which every participant plays every other exactly once, or twice (home and away) with double=true, using the classic circle method: it balances home and away across the rounds and, when there is an odd number of entrants, automatically gives each a bye in turn. The bracket endpoint builds a single-elimination knockout bracket: it rounds the field up to the next power of two, seeds the entrants in standard bracket order so the top seed meets the lowest and the strongest only meet in later rounds, awards the byes to the highest seeds, and lays out every round through the Final with the right names (Quarterfinal, Semifinal, Final). Pass a list of team or player names, or simply a number of participants. Everything is computed locally and deterministically, so it is instant and private. Ideal for sports leagues and apps, esports and gaming ladders, club and school competitions, hackathons and any event that needs fair fixtures. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This generates the schedule; for live scores, results and real-world fixtures use a sports data API.

## 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/tournament-api/..."
```

## Pricing
- **Free** (Free) — 3,635 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 13,150 calls/Mo, 8 req/s
- **Pro** ($25/Mo) — 182,500 calls/Mo, 20 req/s
- **Mega** ($63/Mo) — 955,000 calls/Mo, 50 req/s

## Endpoints

### Tournament

#### `GET /v1/bracket` — Single-elimination bracket

**Parameters:**
- `participants` (query, required, string) — A list of names or a number Example: `8`
- `seeded` (query, optional, string) — true (default) for standard seeding

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tournament-api/v1/bracket?participants=8"
```

**Response:**
```json
{
    "data": {
        "byes": 0,
        "type": "single-elimination",
        "rounds": 3,
        "seeded": true,
        "schedule": [
            {
                "name": "Quarterfinal",
                "round": 1,
                "matches": [
                    {
                        "away": "8",
                        "home": "1"
                    },
                    {
                        "away": "5",
                        "home": "4"
                    },
                    {
                        "away": "7",
                        "home": "2"
                    },
                    {
                        "away": "6",
                        "home": "3"
                    }
                ]
            },
            {
                "name": "Semifinal",
                "round": 2,
                "matches": [
                    {
                        "away": "TBD",
                        "home": "TBD"
                    },
                    {
                        "away": "TBD",
                        "home": "TBD"
                    }
                ]
            },
            {
                "name": "Final",
                "round": 3,
                "matches": [
                    {
                        "away": "TBD",
                        "home": "TBD"
                    }
                ]
            }
        ],
        "bracket_size": 8,
        "participants": 8
    },
    "meta": {
        "timestamp"
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/roundrobin` — Round-robin schedule

**Parameters:**
- `participants` (query, required, string) — A list of names (comma or JSON) or a number Example: `A,B,C,D`
- `double` (query, optional, string) — true for a double round-robin (home and away)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tournament-api/v1/roundrobin?participants=A%2CB%2CC%2CD"
```

**Response:**
```json
{
    "data": {
        "type": "round-robin",
        "rounds": 3,
        "schedule": [
            {
                "round": 1,
                "matches": [
                    {
                        "away": "D",
                        "home": "A"
                    },
                    {
                        "away": "C",
                        "home": "B"
                    }
                ]
            },
            {
                "round": 2,
                "matches": [
                    {
                        "away": "A",
                        "home": "C"
                    },
                    {
                        "away": "D",
                        "home": "B"
                    }
                ]
            },
            {
                "round": 3,
                "matches": [
                    {
                        "away": "B",
                        "home": "A"
                    },
                    {
                        "away": "D",
                        "home": "C"
                    }
                ]
            }
        ],
        "total_games": 6,
        "participants": 4
    },
    "meta": {
        "timestamp": "2026-06-03T09:24:59.779Z",
        "request_id": "10ec9720-d67b-4491-9695-608fc0ed0ac6"
    },
    "status": "ok",
    "message": "Round-robin schedule",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tournament-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "Tournament Scheduler API",
        "notes": "Round-robin with an odd count adds a bye each round. Brackets round up to a power of two and give byes to the highest seeds; later rounds are TBD until winners are known. This generates schedules — for live sports results and fixtures use a sports data API. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/roundrobin",
                "params": {
                    "double": "true for a double round-robin (home and away)",
                    "participants": "a list of names (comma or JSON) or a number"
                },
                "returns": "the round-by-round schedule with byes"
            },
            {
                "path": "/v1/bracket",
                "params": {
                    "seeded": "true (default) for standard seeding so byes go to top seeds",
                    "participants": "a list of names or a number"
                },
                "returns": "the single-elimination bracket, round by round"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Generate tournament schedules. The roundrobin endpoint builds a full round-robin fixture list where every participant plays every other exactly once (or twice, home and away, with double=true) — using the circle method, bal
…(truncated, see openapi.json for full schema)
```


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