PubgApi

class PubgApi @JvmOverloads constructor(apiKey: String, rateLimiter: RateLimiter = DelayRateLimiter(), retry: RetryPolicy = NoRetry)

Entry point for all PUBG API interactions.

Create a single instance per API key and reuse it across requests. The underlying HTTP client is initialised lazily on first use.

val api = PubgApi(apiKey = "your-api-key")
val player = api.getPlayerByAccountId("account.abc123", Platform.STEAM)

Parameters

apiKey

Your PUBG API key, obtained from the PUBG Developer Portal.

rateLimiter

Controls request throughput. Defaults to DelayRateLimiter, which proactively delays requests when the rate limit is exhausted. Pass RateLimiter.None to disable rate limiting entirely.

retry

Controls automatic retry behavior. Defaults to NoRetry. Pass a Retry instance to enable retries with configurable backoff.

See also

Constructors

Link copied to clipboard
constructor(apiKey: String, rateLimiter: RateLimiter = DelayRateLimiter(), retry: RetryPolicy = NoRetry)
constructor(engine: HttpClientEngine, apiKey: String = "", rateLimiter: RateLimiter = RateLimiter.None, retry: RetryPolicy = NoRetry)

Constructs a PubgApi backed by a custom HttpClientEngine.

Properties

Link copied to clipboard
val client: HttpClient

The underlying Ktor HttpClient used for all API requests.

Functions

Link copied to clipboard
suspend fun PubgApi.isUp(): Boolean

Returns the status of the PUBG API.

Link copied to clipboard
suspend fun PubgApi.seasons(platform: Platform = Platform.STEAM): List<Season>

Returns the list of available Season by platform.

suspend fun PubgApi.seasons(platformRegion: PlatformRegion = PlatformRegion.PC_SA): List<Season>

Returns the list of available Season by platform-region.