Skip to content

Chapters

Chapter operations live under client.chapters.

Methods

Method Returns Description
get(id, market=None) Chapter Fetch a chapter by Spotify ID

Examples

from spotify_sdk import SpotifyClient

with SpotifyClient(access_token="your-access-token") as client:
    chapter = client.chapters.get("example_chapter_id")
import asyncio
from spotify_sdk import AsyncSpotifyClient


async def main() -> None:
    async with AsyncSpotifyClient(access_token="your-access-token") as client:
        chapter = await client.chapters.get("example_chapter_id")


asyncio.run(main())

API details

The sync client mirrors these methods, minus the await keywords.

Bases: AsyncBaseService

Operations for Spotify chapters.

get(id, market=None) async

Get a chapter by ID.

Parameters:

Name Type Description Default
id str

The Spotify ID for the chapter.

required
market str | None

An ISO 3166-1 alpha-2 country code for chapter relinking.

None

Returns:

Type Description
Chapter

The requested chapter.

Raises:

Type Description
ValueError

If id is empty.