# Rio 2016 Olympics API
> Every athlete who competed at the 2016 Summer Olympic Games in Rio de Janeiro as an API — a self-contained historical reference for sports apps, quizzes, dashboards and data-journalism. For each of 11,500+ athletes the API returns their name, nationality (with the ISO 3166-1 alpha-2 code and flag emoji), sex, date of birth, height, weight, sport and the medals won (gold, silver, bronze). Look an athlete up by name, search, list the athletes of a country or a sport (28 sports), or RANK athletes by their Rio 2016 medal haul — the most decorated competitors of the Games. Served from memory — always fast.

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

## Pricing
- **Free** (Free) — 11,000 calls/Mo, 3 req/s
- **Starter** ($4/Mo) — 120,000 calls/Mo, 10 req/s
- **Pro** ($12/Mo) — 600,000 calls/Mo, 20 req/s
- **Mega** ($31/Mo) — 3,000,000 calls/Mo, 50 req/s

## Endpoints

### Lookup

#### `GET /v1/athlete` — Athlete by name or id

**Parameters:**
- `name` (query, optional, string) — Athlete name Example: `Usain Bolt`
- `id` (query, optional, string) — Athlete id

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rio2016-api/v1/athlete?name=Usain+Bolt"
```

**Response:**
```json
{
    "data": {
        "athlete": {
            "id": "579416064",
            "sex": "male",
            "code": "JM",
            "gold": 3,
            "name": "Usain Bolt",
            "emoji": "🇯🇲",
            "sport": "athletics",
            "total": 3,
            "bronze": 0,
            "height": 1.96,
            "silver": 0,
            "weight": 95,
            "country": "Jamaica",
            "nationality": "JAM",
            "date_of_birth": "1986-08-21"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:04.074Z",
        "request_id": "771ac803-7a05-4f95-8829-313e141d1047"
    },
    "status": "ok",
    "message": "Athlete retrieved successfully",
    "success": true
}
```

### Search

#### `GET /v1/search` — Search athletes by name

**Parameters:**
- `q` (query, required, string) — Search query (min 2 chars) Example: `phelps`
- `limit` (query, optional, string) — Max results (1-100) Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rio2016-api/v1/search?q=phelps&limit=25"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "query": "phelps",
        "total": 1,
        "athletes": [
            {
                "id": "491565031",
                "sex": "male",
                "code": "US",
                "gold": 5,
                "name": "Michael Phelps",
                "emoji": "🇺🇸",
                "sport": "aquatics",
                "total": 6,
                "bronze": 0,
                "height": 1.94,
                "silver": 1,
                "weight": 90,
                "country": "United States of America",
                "nationality": "USA",
                "date_of_birth": "1985-06-30"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:04.225Z",
        "request_id": "61746ac3-193d-4857-883e-1ae3e66f12fc"
    },
    "status": "ok",
    "message": "Search results retrieved successfully",
    "success": true
}
```

### Country

#### `GET /v1/country` — Athletes of a country

**Parameters:**
- `code` (query, required, string) — IOC / ISO country code Example: `USA`
- `limit` (query, optional, string) — Page size (1-500) Example: `50`
- `offset` (query, optional, string) — Offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rio2016-api/v1/country?code=USA&limit=50&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "total": 567,
        "country": "USA",
        "athletes": [
            {
                "id": "2538424",
                "sex": "male",
                "code": "US",
                "gold": 0,
                "name": "Andrew Evans",
                "emoji": "🇺🇸",
                "sport": "athletics",
                "total": 0,
                "bronze": 0,
                "height": 1.99,
                "silver": 0,
                "weight": 113,
                "country": "United States of America",
                "nationality": "USA",
                "date_of_birth": "1991-01-25"
            },
            {
                "id": "2710032",
                "sex": "female",
                "code": "US",
                "gold": 0,
                "name": "Mikaela Joslin Mayer",
                "emoji": "🇺🇸",
                "sport": "boxing",
                "total": 0,
                "bronze": 0,
                "height": 1.76,
                "silver": 0,
                "weight": null,
                "country": "United States of America",
                "nationality": "USA",
                "date_of_birth": "1990-07-04"
            },
            {
                "id": "8906492",
                "sex": "male",
                "code": "US",
                "gold": 0,
                "name": "Ben Kanute",
                "emoji": "🇺🇸",
                "sport": "triathlon",
                "total": 0,
   
…(truncated, see openapi.json for full schema)
```

### Sport

#### `GET /v1/sport` — Athletes in a sport

**Parameters:**
- `sport` (query, required, string) — Sport (28 available) Example: `athletics`
- `limit` (query, optional, string) — Page size (1-500) Example: `50`
- `offset` (query, optional, string) — Offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rio2016-api/v1/sport?sport=athletics&limit=50&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "sport": "athletics",
        "total": 2363,
        "athletes": [
            {
                "id": "947726",
                "sex": "male",
                "code": "KE",
                "gold": 0,
                "name": "Boniface Mucheru Tumuti",
                "emoji": "🇰🇪",
                "sport": "athletics",
                "total": 1,
                "bronze": 0,
                "height": 1.75,
                "silver": 1,
                "weight": 72,
                "country": "Kenya",
                "nationality": "KEN",
                "date_of_birth": "1992-05-02"
            },
            {
                "id": "1009342",
                "sex": "female",
                "code": "AU",
                "gold": 0,
                "name": "Ella Nelson",
                "emoji": "🇦🇺",
                "sport": "athletics",
                "total": 0,
                "bronze": 0,
                "height": 1.69,
                "silver": 0,
                "weight": 58,
                "country": "Australia",
                "nationality": "AUS",
                "date_of_birth": "1994-05-10"
            },
            {
                "id": "1089850",
                "sex": "female",
                "code": "KE",
                "gold": 0,
                "name": "Eunice Jepkoech Sum",
                "emoji": "🇰🇪",
                "sport": "athletics",
                "total": 0,
                "bro
…(truncated, see openapi.json for full schema)
```

### Medals

#### `GET /v1/medals` — Athletes ranked by medal haul

**Parameters:**
- `limit` (query, optional, string) — How many (1-250) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rio2016-api/v1/medals?limit=10"
```

**Response:**
```json
{
    "data": {
        "basis": "Rio 2016 medals (gold, then silver, then bronze)",
        "count": 10,
        "ranking": [
            {
                "id": "491565031",
                "sex": "male",
                "code": "US",
                "gold": 5,
                "name": "Michael Phelps",
                "rank": 1,
                "emoji": "🇺🇸",
                "sport": "aquatics",
                "total": 6,
                "bronze": 0,
                "height": 1.94,
                "silver": 1,
                "weight": 90,
                "country": "United States of America",
                "nationality": "USA",
                "date_of_birth": "1985-06-30"
            },
            {
                "id": "960103057",
                "sex": "female",
                "code": "US",
                "gold": 4,
                "name": "Katie Ledecky",
                "rank": 2,
                "emoji": "🇺🇸",
                "sport": "aquatics",
                "total": 5,
                "bronze": 0,
                "height": 1.83,
                "silver": 1,
                "weight": 72,
                "country": "United States of America",
                "nationality": "USA",
                "date_of_birth": "1997-03-17"
            },
            {
                "id": "770111957",
                "sex": "female",
                "code": "US",
                "gold": 4,
                "name": "Simone Biles",
                "rank": 3,
  
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

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

**Response:**
```json
{
    "data": {
        "service": "rio2016-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/sport": "Athletes in a sport (sport=, e.g. athletics).",
            "GET /v1/medals": "Athletes ranked by Rio 2016 medal haul (limit).",
            "GET /v1/search": "Search athletes by name (q=, min 2 chars).",
            "GET /v1/athlete": "Athlete by name (name=, e.g. Usain Bolt) or id (id=).",
            "GET /v1/country": "Athletes of a country (code=, e.g. USA or US)."
        },
        "description": "Every athlete at the Rio 2016 Summer Olympics: name, nationality (with ISO alpha-2 code and flag emoji), sex, date of birth, height, weight, sport and medals (gold/silver/bronze). Look up by name, search, list by country or sport, or rank athletes by medal haul. No key.",
        "total_sports": 28,
        "total_athletes": 11538
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:04.775Z",
        "request_id": "ea64ab6d-6c43-41fe-9d9f-e27ea9162c3a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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