Skip to content

milindmadhukar/go-musixmatch

Repository files navigation

Go-Musixmatch!

This is a Go wrapper for working with the Musixmatch API.

Documentation can be found at: Go-Musixmatch Documentation

It aims to support every task listed in the Web API Endpoint Reference, located here.

All of the API endpoints are covered except the premium ones.

💻 Installation

To install the library simply open a terminal and type:

go get github.com/milindmadhukar/go-musixmatch

️️🛠️ Tools Used

This project was written purely in Golang for Golang.
The module helps with the usage of the Musixmatch API.

⛏️ Acquiring Musixmatch API Key.

  1. Go to the Musixmatch Developer Page and select a plan.
  2. Fill in the necessary details to create an account and verify it from your email.
  3. Go to your Account Dashboard and you should see an API Key.
  4. Note the API Key down and don't reveal it to anyone.

🏁 Basic Setup:

For all the endpoints and parameters that can be used, check the Musixmatch API docs

package main

import (
	"context"
	"fmt"
	"log"
	"net/http"

	mxm "github.com/milindmadhukar/go-musixmatch"
	"github.com/milindmadhukar/go-musixmatch/params"
)

func main() {

	client := mxm.New("<YOUR API KEY>", http.DefaultClient)

	artists, err := client.SearchArtist(context.Background(), params.QueryArtist("Martin Garrix"))
	if err != nil {
		log.Fatal(err)
	}

        fmt.Println(artists[0])

}

Output

{24407895 Martin Garrix [91 93]  NL [{MARTIJN GARRITSEN}] 67  {[]} 0 2017-02-03 07:02:12 +0000 UTC 1996 1996-05-15  0000-00-00}

Missing Features / Known Bugs

These features are not implemented as they are premium users only and give me a 401. If you have access to the endpoints and would like to contribute, please open a PR.

Unimplemented Endpoints

🧿 Extras

There is supposed to be something here idk

Thats it, have fun ✚✖