was a fork of github.com/irlndts/go-discogs because it didn't properly handle the API, but does as of the v0.3.6 release!
This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
irlndts db5bf6d2d3 Merge branch 'master' of https://github.com/irlndts/go-discogs 2016-03-11 17:54:58 +03:00
examples net/http moved inside the lib 2016-03-11 17:47:23 +03:00
README.md Update README.md 2016-03-11 17:46:37 +03:00
artists.go Artist Releases block 2016-03-11 17:07:35 +03:00
artists_test.go net/http moved inside the lib 2016-03-11 17:47:23 +03:00
commonstructs.go Artist Releases block 2016-03-11 17:07:35 +03:00
discogs.go net/http moved inside the lib 2016-03-11 17:47:23 +03:00
discogs_test.go oi! oi! oi! 2016-03-10 17:25:55 +03:00
errors.go errors 2016-03-09 18:27:37 +03:00
labels.go Label Releases block added 2016-03-10 18:26:39 +03:00
labels_test.go net/http moved inside the lib 2016-03-11 17:47:23 +03:00
masters.go oi! oi! oi! 2016-03-10 17:25:55 +03:00
masters_test.go net/http moved inside the lib 2016-03-11 17:47:23 +03:00
releases.go labels block added 2016-03-10 18:10:08 +03:00
releases_test.go net/http moved inside the lib 2016-03-11 17:47:23 +03:00

README.md

REST API 2.0 Discogs.com client

go-discogs is a Go client library for the Discogs API. Check the usage section or try the examples to see how to access the Discogs API.

Feauteres

  • Database
  • Releases
  • Master Releases
  • Release Versions
  • Artists
  • Artist Releases
  • Label
  • All Label Releases

ToDo

  • Search

Install

go get github.com/irlndts/go-discogs

Usage

The discogs package provides a client for accessing the Discogs API. First of all import library and init client variable. According to discogs api documentation you must provide your user-agent.

  package main
    
  import (
    "github.com/irlndts/go-discogs"
  )
client := discogs.NewClient().UserAgent("TestDiscogsClient/0.0.1 +example.com")

Releases

  params := &discogs.ReleaseParams{Release_id: "8138518"}
  release, _, err := d.Release.Release(params)
  
  fmt.Println(fmt.Println(release.Artists[0].Name, " - ", release.Title)) // St. Petersburg Ska-Jazz Review  -  Elephant Riddim

Artists

  params := &discogs.LabelParams{Label_id: "890477", Page: 2, Per_page: 3}
  label, _, err := d.Label.Releases(params)

  for _, release := range label.Releases {
    fmt.Println(release.Title)
  }

  /*
    Someday / I Hate Everything About You
    Spy Potion
    Surf Attack From Russia
  */

etc. More examples - soon