Skip to content

Conversation

@tors42
Copy link
Contributor

@tors42 tors42 commented Jan 4, 2025

If the game to be JSON:ified has a winner,
a new field "winner" is now added with the color of the winner.

{
    ...
    "winner":"white",
    ...
}

/api/stream/games-by-users - https://lichess.org/api#tag/Games/operation/gamesByUsers
/api/stream/games/<streamId> - https://lichess.org/api#tag/Games/operation/gamesByIds

Without this information, one would need to make an additional API lookup by game id to see who won.

If the game to be JSON:ified has a winner,
a new field "winner" is now added with the color of the winner.

{
    ...
    "winner":"white"
    ...
}

/api/stream/games-by-users
/api/stream/games/<streamId>
Copy link
Member

@fitztrev fitztrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with both checkmate and draw games. Only present on games with a winner. Works great!

@schlawg schlawg merged commit ad9f4ec into lichess-org:master Jan 10, 2025
4 checks passed
@tors42 tors42 deleted the add-winner-to-game-streams branch January 11, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants