Skip to content

mager/discogs_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiscogsEx

An Elixir library for Discogs API 2.0.

Endpoints

More to come!

Installation

If available in Hex, the package can be installed by adding discogs_ex to your list of dependencies in mix.exs:

def deps do
  [{:discogs_ex, "~> 0.0.1"}]
end

Usage

Create a client with your key and secret.

iex> auth = %{key: "key", secret: "secret"}
iex> client = DiscogsEx.Client.new auth
%DiscogsEx.Client{auth: %{key: "key", secret: "secret"}, endpoint: "https://api.discogs.com/"}
iex> DiscogsEx.Database.search "Demi Lovato", %{"title": "sorry not sorry"}, client
%{
  "pagination" => %{
    "items" => 3, "page" => 1, "pages" => 1, "per_page" => 50, "urls" => %{}
  },
  "results" => [
    %{
      "barcode" => ["1256232718"],
      "catno" => "none",
      "community" => %{
        "have" => 2,
        "want" => 0
      },
      "country" => "Unknown",
      "format" => ["File", "AAC", "Single"],
      "genre" => ["Pop"],
      "id" => 10559613,
      "label" => ["Hollywood Records", "Island Records", "Safehouse Records", "Hollywood Records, Inc."],
      "resource_url" => "https://api.discogs.com/releases/10559613",
      "style" => ["Vocal"],
      "thumb" =>  "https://api-img.discogs.com/F2I6nvCRGxZUoJuws-ouhonFfIA=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-10559613-1499887916-1414.jpeg.jpg",
      "title" => "Demi Lovato - Sorry Not Sorry",
      "type" => "release",
      "uri" => "/Demi-Lovato-Sorry-Not-Sorry/release/10559613",
      "year" => "2017"},
    },
    # More results
  ]
}

Documentation

mix docs

Once published, the docs can be found at https://hexdocs.pm/discogs_ex.

Testing

mix coveralls

Version History

  • 2017-08-05: v0.0.1 - Initial release
    • DiscogsEx.Client
    • DiscogsEx.Database.Search

About

An Elixir library for Discogs API 2.0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages