You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -43,7 +44,8 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
43
44
ARTIST("artist"),
44
45
PLAYLIST("playlist"),
45
46
SHOW("show"),
46
-
EPISODE("episode");
47
+
EPISODE("episode"),
48
+
AUDIOBOOK("audiobook");
47
49
}
48
50
49
51
/**
@@ -67,10 +69,10 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
67
69
* Note: Operators must be specified in uppercase. Otherwise, they are handled as normal keywords to be matched.
68
70
*
69
71
* Wildcards: The asterisk (*) character can, with some limitations, be used as a wildcard (maximum: 2 per query). It matches a variable number of non-white-space characters. It cannot be used:
70
-
- in a quoted phrase
71
-
- in a field filter
72
-
- when there is a dash (“-“) in the query
73
-
- or as the first character of the keyword string Field filters: By default, results are returned when a match is found in any field of the target object type. Searches can be made more specific by specifying an album, artist or track field filter.
72
+
- in a quoted phrase
73
+
- in a field filter
74
+
- when there is a dash (“-“) in the query
75
+
- or as the first character of the keyword string Field filters: By default, results are returned when a match is found in any field of the target object type. Searches can be made more specific by specifying an album, artist or track field filter.
74
76
*
75
77
* For example: The query q=album:gold%20artist:abba&type=album returns only albums with the text “gold” in the album name and the text “abba” in the artist name.
76
78
*
@@ -86,33 +88,34 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
* @param query Search query keywords and optional field filters and operators. You can narrow down your search using field filters. The available filters are album, artist, track, year, upc, tag:hipster, tag:new, isrc, and genre. Each field filter only applies to certain result types.
91
+
* @param query Search query keywords and optional field filters and operators (filters and operators can be provided in [filters]). You can narrow down your search using field filters. The available filters are album, artist, track, year, upc, tag:hipster, tag:new, isrc, and genre. Each field filter only applies to certain result types.
90
92
91
-
The artist filter can be used while searching albums, artists or tracks.
92
-
The album and year filters can be used while searching albums or tracks. You can filter on a single year or a range (e.g. 1955-1960).
93
-
The genre filter can be use while searching tracks and artists.
94
-
The isrc and track filters can be used while searching tracks.
95
-
The upc, tag:new and tag:hipster filters can only be used while searching albums. The tag:new filter will return albums released in the past two weeks and tag:hipster can be used to return only albums with the lowest 10% popularity.
93
+
The artist filter can be used while searching albums, artists or tracks.
94
+
The album and year filters can be used while searching albums or tracks. You can filter on a single year or a range (e.g. 1955-1960).
95
+
The genre filter can be use while searching tracks and artists.
96
+
The isrc and track filters can be used while searching tracks.
97
+
The upc, tag:new and tag:hipster filters can only be used while searching albums. The tag:new filter will return albums released in the past two weeks and tag:hipster can be used to return only albums with the lowest 10% popularity.
96
98
97
-
You can also use the NOT operator to exclude keywords from your search.
99
+
You can also use the NOT operator to exclude keywords from your search.
98
100
99
-
Example value:
100
-
"remaster%20track:Doxy+artist:Miles%20Davis"
101
+
Example value:
102
+
"remaster%20track:Doxy+artist:Miles%20Davis"
103
+
* @param filters Optional list of [SearchFilter] to apply to this search.
101
104
* @param searchTypes A list of item types to search across. Search results include hits from all the specified item types.
102
105
* @param limit Maximum number of results to return.
103
-
Default: 20
104
-
Minimum: 1
105
-
Maximum: 50
106
-
Note: The limit is applied within each type, not on the total response.
107
-
For example, if the limit value is 3 and the type is artist,album, the response contains 3 artists and 3 albums.
106
+
Default: 20
107
+
Minimum: 1
108
+
Maximum: 50
109
+
Note: The limit is applied within each type, not on the total response.
110
+
For example, if the limit value is 3 and the type is artist,album, the response contains 3 artists and 3 albums.
108
111
* @param offset The index of the first result to return.
109
-
Default: 0 (the first result).
110
-
Maximum offset (including limit): 10,000.
111
-
Use with limit to get the next page of search results.
112
+
Default: 0 (the first result).
113
+
Maximum offset (including limit): 10,00.
114
+
Use with limit to get the next page of search results.
112
115
* @param market If a country code is specified, only artists, albums, and tracks with content that is playable in that market is returned. Note:
113
-
- Playlist results are not affected by the market parameter.
114
-
- If market is set to from_token, and a valid access token is specified in the request header, only content playable in the country associated with the user account, is returned.
115
-
- Users can view the country that is associated with their account in the account settings. A user must grant access to the [SpotifyScope.USER_READ_PRIVATE] scope prior to when the access token is issued.
116
+
- Playlist results are not affected by the market parameter.
117
+
- If market is set to from_token, and a valid access token is specified in the request header, only content playable in the country associated with the user account, is returned.
118
+
- Users can view the country that is associated with their account in the account settings. A user must grant access to the [SpotifyScope.USER_READ_PRIVATE] scope prior to when the access token is issued.
116
119
**Note**: episodes will not be returned if this is NOT specified
117
120
* @param includeExternal If true, the response will include any relevant audio content that is hosted externally. By default external content is filtered out from responses.
118
121
*
@@ -121,6 +124,7 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
121
124
publicsuspendfunsearch(
122
125
query:String,
123
126
varargsearchTypes:SearchType,
127
+
filters:List<SearchFilter> = listOf(),
124
128
limit:Int? = api.spotifyApiOptions.defaultLimit,
125
129
offset:Int? = null,
126
130
market:Market? = null,
@@ -131,7 +135,8 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
131
135
requireNotNull(market) { "Market must be provided when SearchType.EPISODE is requested" }
0 commit comments