public SearchItem SearchItems(String q, SearchType type, int limit = 20, int offset = 0) { limit = Math.Min(50, limit); StringBuilder builder = new StringBuilder("https://api.spotify.com/v1/search"); builder.Append("?q=" + q); builder.Append("&type=" + type.GetStringAttribute(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); return(DownloadData <SearchItem>(builder.ToString())); }
/// <summary> /// Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. /// </summary> /// <param name="q">The search query's keywords (and optional field filters and operators), for example q=roadhouse+blues.</param> /// <param name="type">A list of item types to search across.</param> /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param> /// <param name="offset">The index of the first result to return. Default: 0</param> /// <param name="market">An ISO 3166-1 alpha-2 country code or the string from_token.</param> /// <returns></returns> public string SearchItems(String q, SearchType type, int limit = 20, int offset = 0, String market = "") { limit = Math.Min(50, limit); StringBuilder builder = new StringBuilder(APIBase + "/search"); builder.Append("?q=" + q); builder.Append("&type=" + type.GetStringAttribute(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); if (!String.IsNullOrEmpty(market)) builder.Append("&market=" + market); return builder.ToString(); }
/// <summary> /// Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. /// </summary> /// <param name="q">The search query's keywords (and optional field filters and operators), for example q=roadhouse+blues.</param> /// <param name="type">A list of item types to search across.</param> /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param> /// <param name="offset">The index of the first result to return. Default: 0</param> /// <param name="market">An ISO 3166-1 alpha-2 country code or the string from_token.</param> /// <returns></returns> public string SearchItems(string q, SearchType type, int limit = 20, int offset = 0, string market = "") { limit = Math.Min(50, limit); StringBuilder builder = new StringBuilder(APIBase + "/search"); builder.Append("?q=" + q); builder.Append("&type=" + type.GetStringAttribute(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); if (!string.IsNullOrEmpty(market)) { builder.Append("&market=" + market); } return(builder.ToString()); }
/// <summary> /// Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. /// </summary> /// <param name="q">The search query's keywords (and optional field filters and operators), for example q=roadhouse+blues.</param> /// <param name="type">A list of item types to search across.</param> /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param> /// <param name="offset">The index of the first result to return. Default: 0</param> /// <param name="market">An ISO 3166-1 alpha-2 country code or the string from_token.</param> /// <returns></returns> public SearchItem SearchItems(String q, SearchType type, int limit = 20, int offset = 0, String market = "") { limit = Math.Min(50, limit); StringBuilder builder = new StringBuilder(APIBase + "/search"); builder.Append("?q=" + q); builder.Append("&type=" + type.GetStringAttribute(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); if (market != "") { builder.Append("&market=" + market); } return(DownloadData <SearchItem>(builder.ToString())); }