# Olympics Athletes, Medals and Results (`scrapermaster/olympics-athletes-medals-results`) Actor

Olympic Games history: athlete biographies and participations, medal tables per edition, event results, medals by country and the full list of Games. Data from Olympedia.

- **URL**: https://apify.com/scrapermaster/olympics-athletes-medals-results.md
- **Developed by:** [Scraper Master](https://apify.com/scrapermaster) (community)
- **Categories:** Sports, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.36 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Olympics Athletes, Medals and Results

Collect structured Olympic data from the public pages of [Olympedia](https://www.olympedia.org): athlete profiles with every Games they entered, medal tables per Games, full event result lists, country medal histories and the list of all Games. Data comes from Olympedia, a volunteer-run reference site; this Actor is an independent tool and has no affiliation with it. Please credit Olympedia when you publish results.

### What you can do

| Mode | One output row is... | Typical input |
|---|---|---|
| `athlete` | one athlete, with bio, `participations` and `medals` | athlete ids or URLs |
| `edition-medal-table` | one country in the medal table of one Games | `Summer 2024`, `Winter 2022`, edition ids |
| `event-results` | one competitor or team in one event | result ids/URLs, or Games + sports |
| `country-medals` | one country, with medals per Games and best sports | NOC codes such as `USA` |
| `editions` | one Games (year, season, city, dates, size) | none (optional filters) |

All modes honor `maxItems`. If an input cannot be processed (unknown id, page missing) the Actor adds an error row (`"error": true`, with a message) and keeps going. Error rows do not count toward `maxItems`.

### Examples

Athlete profiles:

```json
{ "mode": "athlete", "athleteIds": ["128460", "https://www.olympedia.org/athletes/137711"], "includeBiography": true, "maxItems": 10 }
```

Medal tables:

```json
{ "mode": "edition-medal-table", "editions": ["Summer 2024", "Winter 2022"], "maxItems": 100 }
```

Event results, by result id or by Games + sport:

```json
{ "mode": "event-results", "resultIds": ["19019500"], "maxItems": 100 }
```

```json
{ "mode": "event-results", "resultIds": [], "editions": ["Winter 2022"], "sports": ["CUR"], "maxItems": 200 }
```

Country medals:

```json
{ "mode": "country-medals", "countries": ["USA", "NOR"], "maxItems": 5 }
```

List of Games:

```json
{ "mode": "editions", "season": "Winter", "includeDetails": true, "maxItems": 30 }
```

### Input

| Field | Used by | Description |
|---|---|---|
| `mode` | all | One of the five modes above. |
| `athleteIds` | athlete | Athlete ids or `/athletes/` URLs. |
| `includeBiography` | athlete | Add the written biography when the page has one. |
| `editions` | medal table, event results, editions | `Summer 2024`, `Winter 2022`, `2024` (if unambiguous), an edition id, or a URL. For `editions` it is an optional filter. |
| `resultIds` | event-results | Result ids or `/results/` URLs. |
| `sports` | event-results | Sport codes or names; adds all events of those sports in the chosen Games. |
| `countries` | country-medals | NOC codes or country URLs. |
| `season`, `includeDetails`, `includeOtherGames` | editions | Season filter, fetch athlete/event counts, include youth and intercalated Games. |
| `maxItems` | all | Maximum number of result rows. |
| `concurrency` | all | 1 or 2 parallel workers (hard cap 2). |
| `proxyConfiguration` | all | Optional; usually not needed. |

### Output fields

Athlete mode:

| Field | Meaning |
|---|---|
| `athleteId`, `name`, `fullName`, `usedName`, `nickNames` | identity |
| `sex`, `roles` | sex and roles (competitor, administrator, ...) |
| `bornDate`, `bornDateIso`, `bornPlace`, `diedDate`, `diedDateIso`, `diedPlace`, `diedAge` | life dates; the ISO field is set only for complete dates |
| `heightCm`, `weightKg` | measurements when listed |
| `nationality`, `noc`, `allNocs` | main country name and code; all codes if several |
| `affiliations` | clubs and similar |
| `participations[]` | `edition`, `editionId`, `year`, `season`, `sport`, `sportCode`, `noc`, `event`, `resultId`, `eventStatus`, `result` (position or status such as DNF), `medal` |
| `medals` | `gold`, `silver`, `bronze`, `total` as shown on the athlete page |
| `sports`, `editionsCompeted`, `firstYear`, `lastYear`, `biography`, `url` | derived summary |

Edition medal table: `edition`, `editionId`, `year`, `season`, `rank`, `country`, `noc`, `gold`, `silver`, `bronze`, `total`, `url`.

Event results: `resultId`, `event`, `edition`, `editionId`, `year`, `season`, `sport`, `sportCode`, `date`, `eventStatus`, `location`, `position`, `positionNumber`, `entryType` (`athlete` or `team`), `athleteId`, `athleteName`, `teamName`, `noc`, `result`, `medal`, `details` (all extra columns such as time, points, distance), `members` (team roster), `url`.

Country medals: `noc`, `country`, `olympicGamesParticipations`, `totalGold`, `totalSilver`, `totalBronze`, `totalMedals`, `bestEdition`, `medalsByEdition[]`, `bestSports[]` (top 10), `medalsBySport[]`, `url`.

Editions: `editionId`, `name`, `competitionType`, `number`, `year`, `season`, `city`, `hostCountryNoc`, `openingDate`, `closingDate`, `competitionDates`, `held`, `note`, `athletes`, `countries`, `medalEvents`, `disciplines`, `url`.

### Notes and limitations

- Only public pages are read. Requests are spaced by a random 0.8 to 1.8 seconds, at most 2 run at once, and 429/5xx answers are retried with growing waits. Large runs therefore take time; this is intentional.
- Medal tables come from the Games overview page. Olympedia assigns medals by its own rules, so numbers can differ slightly from other sources (for example around stripped medals or mixed teams).
- In `event-results` only the first (final standings) table of a result page is read; heats, rounds and individual matches are not output. For team sports, `result` is the best matching stats column and the rest is in `details`.
- Some pages have partial data: missing birth places, no measurements, dates with only a year, positions given as status codes. These come through as `null` or raw text.
- `country-medals` totals count Olympic Games only (not Youth or Intercalated); `medalsByEdition` lists every competition type with a `competitionType` field.
- A `Summer`/`Winter` word is required for `editions` text when a bare year is shared by both seasons (1924 to 1992).
- Page layout may change on the source site, which could affect parsing.

### Running locally

```bash
npm install
./run-test.sh '{"mode":"editions","maxItems":3}'
```

`run-test.sh` sets `CRAWLEE_STORAGE_DIR=./storage`, writes the input to local storage and prints the dataset rows. No account or token is needed.

# Actor input Schema

## `mode` (type: `string`):

What to collect. athlete: one row per athlete with participations and medals. edition-medal-table: one row per country for a Games. event-results: one row per competitor/team in an event. country-medals: one row per country with per-edition medals and best sports. editions: one row per Games.

## `athleteIds` (type: `array`):

Olympedia athlete ids or athlete page URLs, e.g. 128460 or https://www.olympedia.org/athletes/128460.

## `includeBiography` (type: `boolean`):

Add the free-text biography of each athlete (when the page has one).

## `editions` (type: `array`):

Used by edition-medal-table, event-results (together with Sports) and editions (as an optional filter, leave empty for all Games). Accepts names such as 'Summer 2024' or 'Winter 2022', a plain edition id such as 63, or an Olympedia edition URL.

## `resultIds` (type: `array`):

Olympedia result ids or URLs, e.g. 19019500 (Downhill, Men, Beijing 2022) or https://www.olympedia.org/results/19019500.

## `sports` (type: `array`):

Optional. Sport codes or names (e.g. CUR, 'Alpine Skiing'). Every event of these sports in the chosen Games is added to the result ids above.

## `countries` (type: `array`):

Three-letter NOC codes as used by Olympedia, e.g. USA, NOR, GBR, or country page URLs.

## `season` (type: `string`):

Only list Summer or Winter Games.

## `includeDetails` (type: `boolean`):

Open each Games page to add number of athletes, countries, medal events and disciplines. Costs one extra request per Games.

## `includeOtherGames` (type: `boolean`):

Also list Youth Olympic Games and the 1906 Intercalated Games.

## `maxItems` (type: `integer`):

Stop after this many result rows (error rows are not counted).

## `concurrency` (type: `integer`):

Parallel workers. Capped at 2 to stay gentle with the source site, which is volunteer-run.

## `proxyConfiguration` (type: `object`):

Optional. Normally not needed; the site serves public pages without a proxy.

## Actor input object example

```json
{
  "mode": "athlete",
  "athleteIds": [
    "128460",
    "137711"
  ],
  "includeBiography": false,
  "editions": [
    "Winter 2022"
  ],
  "resultIds": [
    "19019500"
  ],
  "countries": [
    "USA",
    "NOR"
  ],
  "season": "any",
  "includeDetails": true,
  "includeOtherGames": false,
  "maxItems": 10,
  "concurrency": 1
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "athleteIds": [
        "128460",
        "137711"
    ],
    "editions": [
        "Winter 2022"
    ],
    "resultIds": [
        "19019500"
    ],
    "countries": [
        "USA",
        "NOR"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapermaster/olympics-athletes-medals-results").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "athleteIds": [
        "128460",
        "137711",
    ],
    "editions": ["Winter 2022"],
    "resultIds": ["19019500"],
    "countries": [
        "USA",
        "NOR",
    ],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapermaster/olympics-athletes-medals-results").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "athleteIds": [
    "128460",
    "137711"
  ],
  "editions": [
    "Winter 2022"
  ],
  "resultIds": [
    "19019500"
  ],
  "countries": [
    "USA",
    "NOR"
  ],
  "maxItems": 10
}' |
apify call scrapermaster/olympics-athletes-medals-results --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapermaster/olympics-athletes-medals-results"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IJK8HqJ927dwfd8jT/builds/fjnNDE4ECzT6BJkYf/openapi.json
