Skip to main content

Python library for controlling Bose SoundTouch speakers via REST API

Project description

bose-soundtouch

A Python library for controlling Bose SoundTouch speakers via the local REST API.

Background

On January 7, 2026, Bose announced that cloud support for SoundTouch products will end on May 6, 2026. After this date:

What will continue to work:

  • Streaming via Bluetooth, AirPlay, Spotify Connect, and AUX
  • Setting up and configuring your system
  • Remote control features (play, pause, skip, volume)
  • Grouping multiple speakers together

What will stop working:

  • Presets (preset buttons and app presets)
  • Browsing music services from the SoundTouch app

As part of this transition, Bose released their SoundTouch API Documentation to enable independent developers to create their own SoundTouch-compatible tools.

This library provides a clean, Pythonic interface to control SoundTouch speakers over your local network, ensuring your speakers remain fully functional even after cloud services end.

Installation

pip install bose-soundtouch

Quick Start

from bose_soundtouch import SoundTouch

# Connect to a speaker by IP address
with SoundTouch(host="192.168.1.100") as speaker:
    # Get device info
    info = speaker.get_info()
    print(f"Connected to: {info.name} ({info.type})")

    # Control playback
    speaker.play()
    speaker.set_volume(level=30)

    # Check what's playing
    now_playing = speaker.get_now_playing()
    print(f"Playing: {now_playing.track} by {now_playing.artist}")

Demo Script

A comprehensive demo script is included to test the library against a real device:

uv run python demo.py 192.168.1.100

The demo walks through device info, capabilities, sources, presets, volume control, mute, and playback controls.

Features

  • Control playback (play, pause, stop, next/previous track)
  • Adjust volume and mute
  • Select presets (1-6)
  • Select sources (AUX, Bluetooth, etc.)
  • Get now playing information
  • Control bass and tone settings
  • Multi-room zone management
  • Full type hints and dataclass models

Usage Examples

Playback Control

from bose_soundtouch import SoundTouch

with SoundTouch(host="192.168.1.100") as speaker:
    speaker.play()
    speaker.pause()
    speaker.play_pause()  # Toggle
    speaker.stop()
    speaker.next_track()
    speaker.previous_track()

Volume Control

from bose_soundtouch import SoundTouch

with SoundTouch(host="192.168.1.100") as speaker:
    # Get current volume
    volume = speaker.get_volume()
    print(f"Volume: {volume.actual_volume}, Muted: {volume.mute_enabled}")

    # Set volume (0-100)
    speaker.set_volume(level=50)

    # Mute/unmute
    speaker.mute()
    speaker.unmute()

    # Volume up/down buttons
    speaker.volume_up()
    speaker.volume_down()

Presets

from bose_soundtouch import SoundTouch

with SoundTouch(host="192.168.1.100") as speaker:
    # Get all presets
    presets = speaker.get_presets()
    for preset in presets.items:
        if preset.content_item:
            print(f"Preset {preset.id}: {preset.content_item.item_name}")

    # Select a preset
    speaker.select_preset(preset_id=1)

Now Playing

from bose_soundtouch import SoundTouch, PlayStatus

with SoundTouch(host="192.168.1.100") as speaker:
    now = speaker.get_now_playing()

    print(f"Source: {now.source}")
    print(f"Track: {now.track}")
    print(f"Artist: {now.artist}")
    print(f"Album: {now.album}")

    if now.play_status == PlayStatus.PLAY_STATE:
        print("Currently playing")
    elif now.play_status == PlayStatus.PAUSE_STATE:
        print("Paused")

Source Selection

from bose_soundtouch import SoundTouch

with SoundTouch(host="192.168.1.100") as speaker:
    # List available sources
    sources = speaker.get_sources()
    for source in sources.items:
        print(f"{source.source}: {source.status}")

    # Select a source
    speaker.select_source(source="AUX", source_account="AUX")
    speaker.select_source(source="BLUETOOTH")

Device Information

from bose_soundtouch import SoundTouch

with SoundTouch(host="192.168.1.100") as speaker:
    info = speaker.get_info()

    print(f"Name: {info.name}")
    print(f"Type: {info.type}")
    print(f"Device ID: {info.device_id}")

    for net in info.network_info:
        print(f"  {net.type}: {net.ip_address}")

Raw Key Press

For advanced use cases, you can send raw key presses:

from bose_soundtouch import SoundTouch, KeyValue

with SoundTouch(host="192.168.1.100") as speaker:
    # Using enum
    speaker.send_key(key=KeyValue.THUMBS_UP)

    # Using string
    speaker.send_key(key="POWER")

Error Handling

from bose_soundtouch import (
    SoundTouch,
    ConnectionError,
    TimeoutError,
    ApiError,
)

try:
    with SoundTouch(host="192.168.1.100", timeout=5.0) as speaker:
        speaker.set_volume(level=50)
except ConnectionError:
    print("Could not connect to speaker")
except TimeoutError:
    print("Request timed out")
except ApiError as e:
    print(f"API error: {e.error_name} (code {e.error_code})")

API Reference

SoundTouch Class

SoundTouch(
    host: str,           # IP address or hostname
    port: int = 8090,    # HTTP port (default 8090)
    timeout: float = 10.0  # Request timeout in seconds
)

Methods

Method Description
get_info() Get device information
get_capabilities() Get device capabilities
set_name(name=...) Set device name
get_now_playing() Get current playback state
get_sources() Get available sources
select_source(source=..., ...) Select a source
get_volume() Get volume state
set_volume(level=...) Set volume (0-100)
mute() / unmute() Mute/unmute
get_presets() Get preset slots
select_preset(preset_id=...) Select preset (1-6)
play() / pause() / stop() Playback control
next_track() / previous_track() Track navigation
get_bass() / set_bass(level=...) Bass control
send_key(key=...) Send raw key press

Documentation

The docs/ directory contains API documentation:

Requirements

  • Python 3.12+
  • httpx

License

MIT License


Not affiliated with, endorsed, sponsored, or approved by Bose. Bose and SoundTouch are trademarks of Bose Corporation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bose_soundtouch-0.1.2.tar.gz (444.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bose_soundtouch-0.1.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file bose_soundtouch-0.1.2.tar.gz.

File metadata

  • Download URL: bose_soundtouch-0.1.2.tar.gz
  • Upload date:
  • Size: 444.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bose_soundtouch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 67f840f6a11854912fedfa8a49e78472af666f3d7d08ccbb85b27da1b74bc538
MD5 35ab593264f9e017124eabb1fa732f73
BLAKE2b-256 87f20da076a1f217e64cea31377cc1c038db8a97064435768d76ca024dce8917

See more details on using hashes here.

Provenance

The following attestation bundles were made for bose_soundtouch-0.1.2.tar.gz:

Publisher: publish.yml on captivus/bose-soundtouch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bose_soundtouch-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bose_soundtouch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5efc4fb5297decab2d09ddd86e8f42baa4838e55fbce654dabb623bbe3c20a3a
MD5 6542c4fb29178ffad2a87516afd2441f
BLAKE2b-256 41d42a70b52bcd6c3f4a8b0f4a43fbf139fc65d77141c675faa97673e3235124

See more details on using hashes here.

Provenance

The following attestation bundles were made for bose_soundtouch-0.1.2-py3-none-any.whl:

Publisher: publish.yml on captivus/bose-soundtouch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page