@pubgkt/players
v1.0.1
Published
Kotlin Multiplatform PUBG API client
Maintainers
Readme
pubgkt – players
Retrieve player information by account ID or display name.
API Reference | PUBG Official Docs
Installation
Gradle Kotlin DSL
dependencies {
implementation("dev.pubgkt:players:1.0.1")
}Gradle Groovy
dependencies {
implementation 'dev.pubgkt:players:1.0.1'
}Maven
<dependency>
<groupId>dev.pubgkt</groupId>
<artifactId>players-jvm</artifactId>
<version>1.0.1</version>
</dependency>API Reference
| Function | Description |
|----------|-------------|
| PubgApi.getPlayerByAccountId(accountId, platform) | Get a single player by account ID |
| PubgApi.getPlayersById(accountIds, platform) | Get up to 10 players by account IDs |
| PubgApi.getPlayersById(vararg accountIds, platform) | Get up to 10 players by account IDs (vararg) |
| PubgApi.getPlayersByNames(playerNames, platform) | Get up to 10 players by display names |
| PubgApi.getPlayersByNames(vararg playerNames, platform) | Get up to 10 players by display names (vararg) |
Usage
Kotlin
val api = PubgApi("your-api-key")
// Single player by account ID
val player = api.getPlayerByAccountId("account.abc123")
// Multiple players by IDs
val players = api.getPlayersById("account.abc123", "account.def456")
// Multiple players by display names
val byNames = api.getPlayersByNames("sparkingg", "TGLTN")
byNames.forEach { println("${it.name} — clan: ${it.clanId}") }Java
PubgApi api = new PubgApi("your-api-key");
// Single player by account ID
Player player = BuildersKt.runBlocking(
EmptyCoroutineContext.INSTANCE,
(_, cont) -> GetPlayerByAccountIdKt.getPlayerByAccountId(api, "account.abc123", Platform.STEAM, cont)
);
// Multiple players by names
List<Player> players = BuildersKt.runBlocking(
EmptyCoroutineContext.INSTANCE,
(_, cont) -> GetPlayersByNameKt.getPlayersByNames(api, List.of("sparkingg", "TGLTN"), Platform.STEAM, cont)
);