GeoStructure
Defined in: src/structures/geo.ts:15
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GeoStructure(client: FMClient): GeoStructure;Defined in: src/structures/geo.ts:18
Parameters
Section titled “Parameters”client
Section titled “client”Returns
Section titled “Returns”GeoStructure
Methods
Section titled “Methods”getTopArtists()
Section titled “getTopArtists()”getTopArtists(options: GeoGetTopArtistsOptions): Promise<GeoTopArtistsResponse>;Defined in: src/structures/geo.ts:128
Get the most popular artists on Last.fm by country.
Parameters
Section titled “Parameters”options
Section titled “options”The options. See GeoGetTopArtistsOptions.
Returns
Section titled “Returns”Promise<GeoTopArtistsResponse>
A promise that resolves to the API response object.
- Success:
{ success: true, topArtists: Array } - Failure:
{ success: false, errorCode: ErrorCodes.MISSING_REQUIREMENTS | ErrorCodes.GEO_NO_TOP_ARTISTS | number | string, errorMsg: string }
Example
Section titled “Example”const res = await fm.geo.getTopArtists({ country: "Japan", limit: 5,});
if (res.success) { console.log(`Top artist in Japan: ${res.topArtists[0].name}`);}getTopTracks()
Section titled “getTopTracks()”getTopTracks(options: GeoGetTopTracksOptions): Promise<GeoTopTracksResponse>;Defined in: src/structures/geo.ts:41
Get the most popular tracks on Last.fm last week by country.
Parameters
Section titled “Parameters”options
Section titled “options”The options. See GeoGetTopTracksOptions.
Returns
Section titled “Returns”Promise<GeoTopTracksResponse>
A promise that resolves to the API response object.
- Success:
{ success: true, topTracks: Array } - Failure:
{ success: false, errorCode: ErrorCodes.MISSING_REQUIREMENTS | ErrorCodes.GEO_NO_TOP_TRACKS | number | string, errorMsg: string }
Example
Section titled “Example”const res = await fm.geo.getTopTracks({ country: "Spain", limit: 5,});
if (res.success) { console.log(`Top track in Spain: ${res.topTracks[0].name}`);}