OpenAny
Get API keyAPI Key
APIData

chess logo
Chess.com & Lichess Player Games API

Get Chess.com or Lichess player games with PGN in JSON via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as limit, output, raw, and retrieve structured data including source game identifier, pgn, source game time class, and source game result notation for chess reference, and record navigation.

Selected price
$0.002 / billing creditPublished pricing
Sellers / APIs
1 / 1
Requests · 30d
0Selected implementation · last 30 days
Success rate · 30d
—No requests in this period
USE THIS API

Chess.com & Lichess Player Games API

Prepare your request, then continue with your agent.

Pricing

$0.002 / billing credit

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Provider
API
Pricing
Connect your agent
On this page

Overview

Overview
Chess.com & Lichess Player Games API

Chess.com & Lichess Player Games API

Pass username and site with supported filters. from/since accept dates or epoch milliseconds, to is inclusive; pagination differs between Chess.com next_to and Lichess next_until/next_after.

Quick Facts

Fact Value
Access OpenAny REST
Authentication OpenAny API key in the Authorization header
Core inputs Required: username. Optional: site, month, limit, perf, rated, until, time_class, color, result, opponent, since, analysed, from, to, opening, eco, sort, after, ongoing, clocks. JSON output; fresh=1 bypasses cache and raw=0 omits raw source blocks.
Selected implementation apish · Chess a player's games with PGN API
Billing See the pricing area for the selected implementation and request options

What You Can Build

  • Chess reference: Keep source site and entity identity.
  • Record navigation: Preserve the site-specific category and time-control scope.

Returned Data

Field Meaning
games[].id Source game identifier
games[].pgn Source PGN text within the JSON game record
games[].time_class Source game time class
games[].result Source game result notation

Quick Start

  1. Set OPENANY_API_KEY to your OpenAny API key.
  2. Review the selected implementation and pricing, then adapt the request below to your target.
  3. Check the HTTP response and business result before reading optional fields.
bash
curl --request GET --get \
  https://api.openany.si/v1/agent-apis/apish/chess/v1/games \
  -H "Authorization: Bearer ${OPENANY_API_KEY}" \
  --data-urlencode limit=1 \
  --data-urlencode output=json \
  --data-urlencode raw=0 \
  --data-urlencode username=hikaru

Request and Response Examples

The response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.

Published Chess.com & Lichess Player Games API implementation contract.

Pricing and Billing

The pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service's public availability does not determine OpenAny billing.

Frequently Asked Questions

View FAQ

Related APIs

Playground

Run sends a real API request. Charges follow the published API contract.

Request parameters
Username.
Optional parameters (25)
chesscom or lichess.
YYYY-MM: games of that month.
Games to return (chess.com 1-500, lichess 1-100; default 50).
lichess only: bullet, blitz, rapid, classical, correspondence, chess960 ...
lichess only: true rated games only, false casual only.
lichess only: `next_until` from the previous page.
Only games of this time class: bullet, blitz, rapid, daily (lichess: correspondence) or classical (lichess). On lichess it stands in for `perf` when `perf` is not given.
Only games the player had this colour in.
Only games the player won, lost or drew. On lichess it is applied to the page of games fetched, so a page can hold fewer than `limit` games; keep paging with `next_until`.
Only games against this username.
Games played from this date (YYYY-MM-DD or epoch milliseconds). Same as `from`.
lichess only: true for games with computer analysis, false for games without.
Games played from this date (YYYY-MM-DD or epoch milliseconds).
Games played up to this date, inclusive (YYYY-MM-DD or epoch milliseconds). chess.com pages with `next_to`.
Only games whose opening name contains this text (e.g. sicilian defense, queens gambit declined).
Only games whose ECO code starts with this (e.g. B90, B9 or B).
lichess only: newest first (default) or oldest first (page with `next_after` as `after`).
lichess only, with sort=oldest: `next_after` from the previous page.
lichess only: true also returns games still being played.
lichess only: true adds the clock after every move (`clocks_centiseconds`).
0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
1 skips the 24-hour cache and fetches live.
JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Sample response

Run a request to see the actual response. Published samples are in Examples.

Response result

Sellers

SellerPricingRequests · 30dPerformanceAccess
apishCurrent
Chess a player's games with PGN API · GET · View API reference
$0.002 / billing credit0
—successP50—
Selected implementation traffic · 11/3/2026 – 12/3/2026 (UTC)
Selected pricing · apishUSD / billing credit
Pricing
$0.002

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 3. Price update time: not supplied.

API

Method
GET
Endpoint
https://api.openany.si/v1/agent-apis/apish/chess/v1/games
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
View request and response examples

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
usernameURL query parametersquerystringYes

Username.

siteURL query parametersquerystringNo

chesscom or lichess.

enum: "chesscom", "lichess"

monthURL query parametersquerystringNo

YYYY-MM: games of that month.

limitURL query parametersqueryintegerNo

Games to return (chess.com 1-500, lichess 1-100; default 50).

perfURL query parametersquerystringNo

lichess only: bullet, blitz, rapid, classical, correspondence, chess960 ...

ratedURL query parametersquerybooleanNo

lichess only: true rated games only, false casual only.

untilURL query parametersquerystringNo

lichess only: `next_until` from the previous page.

time_classURL query parametersquerystringNo

Only games of this time class: bullet, blitz, rapid, daily (lichess: correspondence) or classical (lichess). On lichess it stands in for `perf` when `perf` is not given.

enum: "bullet", "blitz", "rapid", "daily", "classical"

colorURL query parametersquerystringNo

Only games the player had this colour in.

enum: "white", "black"

resultURL query parametersquerystringNo

Only games the player won, lost or drew. On lichess it is applied to the page of games fetched, so a page can hold fewer than `limit` games; keep paging with `next_until`.

enum: "win", "loss", "draw"

opponentURL query parametersquerystringNo

Only games against this username.

sinceURL query parametersquerystringNo

Games played from this date (YYYY-MM-DD or epoch milliseconds). Same as `from`.

analysedURL query parametersquerystringNo

lichess only: true for games with computer analysis, false for games without.

enum: "true", "false"

fromURL query parametersquerystringNo

Games played from this date (YYYY-MM-DD or epoch milliseconds).

toURL query parametersquerystringNo

Games played up to this date, inclusive (YYYY-MM-DD or epoch milliseconds). chess.com pages with `next_to`.

openingURL query parametersquerystringNo

Only games whose opening name contains this text (e.g. sicilian defense, queens gambit declined).

ecoURL query parametersquerystringNo

Only games whose ECO code starts with this (e.g. B90, B9 or B).

sortURL query parametersquerystringNo

lichess only: newest first (default) or oldest first (page with `next_after` as `after`).

enum: "newest", "oldest"

afterURL query parametersquerystringNo

lichess only, with sort=oldest: `next_after` from the previous page.

ongoingURL query parametersquerystringNo

lichess only: true also returns games still being played.

enum: "true", "false"

clocksURL query parametersquerybooleanNo

lichess only: true adds the clock after every move (`clocks_centiseconds`).

rawURL query parametersquerystringNo

0 leaves out the bulky `raw` source blocks (often 10-30x smaller).

enum: "0", "1"

fieldsURL query parametersquerystringNo

Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.

freshURL query parametersquerystringNo

1 skips the 24-hour cache and fetches live.

enum: "1"

outputURL query parametersquerystringNo

JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.

enum: "json"

recordsURL query parametersquerystringNo

With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Required markers inside a nested object or variant apply when that object or variant is used.

Response structure

Inferred from examples
  • cachedboolean
  • countinteger
  • credits_usedinteger
  • fetched_atstring
  • gamesobject[]
    • accuraciesobject
      • blacknumber
      • whitenumber
    • blackobject
      • ratinginteger
      • resultstring
      • usernamestring
    • ecostring
    • end_timestring
    • fenstring
    • idstring
    • openingstring
    • pgnstring
    • ratedboolean
    • resultstring
    • rulesstring
    • start_timestring
    • terminationstring
    • time_classstring
    • time_controlstring
    • urlstring
    • whiteobject
      • ratinginteger
      • resultstring
      • usernamestring
  • monthstring
  • monthsstring[]
  • previous_monthstring
  • sitestring
  • usernamestring

Composite rule pricing

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Base fee: $0.000000. One matching variant replaces the base fee. Matching add-ons and quantity charges are added.

Fee itemPriceMetering sourceWhenQuantity limit
Actual API.SH credits consumed$0.002000 / billing creditResponse · /credits_used · Numeric valueAlways1 billing credit · Decimal places: 0

Each quantity charge is rounded before summing: ceil. Requests exceeding this cost limit are rejected; it is not a price cap: $0.002000.

Response quantities settle after the response. Before execution, the maximum quantity determines the reservation; unused reservation is released. Missing or invalid quantities are not treated as zero.

Pricing parameters and defaults
[]

Agent integration

Copy the resource contract without sharing an API key.

Download MDView API Markdown

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

Official example · Live API.SH response · Minimal request

Example from the provider's documentation. Field values in your results will differ.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 26

    Review these request fields before running. Keep the published provider and request method unchanged.

    username
    Username.
    site
    chesscom or lichess.
    month
    YYYY-MM: games of that month.
    limit
    Games to return (chess.com 1-500, lichess 1-100; default 50).
    perf
    lichess only: bullet, blitz, rapid, classical, correspondence, chess960 ...
    rated
    lichess only: true rated games only, false casual only.
    until
    lichess only: `next_until` from the previous page.
    time_class
    Only games of this time class: bullet, blitz, rapid, daily (lichess: correspondence) or classical (lichess). On lichess it stands in for `perf` when `perf` is not given.
    color
    Only games the player had this colour in.
    result
    Only games the player won, lost or drew. On lichess it is applied to the page of games fetched, so a page can hold fewer than `limit` games; keep paging with `next_until`.
    opponent
    Only games against this username.
    since
    Games played from this date (YYYY-MM-DD or epoch milliseconds). Same as `from`.
    analysed
    lichess only: true for games with computer analysis, false for games without.
    from
    Games played from this date (YYYY-MM-DD or epoch milliseconds).
    to
    Games played up to this date, inclusive (YYYY-MM-DD or epoch milliseconds). chess.com pages with `next_to`.
    opening
    Only games whose opening name contains this text (e.g. sicilian defense, queens gambit declined).
    eco
    Only games whose ECO code starts with this (e.g. B90, B9 or B).
    sort
    lichess only: newest first (default) or oldest first (page with `next_after` as `after`).
    after
    lichess only, with sort=oldest: `next_after` from the previous page.
    ongoing
    lichess only: true also returns games still being played.
    clocks
    lichess only: true adds the clock after every move (`clocks_centiseconds`).
    raw
    0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
    fields
    Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
    fresh
    1 skips the 24-hour cache and fetches live.
    output
    JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
    records
    With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/apish/chess/v1/games?limit=1&output=json&raw=0&username=hikaru' \
      -X GET \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json'
  3. Check the response

    Sample response · Documented HTTP 200

    Sample response
    {
      "cached": false,
      "count": 1,
      "credits_used": 1,
      "fetched_at": "2026-11-19T12:20:22.790Z",
      "games": [
        {
          "accuracies": {
            "black": 68.59,
            "white": 66.72
          },
          "black": {
            "rating": 3080,
            "result": "resigned",
            "username": "Carnivoras"
          },
          "eco": "A01",
          "end_time": "2026-11-19T01:35:02.000Z",
          "fen": "1Q2k3/2Rb2q1/3p3r/3P1p2/4p2p/PP2PpP1/5P2/6K1 b - - 1 39",
          "id": "9dd53891-e3b8-11f1-baf4-33d19f01000f",
          "opening": "Nimzowitsch Larsen Attack Modern Variation 2.Bb2 Nc6 3.c4 g6",
          "pgn": "[Event \"Live Chess\"]\n[Site \"Chess.com\"]\n[Date \"2026.11.19\"]\n[Round \"-\"]\n[White \"Hikaru\"]\n[Black \"Carnivoras\"]\n[Result \"1-0\"]\n[CurrentPosition \"1Q2k3/2Rb2q1/3p3r/3P1p2/4p2p/PP2PpP1/5P2/6K1 b - - 1 39\"]\n[Timezone \"UTC\"]\n[ECO \"A01\"]\n[ECOUrl \"https://www.chess.com/openings/Nimzowitsch-Larsen-Attack-Modern-Variation-2.Bb2-Nc6-3.c4-g6\"]\n[UTCDate \"2026.11.19\"]\n[UTCTime \"01:29:08\"]\n[WhiteElo \"3465\"]\n[BlackElo \"3080\"]\n[TimeControl \"180\"]\n[Termination \"Hikaru won by resignation\"]\n[StartTime \"01:29:08\"]\n[EndDate \"2026.11.19\"]\n[EndTime \"01:35:02\"]\n[Link \"https://www.chess.com/game/live/187517802954\"]\n\n1. b3 {[%clk 0:03:00]} 1... e5 {[%clk 0:03:00]} 2. Bb2 {[%clk 0:02:59.1]} 2... Nc6 {[%clk 0:02:59.7]} 3. c4 {[%clk 0:02:58.3]} 3... g6 {[%clk 0:02:57.1]} 4. g3 {[%clk 0:02:57.2]} 4... Bg7 {[%clk 0:02:56.5]} 5. Bg2 {[%clk 0:02:56.9]} 5... f5 {[%clk 0:02:49.9]} 6. e3 {[%clk 0:02:55.3]} 6... d6 {[%clk 0:02:49.6]} 7. Ne2 {[%clk 0:02:54.4]} 7... Nf6 {[%clk 0:02:49]} 8. d4 {[%clk 0:02:53.8]} 8... e4 {[%clk 0:02:47.7]} 9. O-O {[%clk 0:02:51.8]} 9... O-O {[%clk 0:02:46.9]} 10. a3 {[%clk 0:02:49.6]} 10... Ne7 {[%clk 0:02:45.5]} 11. d5 {[%clk 0:02:48.7]} 11... g5 {[%clk 0:02:43.4]} 12. Nbc3 {[%clk 0:02:36]} 12... Ng6 {[%clk 0:02:40.2]} 13. Qc2 {[%clk 0:02:34.2]} 13... Ne5 {[%clk 0:02:33]} 14. Rad1 {[%clk 0:02:33.2]} 14... Qe8 {[%clk 0:02:28.6]} 15. Nd4 {[%clk 0:02:30.2]} 15... g4 {[%clk 0:02:23.4]} 16. Nce2 {[%clk 0:02:25.8]} 16... Nf3+ {[%clk 0:02:21.2]} 17. Bxf3 {[%clk 0:02:23.6]} 17... gxf3 {[%clk 0:02:09]} 18. Nf4 {[%clk 0:02:23]} 18... Bh6 {[%clk 0:01:57.6]} 19. Kh1 {[%clk 0:01:46.6]} 19... Ng4 {[%clk 0:01:47.2]} 20. Qc3 {[%clk 0:01:43.9]} 20... Bg7 {[%clk 0:01:38.6]} 21. h3 {[%clk 0:01:40.8]} 21... Ne5 {[%clk 0:01:37.4]} 22. c5 {[%clk 0:01:19.4]} 22... Bd7 {[%clk 0:01:24.1]} 23. cxd6 {[%clk 0:01:14.2]} 23... cxd6 {[%clk 0:01:23]} 24. Qc7 {[%clk 0:01:13.9]} 24... Rc8 {[%clk 0:01:08.8]} 25. Qxb7 {[%clk 0:01:12.9]} 25... Rf6 {[%clk 0:00:55.6]} 26. Nde6 {[%clk 0:01:09.7]} 26... Rh6 {[%clk 0:00:38]} 27. Nxg7 {[%clk 0:01:07.6]} 27... Kxg7 {[%clk 0:00:37.9]} 28. Rc1 {[%clk 0:00:59.2]} 28... Kf8 {[%clk 0:00:31.6]} 29. Rxc8 {[%clk 0:00:57.1]} 29... Bxc8 {[%clk 0:00:31.5]} 30. Qc7 {[%clk 0:00:56.1]} 30... Bd7 {[%clk 0:00:29]} 31. Kg1 {[%clk 0:00:46.8]} 31... Qe7 {[%clk 0:00:22.5]} 32. Rc1 {[%clk 0:00:42]} 32... Ng6 {[%clk 0:00:21.4]} 33. Nxg6+ {[%clk 0:00:25.8]} 33... hxg6 {[%clk 0:00:20.5]} 34. h4 {[%clk 0:00:25.5]} 34... g5 {[%clk 0:00:19.9]} 35. Qb8+ {[%clk 0:00:23.6]} 35... Kf7 {[%clk 0:00:18.8]} 36. Rc7 {[%clk 0:00:23.3]} 36... gxh4 {[%clk 0:00:17.8]} 37. Qxa7 {[%clk 0:00:23.1]} 37... Ke8 {[%clk 0:00:09.2]} 38. Bg7 {[%clk 0:00:21.1]} 38... Qxg7 {[%clk 0:00:07.7]} 39. Qb8+ {[%clk 0:00:20.3]} 1-0\n",
          "rated": true,
          "result": "1-0",
          "rules": "chess",
          "start_time": "2026-11-19T01:29:08Z",
          "termination": "Hikaru won by resignation",
          "time_class": "blitz",
          "time_control": "180",
          "url": "https://www.chess.com/game/live/187517802954",
          "white": {
            "rating": 3465,
            "result": "win",
            "username": "Hikaru"
          }
        }
      ],
      "month": "2026-11",
      "months": [
        "2026-11",
        "2026-10",
        "2026-09",
        "2026-08",
        "2026-07",
        "2026-06",
        "2026-05",
        "2026-04",
        "2026-03",
        "2026-02",
        "2026-01",
        "2025-12",
        "2025-11",
        "2025-10",
        "2025-09",
        "2025-08",
        "2025-07",
        "2025-06",
        "2025-05",
        "2025-04",
        "2025-03",
        "2025-02",
        "2025-01",
        "2024-12",
        "2024-11",
        "2024-10",
        "2024-09",
        "2024-08",
        "2024-07",
        "2024-06",
        "2024-05",
        "2024-04",
        "2024-03",
        "2024-02",
        "2024-01",
        "2023-12",
        "2023-11",
        "2023-10",
        "2023-09",
        "2023-08",
        "2023-07",
        "2023-06",
        "2023-05",
        "2023-04",
        "2023-03",
        "2023-02",
        "2023-01",
        "2022-12",
        "2022-11",
        "2022-10",
        "2022-09",
        "2022-08",
        "2022-07",
        "2022-06",
        "2022-05",
        "2022-04",
        "2022-03",
        "2022-02",
        "2022-01",
        "2021-12",
        "2021-11",
        "2021-10",
        "2021-09",
        "2021-08",
        "2021-07",
        "2021-06",
        "2021-05",
        "2021-04",
        "2021-03",
        "2021-02",
        "2021-01",
        "2020-12",
        "2020-11",
        "2020-10",
        "2020-09",
        "2020-08",
        "2020-07",
        "2020-06",
        "2020-05",
        "2020-04",
        "2020-03",
        "2020-02",
        "2020-01",
        "2019-12",
        "2019-11",
        "2019-10",
        "2019-09",
        "2019-08",
        "2019-07",
        "2019-06",
        "2019-05",
        "2019-04",
        "2019-03",
        "2019-02",
        "2019-01",
        "2018-12",
        "2018-11",
        "2018-10",
        "2018-09",
        "2018-08",
        "2018-07",
        "2018-06",
        "2018-05",
        "2018-04",
        "2018-03",
        "2018-02",
        "2018-01",
        "2017-12",
        "2017-11",
        "2017-10",
        "2017-09",
        "2017-08",
        "2017-07",
        "2017-06",
        "2017-05",
        "2017-04",
        "2017-03",
        "2017-02",
        "2017-01",
        "2016-12",
        "2016-11",
        "2016-10",
        "2016-09",
        "2016-08",
        "2016-07",
        "2016-06",
        "2016-05",
        "2016-04",
        "2016-03",
        "2016-02",
        "2016-01",
        "2015-12",
        "2015-11",
        "2015-10",
        "2015-09",
        "2015-08",
        "2015-07",
        "2015-06",
        "2015-05",
        "2015-04",
        "2015-03",
        "2015-02",
        "2015-01",
        "2014-12",
        "2014-11",
        "2014-10",
        "2014-09",
        "2014-08",
        "2014-07",
        "2014-06",
        "2014-05",
        "2014-04",
        "2014-03",
        "2014-02",
        "2014-01"
      ],
      "previous_month": "2026-10",
      "site": "chesscom",
      "username": "hikaru"
    }

Common questions

Is the response a raw PGN file?

This implementation returns JSON containing game PGN text. The source sites’ direct export formats do not change this output contract.

How do I continue games?

Chess.com uses next_to as to. Lichess newest-first uses next_until as until; oldest-first uses next_after as after. A filtered Lichess page can be shorter than limit and still have another cursor.

Which limits and site-specific filters apply?

limit is 1–500 for Chess.com or 1–100 for Lichess, default 50. perf, rated, analysed and ongoing are documented Lichess options.

How do I interpret Lichess clocks?

clocks=true adds clocks_centiseconds. Preserve hundredths-of-a-second clock values separately from date-filter epoch milliseconds.

How do I bypass cached results?

Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

Can I request CSV or NDJSON?

This OpenAny implementation serves JSON only. Omit output or set output=json.

Use Chess.com & Lichess Player Games API with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.