QueryBuilder
A fluent builder for constructing API queries. The available methods depend on the endpoint type.
Creating a QueryBuilder
Query builders are created via LPDBClient.endpoint():
const builder = client.endpoint('/player')Common Methods
These methods are available on all endpoints:
wiki
Set a single wiki to query.
wiki(value: Wiki): thisclient.endpoint('/player').wiki('dota2')wikis
Set multiple wikis to query (pipe-separated).
wikis(value: Wiki[]): thisclient.endpoint('/player').wikis(['dota2', 'counterstrike'])execute
Execute the query and return results.
execute(): Promise<ApiResponse>const response = await client.endpoint('/player').wiki('dota2').execute()build
Return the query parameters without executing.
build(): { path: T; params: Record<string, string | number | undefined> }const query = client.endpoint('/player').wiki('dota2').limit(10).build()
// { path: '/player', params: { wiki: 'dota2', limit: 10 } }Standard Query Methods
Available on most endpoints (not /teamtemplate or /teamtemplatelist):
conditions
conditions(value: string): thisFilter results using Liquipedia's condition syntax.
.conditions('[[nationality::France]] AND [[team::!]]')query
query(value: string): thisSelect specific fields to return.
.query('id, name, nationality')limit
limit(value: number): thisMaximum number of results.
.limit(50)offset
offset(value: number): thisNumber of results to skip (for pagination).
.offset(100)order
order(value: string): thisSort order for results.
.order('name ASC')groupby
groupby(value: string): thisGroup results by field.
.groupby('nationality')Match-Specific Methods
Only available on /match endpoint:
rawstreams
rawstreams(value: 'true' | 'false'): thisInclude raw stream data.
streamurls
streamurls(value: 'true' | 'false'): thisInclude stream URLs.
TeamTemplate-Specific Methods
Only available on /teamtemplate endpoint:
template
template(value: string): thisThe team template name (required).
date
date(value: string): thisDate for historical logos (YYYY-MM-DD format).
TeamTemplateList-Specific Methods
Only available on /teamtemplatelist endpoint:
pagination
pagination(value: number): thisPage number (200 results per page).