Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/spotify

src/exports/search.ts

14 lines · 579 B · TypeScript
import { searchCatalog } from '../lib/spotify-api.ts'
import type { SearchParams } from '../lib/export-types.ts'

/**
 * Search the Spotify catalog for tracks, albums, artists, or playlists.
 * Pass `types` (preferred) or `type` as an alias.
 * Optional `integration` selects `spotify` (default) or a `spotify-*` connection.
 * @example
 * import search from 'kody:@kody/spotify/search'
 * const results = await search({ query: 'radiohead', types: ['track'], limit: 5 })
 */
export default async function search(params: SearchParams = {}) {
	return await searchCatalog(params)
}