Skip to content
Client
Server

Reference / @open-music-sdk/client-catalog / tChartsOptions

Interface: tChartsOptions ​

Defined in: clients/client-catalog/src/discover.ts:111

The options of getCharts.

Extends ​

Properties ​

chart? ​

ts
readonly optional chart?: string;

Defined in: clients/client-catalog/src/discover.ts:115

The one chart to get, by the name it has in an answer, such as "most-played". Default: every chart of each type.


extend? ​

ts
readonly optional extend?: readonly string[];

Defined in: packages/core/src/options.ts:26

The attributes to add to those sent by default, such as ["artistUrl"]: at most 300 names, each of 1 to 64 characters with no comma in it. An empty list is none, and is not sent.

Inherited from ​

tReadOptions.extend


genre? ​

ts
readonly optional genre?: string;

Defined in: clients/client-catalog/src/discover.ts:117

The genre to keep the charts to, by its id. Default: every genre.


include? ​

ts
readonly optional include?: readonly string[];

Defined in: packages/core/src/options.ts:21

The relationships to send in full with each resource, such as ["albums", "artists"]: at most 300 names, each of 1 to 64 characters with no comma in it. An empty list is none, and is not sent.

Inherited from ​

tReadOptions.include


language? ​

ts
readonly optional language?: string;

Defined in: packages/core/src/options.ts:16

The language to answer in, as a tag the storefront supports, such as "en-GB": a string of 1 to 64 characters, sent as l. Default: the storefront's own.

Inherited from ​

tReadOptions.language


limit? ​

ts
readonly optional limit?: number;

Defined in: packages/core/src/options.ts:28

How many to send in one answer: a whole number above zero. Apple sets the default and the most.

Inherited from ​

tReadOptions.limit


offset? ​

ts
readonly optional offset?: string | number;

Defined in: packages/core/src/options.ts:30

Where in the collection to start: a whole number from zero, or a cursor as Apple gave it, of 1 to 256 characters.

Inherited from ​

tReadOptions.offset


params? ​

ts
readonly optional params?: Readonly<Record<string, 
  | string
  | number
  | boolean
  | readonly (string | number)[]
  | null
| undefined>>;

Defined in: packages/core/src/options.ts:42

Any other query parameter, sent as given: what Apple takes and no option here names. An option that is given, or an argument of the function, wins over the same key here.

It is a plain object of at most 100 parameters; a Map or a URLSearchParams is a TypeError, where it would otherwise be read as no parameters at all. A name is one as Apple writes them, such as ids[albums] or limit[songs:tracks]: a letter, then letters, digits, -, _, . and :, with any part in brackets after, in at most 64 characters. A name that does not fit is described in the error, not repeated. A value is a string of at most 256 characters, a number, true or false, or a list of at most 300 numbers and strings, each string of 1 to 64 characters with no comma in it. null, undefined and an empty list are not sent.

Inherited from ​

tReadOptions.params


schema? ​

ts
readonly optional schema?: tSchemaLike<tChartResponse>;

Defined in: packages/core/src/options.ts:47

Validates the answer; a failure throws ValidationError. Any Standard Schema, such as a validator from @open-music-sdk/validate: an object or a function with a validate function under ~standard.

Inherited from ​

tReadOptions.schema


signal? ​

ts
readonly optional signal?: AbortSignal;

Defined in: packages/core/src/options.ts:49

Aborts the request. An abort is rethrown as it is.

Inherited from ​

tReadOptions.signal


storefront? ​

ts
readonly optional storefront?: string;

Defined in: packages/core/src/endpoint.ts:367

The storefront whose catalog is asked, by its id, such as "gb". Default: the client's, which is the one it was created with, or else the listener's, which the client looks up once.

Inherited from ​

tStorefrontOption.storefront


types ​

ts
readonly types: readonly (keyof tChartResponseResults)[];

Defined in: clients/client-catalog/src/discover.ts:113

The types of resource to get the charts of, such as ["songs", "albums"]. There is no default: Apple wants one at least.


with? ​

ts
readonly optional with?: readonly ("cityCharts" | "dailyGlobalTopCharts")[];

Defined in: clients/client-catalog/src/discover.ts:119

Charts that are not sent by default: "cityCharts" for each city's, "dailyGlobalTopCharts" for the world's.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.