Skip to main content

liblistenbrainz

liblistenbrainz is a simple Python library for the ListenBrainz Web API.

liblistenbrainz will help you start getting data from and submitting data to ListenBrainz very quickly.

Here's an example of getting the listening history of a ListenBrainz user::

import liblistenbrainz

client = liblistenbrainz.ListenBrainz()
listens = client.get_listens(username='iliekcomputers')
for listen in listens:
    print("Track name:", listen.track_name)
    print("Artist name:", listen.artist_name)

Here's another quick example of how to submit a listen to ListenBrainz::

import liblistenbrainz
import time

auth_token = input('Please enter your auth token: ')

listen = liblistenbrainz.Listen(
    track_name="Fade",
    artist_name="Kanye West",
    release_name="The Life of Pablo",
    listened_at=int(time.time()),
)

client = liblistenbrainz.ListenBrainz()
client.set_auth_token(auth_token)
response = client.submit_single_listen(listen)

More detailed documentation is available at Read The Docs.

Features

liblistenbrainz provides easy access to all ListenBrainz endpoints, handles ratelimits automatically and supports the ListenBrainz authorization flow.

For details on the API endpoints that can be used via liblistenbrainz, take a look at the ListenBrainz API Documentation.

Installation

Install or upgrade liblistenbrainz with:

pip install liblistenbrainz --upgrade

Support

You can ask questions about how to use liblistenbrainz on IRC (freenode #metabrainz). You can also email me at iliekcomputers [at] gmail [dot] com.

If you have found a bug or have a feature request, let me know by opening an issue (or a pull request).

License

liblistenbrainz - A simple client library for ListenBrainz
Copyright (C) 2020 Param Singh <iliekcomputers@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Release files for liblistenbrainz 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liblistenbrainz 0.7.0
File Size Uploaded
liblistenbrainz-0.7.0.tar.gz 33.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for liblistenbrainz 0.7.0
File Interpreter ABI Platform
liblistenbrainz-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.4 kB

Release files / liblistenbrainz-0.7.0.tar.gz

Download URL liblistenbrainz-0.7.0.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
186421d7fb61f98062a555c75d3ea2c370776fd07ffc5c2d54d4a1bd187ac3fe
BLAKE2b-256 checksum
How to use checksums
7076f224593e1f9fffb4296c8b6c0f342c5a874c317159bd0660aba6c981a3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 23, 2026.

Transparency log

Release files / liblistenbrainz-0.7.0-py3-none-any.whl

Download URL liblistenbrainz-0.7.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7097a10461bdc9866ef988f47bc5ebdd7d3ee3982c95b39b6e38823e799082b6
BLAKE2b-256 checksum
How to use checksums
e62b3fc613000cb256a9e2fe92955c97d5de697883e5c4fd9c376bf21aafcca7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.6

2 release files

0.5.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page