Skip to content
← Public packages

@kody/spotify

Read a Spotify profile, search the catalog, and manage library, playlists, devices, and playback.

FollowFork

Files

get-top-items.ts

12 lines · 471 B · TypeScript
import { getTopItems } from '../lib/spotify-api.ts'
import type { GetTopItemsParams } from '../lib/export-types.ts'

/**
 * Read the user's top Spotify tracks or artists for a time range.
 * @example
 * import getTopItems from 'kody:@kody/spotify/get-top-items'
 * const tracks = await getTopItems({ type: 'tracks', timeRange: 'short_term', limit: 5 })
 */
export default async function spotifyGetTopItems(params: GetTopItemsParams) {
	return await getTopItems(params)
}