Forums

Insight data in public APIs

Sort:
KevinTheSnipe

Is some of the analysis data and insight data available to be put into the public apis? Some things that would be nice:

1. The game shape for any individual game (e.g. "balanced", "sharp", "giveaway", etc.

2. The evaluation by game phase, e.g. opening, middlegame, and endgame accuracy. 

Right now the only thing available is the overall accuracy, which is nice, but it'd be great to have a little bit more to work with!

As another note, I'd like to be able to classify openings myself as they appear on insights. E.g. instead of telling me I play a lot of games in 1. d4 d5 2. c4 "Queen's Gambit", it sure would be nice to be able to select actual meaningful positions and categorizations. Another example, the insights tell me that I also play the King's Indian, which it identifies as: 1. d4 Nf6 2. c4 g6. I guess I don't need to point out that that can be either a KID, a Grunfeld, or a Modern Benoni, or even a Benko. Maybe Im even missing some things. It's just not a useful categorization. So, I'm trying to build my own tool that does this, but I need more info from the public APIs to be able to derive meaningful insights.

Martin_Stahl
KevinTheSnipe wrote:

Is some of the analysis data and insight data available to be put into the public apis? Some things that would be nice:

1. The game shape for any individual game (e.g. "balanced", "sharp", "giveaway", etc.

2. The evaluation by game phase, e.g. opening, middlegame, and endgame accuracy.

Right now the only thing available is the overall accuracy, which is nice, but it'd be great to have a little bit more to work with!

As another note, I'd like to be able to classify openings myself as they appear on insights. E.g. instead of telling me I play a lot of games in 1. d4 d5 2. c4 "Queen's Gambit", it sure would be nice to be able to select actual meaningful positions and categorizations. Another example, the insights tell me that I also play the King's Indian, which it identifies as: 1. d4 Nf6 2. c4 g6. I guess I don't need to point out that that can be either a KID, a Grunfeld, or a Modern Benoni, or even a Benko. Maybe Im even missing some things. It's just not a useful categorization. So, I'm trying to build my own tool that does this, but I need more info from the public APIs to be able to derive meaningful insights.

The Public API is not receiving new features and is in a maintenance phase (bug fixes only for the most part). My guess is Insights data, which can be locked behind privacy settings, and only exists for diamond members isn't something that would likely be added if/when the system decides to update the APIs.

You could use the game endpoints to generate your own opening line categorization.

KevinTheSnipe

Hi, What "Game endpoints" do you mean? Do you mean calling the site URLs in a logged in state and trying to scrape the page looking for the data I need? Or is there some other REST API that returns this information that I don't know about. The only non-public api Im aware of is chess.com/callback/live/game/{game_id} but that does not have the insight or even the opening/middlegame/endgame evaluations. The opening/middlegame/endgame evals are displayed on the "Game Review" tab, but I have not yet determined which REST API provides the data for that page.

It seems to me that if the public apis supported login it should be possible to receive insight data if you're a diamond member.

Of course I wouldn't complain if chess.com just went ahead and made the insights more useful to begin with so that I can skip this whole exercise.

KevinTheSnipe

This is, after all, a site feedback thread, and I'll just end by saying that even Lichess does a very poor job of providing insights, and if chess.com is able to turn a corner on this feature and provide meaningful, valuable insight, suddenly there's a real reason buy Diamond and pay for the insights. As of now the chess.com insights are much like the lichess "insights"--mildly fascinating for 5 minutes and then you walk away and never look at them again.

Martin_Stahl
KevinTheSnipe wrote:

Hi, What "Game endpoints" do you mean? Do you mean calling the site URLs in a logged in state and trying to scrape the page looking for the data I need? Or is there some other REST API that returns this information that I don't know about. The only non-public api Im aware of is chess.com/callback/live/game/{game_id} but that does not have the insight or even the opening/middlegame/endgame evaluations. The opening/middlegame/endgame evals are displayed on the "Game Review" tab, but I have not yet determined which REST API provides the data for that page.

It seems to me that if the public apis supported login it should be possible to receive insight data if you're a diamond member.

Of course I wouldn't complain if chess.com just went ahead and made the insights more useful to begin with so that I can skip this whole exercise.

No, the Public API and the game endpoint there,, in particular the archives.

https://www.chess.com/announcements/view/published-data-api

The game phase evaluations are unlikely to be added as a public API

KevinTheSnipe

The two public apis Im aware of are the archives endpoint, api.chess.com/pub/player/kevinthesnipe/games/2025/01, and the games urls returned in the archives endpoint, e.g. something like this api.chess.com/pub/player/kevinthesnipe/games/2025/01.

What I'm expressing is that it would be nice to get a few additional data points--the game phase evals, and the game type classification (sharp/balanced/wild/giveaway/etc).

As a side-side note, "giveaway" is a particularly useless insight, because it doesn't tell me who is blunder prone and who is opportunistic/capitalizing. If 30% of my games are "giveaway" that either means I'm making catastrophic blunders 30% of the time, or I'm capitalizing on my opponent's catastrophic blunders...and I don't know which one it is. Even worse, one is desirable (capitalizing on opponent mistakes) and the other is very undesirable (catastrophic blunder). So all the insight tells me is that a thing happens in my game--which is either good or terrible, but we can't really tell you which!

KevinTheSnipe

The problem with "giveaway" in the insights is I think emblematic of the wider problem with insights--that they look cool as a feature but they don't really provide what is needed to identify weaknesses and areas of improvement. It's just data for data's sake. And, the sad part is, I think it's possible to make an insight feature that gives real insight into how to improve.

Martin_Stahl
KevinTheSnipe wrote:

...

What I'm expressing is that it would be nice to get a few additional data points--the game phase evals, and the game type classification (sharp/balanced/wild/giveaway/etc).

As a side-side note, "giveaway" is a particularly useless insight, because it doesn't tell me who is blunder prone and who is opportunistic/capitalizing. If 30% of my games are "giveaway" that either means I'm making catastrophic blunders 30% of the time, or I'm capitalizing on my opponent's catastrophic blunders...and I don't know which one it is. Even worse, one is desirable (capitalizing on opponent mistakes) and the other is very undesirable (catastrophic blunder). So all the insight tells me is that a thing happens in my game--which is either good or terrible, but we can't really tell you which!

The game phase accuracy values only show for game with reviews and are not stored in the DB as I understand it, so aren't something that would be available. The game shapes are only in Insights, which also aren't available via API, and as likely will go away in a future version of the feature.

The Public API is also not getting any new features and is in bug fix mode only, at least for the foreseeable future.