{"id":37156028,"url":"https://github.com/twoscott/gobble-fm","last_synced_at":"2026-01-14T18:28:25.315Z","repository":{"id":291708798,"uuid":"954475443","full_name":"twoscott/gobble-fm","owner":"twoscott","description":"A Go (Golang) library for the Last.fm API","archived":false,"fork":false,"pushed_at":"2025-10-22T16:24:23.000Z","size":240,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T18:24:11.242Z","etag":null,"topics":["go","golang","lastfm","lastfm-api"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/twoscott/gobble-fm","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twoscott.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":"2025-03-25T06:22:38.000Z","updated_at":"2025-10-22T16:24:27.000Z","dependencies_parsed_at":"2025-10-22T18:13:11.610Z","dependency_job_id":"dbad2440-064b-4e49-920c-d0b62a7382e4","html_url":"https://github.com/twoscott/gobble-fm","commit_stats":null,"previous_names":["twoscott/go-fm","twoscott/gobble-fm"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/twoscott/gobble-fm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoscott%2Fgobble-fm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoscott%2Fgobble-fm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoscott%2Fgobble-fm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoscott%2Fgobble-fm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twoscott","download_url":"https://codeload.github.com/twoscott/gobble-fm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoscott%2Fgobble-fm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["go","golang","lastfm","lastfm-api"],"created_at":"2026-01-14T18:28:24.511Z","updated_at":"2026-01-14T18:28:25.300Z","avatar_url":"https://github.com/twoscott.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gobble.fm\r\n\r\n[![Go Reference](https://img.shields.io/badge/reference-009bc2?style=flat-round\u0026logo=go\u0026logoColor=ffffff)](https://pkg.go.dev/github.com/twoscott/gobble-fm)\r\n[![Go Version 1.23+](https://img.shields.io/badge/go-1.23+-009bc2?style=flat-round)](https://golang.org/dl/)\r\n[![Tag](https://img.shields.io/github/v/tag/twoscott/gobble-fm?style=flat-round\u0026color=00b1b1)](https://github.com/twoscott/gobble-fm/tags)\r\n[![Go Tests](https://img.shields.io/github/actions/workflow/status/twoscott/gobble-fm/test.yml?branch=master\u0026style=flat-round\u0026label=tests)](https://github.com/twoscott/gobble-fm/actions/workflows/test.yml)\r\n[![Go Report Card](https://goreportcard.com/badge/github.com/twoscott/gobble-fm?style=flat-round)](https://goreportcard.com/report/github.com/twoscott/gobble-fm)\r\n[![Last Commit](https://img.shields.io/github/last-commit/twoscott/gobble-fm?logo=github\u0026logoColor=ffffff\u0026style=flat-round)](https://github.com/twoscott/gobble-fm/commits/master)\r\n\r\nGobble.fm is a Go (Golang) library for interacting with the Last.fm API.\r\n\r\n## Why Gobble.fm?\r\n\r\n- Comprehensive API coverage.\r\n- Package separation between unauthenticated and authenticated API methods.\r\n- Typed API parameter structs for URL encoding—no need to reference API docs or manually enter parameter names.\r\n- Typed response struct fields—no need to convert from strings.\r\n- Helper types and constants for easier API interaction.\r\n\r\n## Installation\r\n\r\n\tgo get github.com/twoscott/gobble-fm\r\n\r\n## Documentation\r\n\r\n- [Gobble.fm documentation](https://pkg.go.dev/github.com/twoscott/gobble-fm)\r\n- [Last.fm API documentation](https://www.last.fm/api)\r\n\r\n## Usage\r\n\r\nFirst you need to instatiate the Last.fm API. You can choose the level of abstraction you'd like to use to interact with the API:\r\n```go\r\nimport \"github.com/twoscott/gobble-fm/api\"\r\n// Basic API client with only the API key. No access to auth methods.\r\nfm := api.NewClientKeyOnly(\"API_KEY\")\r\n```\r\n```go\r\n// Make calls to auth.[getMobileSession|getSession|getToken] methods.\r\nfm := api.NewClient(\"API_KEY\", \"SECRET\")\r\n```\r\n```go\r\nimport \"github.com/twoscott/gobble-fm/session\"\r\n// Authenticate API calls on behalf of a user.\r\nfm := session.NewClient(\"API_KEY\", \"SECRET\")\r\n// Must authenticate a user first. e.g.,\r\nfm.Login(\"USERNAME\", \"PASSWORD\")\r\n// or\r\nfm.TokenLogin(\"AUTHORIZED_TOKEN\")\r\n```\r\n#\r\nLow-level abstractions:\r\n```go\r\nimport \"github.com/twoscott/gobble-fm/api\"\r\n// Provides methods for making API requests such as Get, Post, and Request.\r\nfm := api.New(\"API_KEY\", \"SECRET\")\r\n```\r\n```go\r\nimport \"github.com/twoscott/gobble-fm/session\"\r\n// Provides methods for making authenticated API requests.\r\nfm := session.New(\"API_KEY\", \"SECRET\")\r\n// Must authenticate a user first. e.g.,\r\n// Obtain session key from one of the auth methods.\r\nfm.SetSessionKey(\"SESSION_KEY\")\r\n```\r\n\r\n## Simple Example\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"errors\"\r\n\t\"fmt\"\r\n\t\"time\"\r\n\r\n\t\"github.com/twoscott/gobble-fm/api\"\r\n\t\"github.com/twoscott/gobble-fm/lastfm\"\r\n)\r\n\r\nfunc main() {\r\n\tfm := api.NewClientKeyOnly(\"API_KEY\")\r\n\r\n\tparams := lastfm.RecentTracksParams{\r\n\t\tUser:  \"Username\",\r\n\t\tLimit: 5,\r\n\t\tFrom:  time.Now().Add(-24 * time.Hour),\r\n\t}\r\n\r\n\tres, err := fm.User.RecentTracks(params)\r\n\tif err != nil {\r\n\t\tvar fmerr *api.LastFMError\r\n\t\tif errors.As(err, \u0026fmerr) {\r\n\t\t\tswitch fmerr.Code {\r\n\t\t\tcase api.ErrInvalidParameters:\r\n\t\t\t\tfmt.Println(\"Invalid parameters\")\r\n\t\t\tcase api.ErrOperationFailed:\r\n\t\t\t\tfmt.Println(\"Operation failed\")\r\n\t\t\tdefault:\r\n\t\t\t\tfmt.Println(err)\r\n\t\t\t\t// ...\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfmt.Println(err)\r\n\t\t}\r\n\r\n\t\treturn\r\n\t}\r\n\r\n\tfor i, t := range res.Tracks {\r\n\t\tfmt.Printf(\"%d.\\t%s by %s\\n\", i+1, t.Title, t.Artist.Name)\r\n\r\n\t\tif t.NowPlaying {\r\n\t\t\tfmt.Println(\"\\tNow playing...\")\r\n\t\t} else {\r\n\t\t\tago := time.Since(t.ScrobbledAt.Time()).Truncate(time.Second)\r\n\t\t\tfmt.Printf(\"\\tScrobbled %s ago\\n\", ago)\r\n\t\t}\r\n\r\n\t\tfmt.Printf(\"\\n\\tArt: %s\\n\", t.Image.OriginalURL())\r\n\t\tfmt.Println()\r\n\t}\r\n}\r\n```\r\n\r\n## More Examples\r\n\r\n- #### [Mobile Auth Example](https://github.com/twoscott/gobble-fm/blob/master/examples/auth/auth-flow-mobile/main.go)\r\n- #### [Desktop Auth Example](https://github.com/twoscott/gobble-fm/blob/master/examples/auth/auth-flow-desktop/main.go)\r\n- #### [Web Auth Example](https://github.com/twoscott/gobble-fm/blob/master/examples/auth/auth-flow-web/main.go)\r\n- #### [Multi Scrobble Example](https://github.com/twoscott/gobble-fm/blob/master/examples/multi-scrobble/main.go)\r\n- #### [Recent Tracks Example](https://github.com/twoscott/gobble-fm/blob/master/examples/recent-tracks/main.go)\r\n- #### [Top Albums Example](https://github.com/twoscott/gobble-fm/blob/master/examples/top-albums/main.go)\r\n- #### [Add Tags Example](https://github.com/twoscott/gobble-fm/blob/master/examples/add-tags/main.go)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwoscott%2Fgobble-fm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwoscott%2Fgobble-fm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwoscott%2Fgobble-fm/lists"}