Skip to content

LPDBClient

The main client class for interacting with the Liquipedia API.

Constructor

typescript
new LPDBClient(options: LPDBClientOptions)

Parameters

typescript
interface LPDBClientOptions {
  apiKey: string
  baseUrl?: string
}
OptionTypeRequiredDefaultDescription
apiKeystringYes-Your Liquipedia API key
baseUrlstringNohttps://api.liquipedia.net/api/v3API base URL

Example

typescript
import { LPDBClient } from '@npldev/lpdb-ts-client'

const client = new LPDBClient({
  apiKey: 'your-api-key',
})

Methods

endpoint

Creates a new query builder for the specified endpoint.

typescript
endpoint<T extends EndpointPath>(path: T): QueryBuilder<T>

Parameters

ParameterTypeDescription
pathEndpointPathThe API endpoint path

Returns

A QueryBuilder instance typed for the specific endpoint.

Example

typescript
const builder = client.endpoint('/player')

executeQuery

Internal method to execute a query. Usually you should use QueryBuilder.execute() instead.

typescript
executeQuery(
  path: EndpointPath,
  params: Record<string, string | number | undefined>
): Promise<ApiResponse>

Type Exports

typescript
import type { LPDBClientOptions } from '@npldev/lpdb-ts-client'

Released under the MIT License.