package module
Version: v2.0.2+incompatible Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2016 License: MIT Imports: 8 Imported by: 4


Build Status Go Report Card Coverage Status GoDoc license


This is a simple scrapper package to fetch lyrics data from the Wikia website.


go get github.com/mamal72/golyrics


package main

import "github.com/mamal72/golyrics"

func main() {
    // Get track suggestions by searching
    suggestions, err := golyrics.SearchTrack("Blackfield Some Day") // []Track, error
    // OR
    suggestions, err := golyrics.SearchTrackByArtistAndName("Blackfield", "Some Day") // []Track, error

    // Let's check results
    if err != nil || len(suggestions) == 0 {
        // No lyrics found for this track :(
        // Try some other keywords or show some error to user

    // Assign first result to the track
    track := suggestions[0] // Track

    // Now fetch the lyrics and set it back on the track    
    err := track.FetchLyrics() // error
    if err != nil {
        // Error fetching lyrics for the track
    fmt.Printf("Lyrics of %s by %s: %s", track.Name, track.Artist, track.Lyrics)


go test

Ideas || Issues

Just fill an issue and describe it. I'll check it ASAP!


You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. ❤️

Remember to write a few tests for your code before sending pull requests.






This section is empty.


This section is empty.


This section is empty.


type Track

type Track struct {
	Artist string
	Name   string
	Lyrics string

Track is a music track containing Artist, Name and Lyrics.

func SearchTrack

func SearchTrack(query string) ([]Track, error)

SearchTrack searches for tracks using a string query that can be part of the track name or artist.

func SearchTrackByArtistAndName

func SearchTrackByArtistAndName(artist string, name string) ([]Track, error)

SearchTrackByArtistAndName searches for tracks using artist and name of the track.

func (*Track) FetchLyrics

func (track *Track) FetchLyrics() error

FetchLyrics fetches the lyrics of a Track and sets it on that track.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL