# Lichess Players Games Scraper (`kawsar/lichess-players-games-scraper`) Actor

Extract top Lichess leaderboard rankings, player titles, and rating stats automatically. Download clean datasets directly in JSON, CSV, or Excel formats for trend tracking, rating dashboards, and chess research.

- **URL**: https://apify.com/kawsar/lichess-players-games-scraper.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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

## Lichess Players & Games Scraper

Collect publicly available Lichess leaderboard data and explore top players across different chess time controls and variants. Retrieve player usernames, ratings, progress, and chess titles in a structured dataset. Export results in JSON, CSV, Excel, and other supported Apify formats.

### What it does

This actor collects top-ranked Lichess players for a selected performance category. Each player is organized into a dataset row containing their username, player ID, available ratings, and chess title. Duplicate players are removed using `playerId`.

### Modes

| Mode | Description |
| --- | --- |
| `top` | Collects the top players for a selected performance category. This is the only supported mode. |

### Use cases

- **Leaderboard snapshots:** Save top blitz, rapid, or bullet players for rating comparisons and trend analysis.
- **Chess title research:** Explore titled players, including Grandmasters and International Masters.
- **Rating analysis:** Use player performance statistics to build dashboards and spreadsheets.
- **Chess research:** Compare player rankings across different time controls and chess variants.
- **Bulk exports:** Collect leaderboard data and download it in CSV or Excel for further analysis.

### Input parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | string | `top` | Collection mode. Only leaderboard collection is supported. |
| `perfType` | string | `blitz` | Performance category, such as bullet, blitz, rapid, or classical. |
| `nb` | integer | `50` | Number of top players to request. |
| `maxItems` | integer | `100` | Maximum number of successful dataset rows. |
| `userAgent` | string | `kawsarActorResearch/1.0` | User-Agent value used for requests. |
| `timeoutSecs` | integer | `300` | Overall actor run timeout, in seconds. |
| `requestTimeoutSecs` | integer | `30` | Individual request timeout, in seconds. |
| `proxyConfiguration` | object | No proxy | Optional proxy configuration. |

### Input example

```json
{
  "mode": "top",
  "perfType": "blitz",
  "nb": 50,
  "maxItems": 100,
  "userAgent": "kawsarActorResearch/1.0",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### What data does this actor extract?

| Field | Type | Description |
| --- | --- | --- |
| `playerId` | string | Lichess player ID and primary identifier. |
| `username` | string | Lichess username. |
| `perfs` | object | Available performance ratings and progress statistics. |
| `playerTitle` | string | Chess title, such as GM or IM, when available. |
| `scrapedAt` | string | Collection timestamp in ISO format. |

### Output example

```json
{
  "playerId": "athena-pallada",
  "username": "athena-pallada",
  "perfs": {
    "blitz": {
      "rating": 2991,
      "progress": -10
    }
  },
  "playerTitle": "GM",
  "scrapedAt": "2026-10-12T12:00:00+00:00",
}
```

If a request fails or the input cannot be processed, the actor records an error row containing `error`, `input`, `url`, `status`, and `message`.

### FAQ

**Which performance categories are supported?**

Common categories include `ultraBullet`, `bullet`, `blitz`, `rapid`, `classical`, and `correspondence`. Chess variants include `chess960`, `crazyhouse`, `antichess`, `atomic`, `horde`, `kingOfTheHill`, `racingKings`, and `threeCheck`.

**Why are the fields named `playerTitle` and `playerId`?**

These names avoid reserved dataset field names. Their values correspond to the player's title and ID information provided by Lichess.

**How many players can I collect?**

The number of results depends on the requested `nb` value and the `maxItems` setting. The Lichess leaderboard request supports up to 200 players.

**Can I collect different chess variants?**

Yes. Select a supported `perfType` value to collect leaderboard information for different chess formats and variants.

### Trademark Notice

Lichess and its associated names, logos, and trademarks belong to their respective owners. This actor is an independent tool and does not imply affiliation, sponsorship, endorsement, or partnership with Lichess.

### Disclaimer

This actor is provided for independent research and data collection. Users are responsible for ensuring that their collection and use of player information comply with applicable laws and the source website's policies.

### Is Web Scraping Legal?

This actor collects publicly accessible Lichess leaderboard and player information without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source website's policies.

- **Personal Data:** Player usernames, titles, and rating information may relate to identifiable individuals. Handle this information responsibly and follow applicable privacy laws, including GDPR and CCPA where relevant.
- **Copyright and Licensing:** Player statistics are primarily factual information, but associated descriptions, images, and other creative content may be protected. Respect applicable licences and attribution requirements.
- **Platform Terms and Rate Limits:** Respect Lichess policies, applicable terms, and reasonable request limits when collecting or using leaderboard information.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional if you need advice about a specific use case.

[Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

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

What to scrape. Leaderboard pulls top players for a perf type.

## `perfType` (type: `string`):

Lichess perf type: bullet, blitz, rapid, classical, ultraBullet, correspondence, chess960, crazyhouse, antichess, atomic, horde, kingOfTheHill, racingKings, threeCheck.

## `nb` (type: `integer`):

How many top players to request (Lichess max 200).

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

Stop after this many successful rows. Hard max is 1000.

## `userAgent` (type: `string`):

Identify your scraper in the User-Agent header.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

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

Optional proxy. Lichess public API usually works without one; leave off unless you hit blocks.

## Actor input object example

```json
{
  "mode": "top",
  "perfType": "blitz",
  "nb": 50,
  "maxItems": 100,
  "userAgent": "kawsarActorResearch/1.0 (contact: hello@kawsar.com)",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "mode": "top",
    "perfType": "blitz",
    "nb": 50,
    "maxItems": 100,
    "userAgent": "kawsarActorResearch/1.0 (contact: hello@kawsar.com)",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/lichess-players-games-scraper").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 = {
    "mode": "top",
    "perfType": "blitz",
    "nb": 50,
    "maxItems": 100,
    "userAgent": "kawsarActorResearch/1.0 (contact: hello@kawsar.com)",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/lichess-players-games-scraper").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 '{
  "mode": "top",
  "perfType": "blitz",
  "nb": 50,
  "maxItems": 100,
  "userAgent": "kawsarActorResearch/1.0 (contact: hello@kawsar.com)",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kawsar/lichess-players-games-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/lichess-players-games-scraper"
        }
    }
}
```

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/otaKyCnYGYmL9Jha4/builds/Ed1MH7Dka6mC7KEoS/openapi.json
