Skip to main content

Game stat API

With Talo, you can track game stats on a per-player basis. For example, you could track the number of secrets discovered by a player or the amount of puzzles they've solved. Talo allows you to easily create and increment these kind of stats.

Learn more about game stats here.

Endpoints


Get all game stats

GET https://api.trytalo.com/v1/game-stats

Sample response

{ ... }

Get an individual game stat

GET https://api.trytalo.com/v1/game-stats/:internalName

Route params

KeyRequiredDescription
internalName YesThe internal name of the stat

Sample response

{ ... }

Get a history of changes to a player stat

GET https://api.trytalo.com/v1/game-stats/:internalName/history

Headers

KeyRequiredDescription
x-talo-player YesThe ID of the player

Route params

KeyRequiredDescription
internalName YesThe internal name of the stat

Query keys

KeyRequiredDescription
endDate NoA UTC Date (YYYY-MM-DD), DateTime (ISO 8601) or millisecond timestamp
page YesThe current pagination index (starting at 0)
startDate NoA UTC Date (YYYY-MM-DD), DateTime (ISO 8601) or millisecond timestamp

Sample response

{ ... }

Sample request with filtering

{ ... }

Get a history of changes to a global stat

GET https://api.trytalo.com/v1/game-stats/:internalName/global-history

Route params

KeyRequiredDescription
internalName YesThe internal name of the stat

Query keys

KeyRequiredDescription
endDate NoA UTC Date (YYYY-MM-DD), DateTime (ISO 8601) or millisecond timestamp
page YesThe current pagination index (starting at 0)
playerId NoA player ID to use when filtering snapshots
startDate NoA UTC Date (YYYY-MM-DD), DateTime (ISO 8601) or millisecond timestamp

Sample response

{ ... }

Sample request with filtering

{ ... }

Update a stat value

PUT https://api.trytalo.com/v1/game-stats/:internalName

Headers

KeyRequiredDescription
x-talo-alias YesThe ID of the player's alias

Route params

KeyRequiredDescription
internalName YesThe internal name of the stat

Body keys

KeyRequiredDescription
change YesThe amount to add to the current value of the stat (can be negative)

Sample request

{ ... }

Sample response

{ ... }