Usage

Identification

To access the MusicBrainz webservice through this library, you need to identify your application by setting the useragent header made in HTTP requests to one that is unique to your application.

To ease this, the convenience function musicbrainzngs.set_useragent() is provided which automatically sets the useragent based on information about the application name, version and contact information to the format recommended by MusicBrainz.

If a request is made without setting the useragent beforehand, a musicbrainzngs.UsageError will be raised.

Authentication

Certain calls to the webservice require user authentication prior to the call itself. The affected functions state this requirement in their documentation. The user and password used for authentication are the same as for the MusicBrainz website itself and can be set with the musicbrainzngs.auth() method. After calling this function, the credentials will be saved and automaticall used by all functions requiring them.

If a method requiring authentication is called without authenticating, a musicbrainzngs.UsageError will be raised.

If the credentials provided are wrong and the server returns a status code of 401, a musicbrainzngs.AuthenticationError will be raised.

Getting data

Searching

Browsing

Submitting

Project Versions

Table Of Contents

Previous topic

Installation

Next topic

API

This Page