Skip to content
A PHP library to access MusicBrainz's Web Service v2
Branch: master
Clone or download
Pull request Compare This branch is 56 commits ahead of chrisdawson:master.
mikealmond Merge pull request #28 from iainmullan/master
update guzzle client call to prevent overwriting existing config
Latest commit 072717c Sep 13, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Rename Http adapters Feb 19, 2014
src/MusicBrainz update guzzle client call to prevent overwriting existing config Sep 1, 2017
tests/MusicBrainz/Tests Small CS update Jan 6, 2015
.gitignore
.travis.yml Rename .travis.yaml to .travis.yml May 3, 2013
LICENSE.md
README.md Update the copyright Jan 6, 2015
composer.json Add PhpUnit to composer.json and update Guzzle version Feb 19, 2014
phpunit.xml

README.md

MusicBrainz Web Service (v2) PHP class

This PHP library that allows you to easily access the MusicBrainz Web Service V2 API. Visit the MusicBrainz development page for more information.

This project is a fork of https://github.com/chrisdawson/MusicBrainz and takes some inspiration from the Python bindings

Usage Example

<?php
    use Guzzle\Http\Client;
    use MusicBrainz\Filters\ArtistFilter;
    use MusicBrainz\Filters\RecordingFilter;
    use MusicBrainz\HttpAdapters\GuzzleHttpAdapter;
    use MusicBrainz\MusicBrainz;

    require __DIR__ . '/vendor/autoload.php';

    $brainz = new MusicBrainz(new GuzzleHttpAdapter(new Client()), 'username', 'password');
    $brainz->setUserAgent('ApplicationName', '0.2', 'http://example.com');

    $args = array(
        "recording"  => "Buddy Holly",
        "artist"     => 'Weezer',
        "creditname" => 'Weezer',
        "status"     => 'Official'
    );
    try {
        $recordings = $brainz->search(new RecordingFilter($args));
        print_r($recordings);
    } catch (Exception $e) {
        print $e->getMessage();
    }
?>

Look in the /examples folder for more.

Requirements

PHP5 and cURL extension.

License

Short: Use it in any project, no matter if it is commercial or not. Just don't remove the copyright notice.

MIT License

Copyright © 2015 Mike Almond

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.