One Logo Pool Ball
MusicKit · IOS API REFERENCE

MusicLibrarySearchRequest

struct · iOS 16.0+ · SDK 27.1

struct MusicLibrarySearchRequest

A request that your app uses to fetch items from user’s library using a search term.

Members (6)

get · iOS 16.0+

includeTopResults

TypeScript
get includeTopResults(): boolean
Swift declaration
var includeTopResults: Bool

A Boolean value that indicates whether to request top search results.

set · iOS 16.0+

includeTopResults

TypeScript
set includeTopResults(value: boolean)
Swift declaration
var includeTopResults: Bool

A Boolean value that indicates whether to request top search results.

get · iOS 16.0+

term

TypeScript
get term(): string
Swift declaration
let term: String

The search term for the request.

get · iOS 16.0+

limit

TypeScript
get limit(): number
Swift declaration
var limit: Int

A limit for the number of items to return in the library search response. The default value for this limit is 50. If the application sets the limit to 0, the framework returns all matching items in the user’s music library.

set · iOS 16.0+

limit

TypeScript
set limit(value: number)
Swift declaration
var limit: Int

A limit for the number of items to return in the library search response. The default value for this limit is 50. If the application sets the limit to 0, the framework returns all matching items in the user’s music library.

method · iOS 16.0+

response

TypeScript
response(): Promise<MusicLibrarySearchResponse>
Swift declaration
func response() async throws -> MusicLibrarySearchResponse

Fetches items of the requested library searchable types that match the search term of the request.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

MusicLibrarySearchRequest.init(term:types:)

Passing a Swift type itself is not supported.

MusicLibrarySearchRequest.types

Passing a Swift type itself is not supported.

All MusicKit types →