Skip to content

GeoStructure

Defined in: src/structures/geo.ts:15

new GeoStructure(client: FMClient): GeoStructure;

Defined in: src/structures/geo.ts:18

FMClient

GeoStructure

getTopArtists(options: GeoGetTopArtistsOptions): Promise<GeoTopArtistsResponse>;

Defined in: src/structures/geo.ts:128

Get the most popular artists on Last.fm by country.

GeoGetTopArtistsOptions

The options. See GeoGetTopArtistsOptions.

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 }
const res = await fm.geo.getTopArtists({
country: "Japan",
limit: 5,
});
if (res.success) {
console.log(`Top artist in Japan: ${res.topArtists[0].name}`);
}

getTopTracks(options: GeoGetTopTracksOptions): Promise<GeoTopTracksResponse>;

Defined in: src/structures/geo.ts:41

Get the most popular tracks on Last.fm last week by country.

GeoGetTopTracksOptions

The options. See GeoGetTopTracksOptions.

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 }
const res = await fm.geo.getTopTracks({
country: "Spain",
limit: 5,
});
if (res.success) {
console.log(`Top track in Spain: ${res.topTracks[0].name}`);
}