{"id":37110345,"url":"https://github.com/sonjek/go-lastfm","last_synced_at":"2026-01-14T13:06:14.352Z","repository":{"id":225659074,"uuid":"766525141","full_name":"sonjek/go-lastfm","owner":"sonjek","description":"Golang wrapper for the Last.fm API 2.0","archived":false,"fork":false,"pushed_at":"2025-09-14T10:55:42.000Z","size":127,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-14T12:32:03.421Z","etag":null,"topics":["api-wrapper","go","golang","lastfm","lastfm-api"],"latest_commit_sha":null,"homepage":"https://github.com/sonjek/go-lastfm","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"shkh/lastfm-go","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonjek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-03T14:07:39.000Z","updated_at":"2025-09-14T10:55:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"40cad162-9524-4f6b-a47e-7e274abd490e","html_url":"https://github.com/sonjek/go-lastfm","commit_stats":null,"previous_names":["sonjek/lastfm-go","sonjek/go-lastfm"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sonjek/go-lastfm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonjek%2Fgo-lastfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonjek%2Fgo-lastfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonjek%2Fgo-lastfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonjek%2Fgo-lastfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonjek","download_url":"https://codeload.github.com/sonjek/go-lastfm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonjek%2Fgo-lastfm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","go","golang","lastfm","lastfm-api"],"created_at":"2026-01-14T13:06:13.669Z","updated_at":"2026-01-14T13:06:14.344Z","avatar_url":"https://github.com/sonjek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-lastfm\n\n[![Go build status](https://github.com/sonjek/go-lastfm/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/sonjek/go-lastfm/actions/workflows/ci.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/sonjek/go-lastfm)](https://goreportcard.com/report/github.com/sonjek/go-lastfm) [![API reference](https://img.shields.io/badge/api-reference-blue.svg)](https://pkg.go.dev/github.com/sonjek/go-lastfm) [![Contributors](https://img.shields.io/github/contributors/sonjek/go-lastfm)](https://github.com/sonjek/go-lastfm/graphs/contributors) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/sonjek/go-lastfm?include_prereleases)](https://github.com/sonjek/go-lastfm/releases) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sonjek/go-lastfm/blob/master/LICENSE)\n\n\n[sonjek/go-lastfm](https://github.com/sonjek/go-lastfm) is a fork of [shkh/lastfm-go](https://github.com/shkh/lastfm-go) that hasn't been maintained since the end of 2019.\n\n## Purpose\nGolang wrapper for the [Last.fm API 2.0](https://www.last.fm/api/)\n\n## Setup\n\nGet the source codes from github:\n\n```bash\ngo get github.com/sonjek/go-lastfm/lastfm\n```\n\nImport the package:\n\n```go\n    import \"github.com/sonjek/go-lastfm/lastfm\"\n```\n\n## Usage\n\nFirst, create an API instance with your `API KEY` and `API SECRET`.\n\n```go\n\tapi := lastfm.New(ApiKey, ApiSecret)\n```\n\nNote that some API methods require your user's permission, so make sure that your requests are authenticated before calling these methods. See \"Authentication\" section.\n\nAPI instances contain the structs which represent API classes, and each struct has methods corresponding to their API methods.\nSo you can call `artist.getTopTracks` for example as following:\n\n```go\n    // with discarding error\n\tresult, _ := api.Artist.GetTopTracks(lastfm.P{\"artist\": \"Avicii\"})\n\tfor _, track := range result.Tracks {\n\t\tfmt.Println(track.Name)\n\t}\n```\n\nMethods that fetch some data return their result as a struct named `ClassMethod` (e.g. api.User.GetInfo returns its result of type UserGetInfo).\nThey can be found in `class_result.go`.\nPlease look at the file to see which fields are exported.\n\nYou can use `lastfm.P` for arguments.\nIt's just an alias to `map[string]interface{}`, but values must be `string`, `int`, `int64` (for unix timestamp) or `[]string`.\nSlice of string, []string, can be used for passing multiple values for a key.\n\n```go\n\t// album.addTags (auth required)\n\tapi.Album.AddTags(lastfm.P{\n\t\t\"artist\": \"Kaene\",\n\t\t\"album\":  \"Strangeland\",\n\t\t\"tags\":   []string{\"britpop\", \"alternative rock\", \"2012\"},\n\t})\n```\n\n\n## Authentication\nThere are three ways to authenticate your requests, which to choose depends on what kind of application you are making.\n\n- for Mobile Apps\n\n```go\n\terr := api.Login(username, password)\n```\n\n- for Desktop Apps\n\n```go\n\ttoken, _ := api.GetToken()\n\tauthUrl := api.GetAuthTokenUrl(token)\n\t// Send your user to \"authUrl\"\n\t// Once the user grant permission, then authorize the token.\n\tapi.LoginWithToken(token)\n```\n\n- for Web Apps\n\n```go\n\tcallback := \"https://spam.hum\"\n\tauthUrl, _ := api.GetAuthRequestUrl(callback)\n\t// Send your user to \"authUrl\"\n\t// Get the token embeded in the redirected URL, then authorize the token.\n\tapi.LoginWithToken(token)\n```\n\n## Examples\n\nMore usage examples can be found in [examples directory](examples).\n\n## Supported APIs\n\n### Album\n* [album.addTags](https://www.last.fm/api/show/album.addTags)\n* [album.getInfo](https://www.last.fm/api/show/album.getInfo)\n* [album.getTags](https://www.last.fm/api/show/album.getTags)\n* [album.getTopTags](https://www.last.fm/api/show/album.getTopTags)\n* [album.removeTag](https://www.last.fm/api/show/album.removeTag)\n* [album.search](https://www.last.fm/api/show/album.search)\n\n### Artist\n* [artist.addTags](https://www.last.fm/api/show/artist.addTags)\n* [artist.getCorrection](https://www.last.fm/api/show/artist.getCorrection)\n* [artist.getInfo](https://www.last.fm/api/show/artist.getInfo)\n* [artist.getSimilar](https://www.last.fm/api/show/artist.getSimilar)\n* [artist.getTags](https://www.last.fm/api/show/artist.getTags)\n* [artist.getTopAlbums](https://www.last.fm/api/show/artist.getTopAlbums)\n* [artist.getTopTags](https://www.last.fm/api/show/artist.getTopTags)\n* [artist.getTopTracks](https://www.last.fm/api/show/artist.getTopTracks)\n* [artist.removeTag](https://www.last.fm/api/show/artist.removeTag)\n* [artist.search](https://www.last.fm/api/show/artist.search)\n\n### Auth\n* [auth.getMobileSession](https://www.last.fm/api/show/auth.getMobileSession)\n* [auth.getSession](https://www.last.fm/api/show/auth.getSession)\n* [auth.getToken](https://www.last.fm/api/show/auth.getToken)\n\n### Chart\n* [chart.getTopArtists](https://www.last.fm/api/show/chart.getTopArtists)\n* [chart.getTopTags](https://www.last.fm/api/show/chart.getTopTags)\n* [chart.getTopTracks](https://www.last.fm/api/show/chart.getTopTracks)\n\n### Geo\n* [geo.getTopArtists](https://www.last.fm/api/show/geo.getTopArtists)\n* [geo.getTopTracks](https://www.last.fm/api/show/geo.getTopTracks)\n\n### Library\n* [library.getArtists](https://www.last.fm/api/show/library.getArtists)\n\n### Tag\n* [tag.getInfo](https://www.last.fm/api/show/tag.getInfo)\n* [tag.getSimilar](https://www.last.fm/api/show/tag.getSimilar)\n* [tag.getTopAlbums](https://www.last.fm/api/show/tag.getTopAlbums)\n* [tag.getTopArtists](https://www.last.fm/api/show/tag.getTopArtists)\n* [tag.getTopTags](https://www.last.fm/api/show/tag.getTopTags)\n* [tag.getTopTracks](https://www.last.fm/api/show/tag.getTopTracks)\n* [tag.getWeeklyChartList](https://www.last.fm/api/show/tag.getWeeklyChartList)\n\n### Track\n* [track.addTags](https://www.last.fm/api/show/track.addTags)\n* [track.getCorrection](https://www.last.fm/api/show/track.getCorrection)\n* [track.getInfo](https://www.last.fm/api/show/track.getInfo)\n* [track.getSimilar](https://www.last.fm/api/show/track.getSimilar)\n* [track.getTags](https://www.last.fm/api/show/track.getTags)\n* [track.getTopTags](https://www.last.fm/api/show/track.getTopTags)\n* [track.love](https://www.last.fm/api/show/track.love)\n* [track.removeTag](https://www.last.fm/api/show/track.removeTag)\n* [track.scrobble](https://www.last.fm/api/show/track.scrobble)\n* [track.search](https://www.last.fm/api/show/track.search)\n* [track.unlove](https://www.last.fm/api/show/track.unlove)\n* [track.updateNowPlaying](https://www.last.fm/api/show/track.updateNowPlaying)\n\n### User\n* [user.getFriends](https://www.last.fm/api/show/user.getFriends)\n* [user.getInfo](https://www.last.fm/api/show/user.getInfo)\n* [user.getLovedTracks](https://www.last.fm/api/show/user.getLovedTracks)\n* [user.getPersonalTags](https://www.last.fm/api/show/user.getPersonalTags)\n* [user.getRecentTracks](https://www.last.fm/api/show/user.getRecentTracks)\n* [user.getTopAlbums](https://www.last.fm/api/show/user.getTopAlbums)\n* [user.getTopArtists](https://www.last.fm/api/show/user.getTopArtists)\n* [user.getTopTags](https://www.last.fm/api/show/user.getTopTags)\n* [user.getTopTracks](https://www.last.fm/api/show/user.getTopTracks)\n* [user.getWeeklyAlbumChart](https://www.last.fm/api/show/user.getWeeklyAlbumChart)\n* [user.getWeeklyArtistChart](https://www.last.fm/api/show/user.getWeeklyArtistChart)\n* [user.getWeeklyChartList](https://www.last.fm/api/show/user.getWeeklyChartList)\n* [user.getWeeklyTrackChart](https://www.last.fm/api/show/user.getWeeklyTrackChart)\n\n## Licence\nMIT Licenced. See [LICENCE](https://github.com/sonjek/go-lastfm/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonjek%2Fgo-lastfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonjek%2Fgo-lastfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonjek%2Fgo-lastfm/lists"}