Skip to content

AlbumStructure

Defined in: src/structures/album.ts:8

new AlbumStructure(client: FMClient): AlbumStructure;

Defined in: src/structures/album.ts:11

FMClient

AlbumStructure

search(options: AlbumSearchOptions): Promise<AlbumSearchResponse>;

Defined in: src/structures/album.ts:34

Search for an album by name. Returns album matches sorted by relevance.

AlbumSearchOptions

The search options. See AlbumSearchOptions.

Promise<AlbumSearchResponse>

A promise that resolves to the API response object.

  • Success: { success: true, albums: Array, totalResultsOnLastFm: number | null }
  • Failure: { success: false, errorCode: ErrorCodes.MISSING_REQUIREMENTS | ErrorCodes.NO_ALBUM_MATCHES | number | string, errorMsg: string }
const res = await fm.album.search({
album: "Hurry Up Tomorrow",
limit: 5,
});
if (res.success) {
console.log(`Found ${res.albums.length} matching albums`);
}