Developers
Player API
Learn how to utilise our player API with Analyse.
The Player API allows you to access player information, such as total playtime, last join date, and custom statistics. This data can be useful for player analytics, rankings, and searches.
The Player API requires an API Token found in your server settings. When generating a token, remember to save it, as it will only be displayed once for security reasons. You can always regenerate the token if needed.
All player requests to Analyse must include the Authorization header with the value Bearer <token>
. The current base URL for all endpoints is https://app.analyse.net/api/v1/server/
.
If you wish to access the API within your plugin, you should use our Platform SDK wrapper instead.
Get Player
Get basic information about a player from their username or uuid.
- URL:
player/<username|uuid>
- Method:
GET
Example Response (player/Siri
)
{
"player": {
"name": "Siri",
"uuid": "ed6daf33575b460ba2f3e208a1004c10",
"created_at": "2022-07-07T11:52:03.000000Z",
"updated_at": "2022-07-07T11:52:03.000000Z",
"first_joined_at": "2022-06-26T10:26:03.000000Z",
"last_logged_in_at": "2022-07-04T05:25:03.000000Z",
"total_session_time": 11940,
"statistics": [
{
"nickname": "Player Kills",
"placeholder": "player_kills",
"value": 182
},
{
"nickname": "Gems",
"placeholder": "gems_balance",
"value": 63
},
{
"nickname": "Island Level",
"placeholder": "is_level",
"value": 289
}
]
},
"cached": true
}
The cached
field will only exist if the response was cached. This means that the player data was recently requested and is still in the cache. If the cached
field is not present, the player data was not cached and was requested from the database.
Statistic Leaderboard
View the top 10 players by a specific statistic.
- URL:
leaderboard/<placeholder>
- Method:
GET
Example Response (leaderboard/player_kills
)
{
"leaderboard": {
"current_page": 1,
"data": [
{
"name": "oAng3L",
"uuid": "3e4f490dbe7a41758fb0b36efcf09c80",
"value": 499
},
{
"name": "Spirum",
"uuid": "0a566c95361642d6bf09b0c211b0aed2",
"value": 498
},
{
"name": "Prvxce",
"uuid": "a8c23d839f3f4bbda6142ce79d823675",
"value": 497
},
{
"name": "Poglike",
"uuid": "064ae34830e94e39a45daf020504c7bf",
"value": 496
},
{
"name": "MikiaSan",
"uuid": "5efd2548be0f47799636475a176c6a42",
"value": 495
},
{
"name": "Skufflo",
"uuid": "a2c8c5b7480c469eb00c70191405c56f",
"value": 494
},
{
"name": "Axeluri",
"uuid": "31fbf45108934270ac56795a2e609fb7",
"value": 493
},
{
"name": "Ashtdns",
"uuid": "d8bcb14ca7564f46b9cd9f0cc40cbd80",
"value": 491
},
{
"name": "Frogaroos",
"uuid": "2b69da83fba94aea83b259d0081b6537",
"value": 487
},
{
"name": "Toxtricity",
"uuid": "1ccc773a1e38467998ab1bfb2ab778bc",
"value": 487
}
],
"first_page_url": "https:\/\/app.analyse.net\/api\/v1\/server\/leaderboard\/player_kills?page=1",
"from": 1,
"last_page": 43,
"last_page_url": "https:\/\/app.analyse.net\/api\/v1\/server\/leaderboard\/player_kills?page=43",
"next_page_url": "https:\/\/app.analyse.net\/api\/v1\/server\/leaderboard\/player_kills?page=2",
"path": "https:\/\/app.analyse.net\/api\/v1\/server\/leaderboard\/player_kills",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 423
}
}