Skip to main content

A simple ListenBrainz client library for Python

Project description


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

pylistenbrainz 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 pylistenbrainz

client = pylistenbrainz.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 pylistenbrainz
import time

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

listen = pylistenbrainz.Listen(
    artist_name="Kanye West",
    release_name="The Life of Pablo",

client = pylistenbrainz.ListenBrainz()
response = client.submit_single_listen(listen)

More detailed documentation is available at Read The Docs.


pylistenbrainz 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 pylistenbrainz, take a look at the ListenBrainz API Documentation.


Install or upgrade pylistenbrainz with:

pip install pylistenbrainz --upgrade


You can ask questions about how to use pylistenbrainz 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).


pylistenbrainz - A simple client library for ListenBrainz
Copyright (C) 2020 Param Singh <>

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
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 <>.

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

pylistenbrainz-0.5.1.tar.gz (11.3 kB view hashes)

Uploaded source

Built Distribution

pylistenbrainz-0.5.1-py3-none-any.whl (28.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page