Skip to content

fr05t1k/musixmatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#MusixMatch Build Status GoDoc Go Report Card Coverage Status

A Go wrapper for the MusixMatch API

##How to use ?

Simple example

package main

import (
    "github.com/fr05t1k/musixmatch"
    "fmt"
)
func main()  {
    mm := musixmatch.New("Your MusixMatch API Key") 
    lyrics, _ := mm.GetLyrics(113303287)
    
    fmt.Println(lyrics.Id)
    fmt.Println(lyrics.Body)
    fmt.Println(lyrics.Language)
}

Matching track

    track, _ := mm.GetMatchingTrack("Yesterday", "Beatles")

Search

    searchRequest := http.SearchRequest{Query:"Yesterday"}
    trackList, _ := mm.SearchTrack(searchRequest)
}

##Make custom request You can also make custom request (which is not implemented)

	params := url.Values{}
	params.Add(config.ApiKey, m.ApiKey)
	params.Add(config.QueryTrack, qTrack)
	params.Add(config.QueryArtist, qArtist)
	
	var trackResponse track.Response
	requestUrl := http.GetURLString(methods.MatcherTrackGet, params)
	err := http.RequestEntity(requestUrl, &trackResponse)

or

	params := url.Values{}
	params.Add(config.TrackId, fmt.Sprintf("%d", trackId))
	resp, err := mm.Request(methods.TrackGet, params)

	var trackResponse track.Response

	json.Unmarshal(resp, &trackResponse)

	

Releases

No releases published

Packages

No packages published

Languages