Reference / @open-music-sdk/client-catalog / getCharts
Function: getCharts()
function getCharts(client, options): Promise<tChartResponse>;Defined in: clients/client-catalog/src/discover.ts:139
The charts of a storefront, by type of resource, each one a first page. Each type is a list of charts, since one type can have several. limit and offset apply to every chart. A next link of a chart answers with charts by type again, not with a page, as it did against the live API on 18 October 2026, so paginate stops after the first page: to get more of a chart, ask again with a larger offset.
Parameters
client
The client to ask with.
options
The types to chart, which have to be given; one chart by name; one genre by id; the city or global charts; the storefront to ask in; and what to send beside the charts.
Returns
Promise<tChartResponse>
What Apple answered: the charts by type under results, each a first page with a next of its own.
Throws
TypeError if client is no client or an argument is not what it should be, before Apple is asked.
Throws
AppleMusicError if Apple, the network, or a token provider fails, if the client has no storefront to ask in, or a schema finds issues; _tag says which.
Throws
The reason options.signal aborted with, when it does.
Throws
Whatever a token provider, store, schema, hook or rate limiter throws, as client.request passes it on.