Skip to content
DocumentationAPI Reference

Get Single Browse Category

browse().categories().retrieve(CategoryRetrieveParamsparams = CategoryRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : CategoryRetrieveResponse
GET/browse/categories/{category_id}

Get a single category used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).

ParametersExpand Collapse
params: CategoryRetrieveParams
categoryId: Optional<String>

The Spotify category ID for the category.

locale: Optional<String>

The desired language, consisting of an ISO 639-1 language code and an ISO 3166-1 alpha-2 country code, joined by an underscore. For example: es_MX, meaning "Spanish (Mexico)". Provide this parameter if you want the category strings returned in a particular language.
Note: if locale is not supplied, or if the specified language is not available, the category strings returned will be in the Spotify default language (American English).

ReturnsExpand Collapse
class CategoryRetrieveResponse:
id: String

The Spotify category ID of the category.

href: String

A link to the Web API endpoint returning full details of the category.

icons: List<ImageObject>

The category icon, in various sizes.

height: Optional<Long>

The image height in pixels.

url: String

The source URL of the image.

width: Optional<Long>

The image width in pixels.

published: Optional<Boolean>

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

name: String

The name of the category.

published: Optional<Boolean>

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

Get Single Browse Category

package dev.cjav.spotted.example

import dev.cjav.spotted.client.SpottedClient
import dev.cjav.spotted.client.okhttp.SpottedOkHttpClient
import dev.cjav.spotted.models.browse.categories.CategoryRetrieveParams
import dev.cjav.spotted.models.browse.categories.CategoryRetrieveResponse

fun main() {
    val client: SpottedClient = SpottedOkHttpClient.fromEnv()

    val category: CategoryRetrieveResponse = client.browse().categories().retrieve("dinner")
}
{
  "id": "equal",
  "href": "href",
  "icons": [
    {
      "height": 300,
      "url": "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n",
      "width": 300,
      "published": true
    }
  ],
  "name": "EQUAL",
  "published": true
}
Returns Examples
{
  "id": "equal",
  "href": "href",
  "icons": [
    {
      "height": 300,
      "url": "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n",
      "width": 300,
      "published": true
    }
  ],
  "name": "EQUAL",
  "published": true
}