ChaptersAPI

class minim.api.spotify.ChaptersAPI(client: APIClient, /)[source]

Bases: SpotifyResourceAPI

Chapters API endpoints for the Spotify Web API.

Important

Audiobooks are only available in the US, UK, Canada, Ireland, New Zealand, and Australia markets.

Important

This class is managed by SpotifyWebAPIClient and should not be instantiated directly.

Parameters:
clientminim.api._shared.APIClient

API client instance used to make HTTP requests.

Methods

get_chapters

Chapters > Get a Chapter: Get Spotify catalog information for an audiobook chapter․ Chapters > Get Several Chapters: Get Spotify catalog information for multiple audiobook chapters.

get_chapters(chapter_ids: str | Collection[str], /, *, country_code: str) dict[str, Any][source]

Chapters > Get a Chapter: Get Spotify catalog information for an audiobook chapter․ Chapters > Get Several Chapters: Get Spotify catalog information for multiple audiobook chapters.

Parameters:
chapter_idsstr or Collection[str]; positional-only

Spotify IDs of the audiobook chapters. A maximum of 50 IDs can be sent in a request.

Examples:

  • "0IsXVP0JmcB2adSE338GkK"

  • "0IsXVP0JmcB2adSE338GkK,3ZXb8FKZGU0EHALYX6uCzU"

  • ["0IsXVP0JmcB2adSE338GkK", "3ZXb8FKZGU0EHALYX6uCzU"]

country_codestr; keyword-only; optional

ISO 3166-1 alpha-2 country code. If provided, only content available in that market is returned. When a user access token accompanies the request, the country associated with the user account takes priority over this parameter.

Note

If neither a country code is provided nor a country can be determined from the user account, the content is considered unavailable for the client.

Example: "ES".

Returns:
chaptersdict[str, Any]

Spotify metadata for the audiobook chapters.