Class SearchForItemRequest.Builder

All Implemented Interfaces:
IRequest.Builder<SearchResult, SearchForItemRequest.Builder>
Enclosing class:
SearchForItemRequest

public static final class SearchForItemRequest.Builder extends AbstractDataRequest.Builder<SearchResult, SearchForItemRequest.Builder>
Builder class for building a SearchForItemRequest.
  • Constructor Details

    • Builder

      public Builder(String accessToken)
      Create a new SearchForItemRequest.Builder instance.
      Parameters:
      accessToken - Required. A valid access token from the Spotify Accounts service.
  • Method Details

    • q

      The q query parameter setter.
      Parameters:
      q - Required. Your search query. 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. The artist and year filters can be used while searching albums, artists and tracks. You can filter on a single year or a range (e.g. 1955-1960).
      The album filter can be used while searching albums and tracks.
      The genre filter can be used while searching artists and tracks.
      The isrc and track filters can be used while searching tracks.
      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.
      Returns:
      A SearchForItemRequest.Builder.
    • type

      The type query parameter setter.
      Parameters:
      type - Required. A comma-separated list of item types to search across. Search results include hits from all the specified item types. For example: q=abacab&amp;type=album,track returns both albums and tracks matching "abacab".
      Returns:
      A SearchForItemRequest.Builder.
    • market

      public SearchForItemRequest.Builder market(CountryCode market)
      The market query parameter setter.
      Parameters:
      market - Optional. An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.
      If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.
      Note: If neither market or user country are provided, the content is considered unavailable for the client.
      Users can view the country that is associated with their account in the account settings.
      Returns:
      A SearchForItemRequest.Builder.
    • limit

      public SearchForItemRequest.Builder limit(Integer limit)
      The limit query parameter setter.
      Parameters:
      limit - Optional. The maximum number of results to return in each item type.
      Returns:
      A SearchForItemRequest.Builder.
    • offset

      public SearchForItemRequest.Builder offset(Integer offset)
      The offset query parameter setter.
      Parameters:
      offset - Optional. The index of the first result to return. Use with limit to get the next page of search results.
      Returns:
      A SearchForItemRequest.Builder.
    • include_external

      public SearchForItemRequest.Builder include_external(String include_external)
      The include_external query parameter setter.
      Parameters:
      include_external - Optional. If include_external=audio is specified it signals that the client can play externally hosted audio content, and marks the content as playable in the response. By default externally hosted audio content is marked as unplayable in the response.
      Returns:
      A SearchForItemRequest.Builder.
    • build

      public SearchForItemRequest build()
      The request build method.
      Returns:
      A SearchForItemRequest.
    • self

      protected SearchForItemRequest.Builder self()
      Description copied from class: AbstractRequest.Builder
      Return this instance to simulate a self-type.
      Specified by:
      self in class AbstractRequest.Builder<SearchResult, SearchForItemRequest.Builder>
      Returns:
      This instance.