Skip to content

muesli/gomusicbrainz

 
 

Repository files navigation

gomusicbrainz

a Go (Golang) MusicBrainz WS2 client library - work in progress. Build Status

gopherbrainz Oo

Current state

Currently only search requests are supported. Browse and lookup requests will follow as soon as all search requests are covered.

Installation

go get github.com/michiwend/gomusicbrainz

Example usage

This example demonstrates a simple search requests to find all artists matching "bonobo" or "Parov Stelar". You can find it as a runnable go program in the samples folder.

import "github.com/michiwend/gomusicbrainz"

// create a new WS2 client
client := gomusicbrainz.NewWS2Client()

// provide some information about your application
client.SetClientInfo(
    "A GoMusicBrainz example",
    "0.0.1-beta",
    "http://github.com/michiwend/gomusicbrainz")

// Search for some artist with default settings
resp, _ := client.SearchArtist(`bonobo OR "Parov Stelar"`, -1, -1)

// Pretty print Name and Id of each returned artist.
for _, artist := range resp.Artists {
    fmt.Printf("Name: %-25s ID: %s\n", artist.Name, artist.Id)
}

Full documentation

All search request follow the Apache Lucene syntax. Please head over to the [MusicBrainz website] (https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search) for more information about all possible query-fields.

Documentation for this package can be found on godoc.org (badge).

GoDoc

About

a Go (Golang) MusicBrainz WS2 client library - work in progress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published