{"id":16947941,"url":"https://github.com/fzerorubigd/gobgg","last_synced_at":"2025-07-21T03:34:15.814Z","repository":{"id":57559642,"uuid":"267949734","full_name":"fzerorubigd/gobgg","owner":"fzerorubigd","description":"Boardgamegeek API for Golang","archived":false,"fork":false,"pushed_at":"2025-06-19T21:05:20.000Z","size":192,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T22:20:32.944Z","etag":null,"topics":["bgg","bgg-api","bgg-library","boardgamegeek","golang","golang-library"],"latest_commit_sha":null,"homepage":"","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/fzerorubigd.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}},"created_at":"2020-05-29T20:33:36.000Z","updated_at":"2025-06-19T21:05:23.000Z","dependencies_parsed_at":"2024-02-15T12:29:12.922Z","dependency_job_id":"cec7cd69-daa2-46cb-be3d-7ca6dfa191dc","html_url":"https://github.com/fzerorubigd/gobgg","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/fzerorubigd/gobgg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzerorubigd%2Fgobgg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzerorubigd%2Fgobgg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzerorubigd%2Fgobgg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzerorubigd%2Fgobgg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fzerorubigd","download_url":"https://codeload.github.com/fzerorubigd/gobgg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzerorubigd%2Fgobgg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266235524,"owners_count":23897181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bgg","bgg-api","bgg-library","boardgamegeek","golang","golang-library"],"created_at":"2024-10-13T21:49:01.529Z","updated_at":"2025-07-21T03:34:15.797Z","avatar_url":"https://github.com/fzerorubigd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Boardgamegeek API Client for Golang\n===\n[![Go Report Card](https://goreportcard.com/badge/github.com/fzerorubigd/gobgg)](https://goreportcard.com/report/github.com/fzerorubigd/gobgg)\n[![codecov](https://codecov.io/gh/fzerorubigd/gobgg/branch/master/graph/badge.svg?token=G7VH4EDM0Y)](https://codecov.io/gh/fzerorubigd/gobgg)\n[![Go Reference](https://pkg.go.dev/badge/github.com/fzerorubigd/gobgg.svg)](https://pkg.go.dev/github.com/fzerorubigd/gobgg)\n\nBasics\n---\nCreate a new client using the `NewBGGClient` also you can use the `Login` function \nto set the cookies, some API (like posting plays) needs the login cookies. \n\nYou can set the `http.Client`, or `http.Cookie` or using different domain (do you need to?)\n\n```go\nbgg := gobgg.NewBGGClient(gobgg.SetClient(client))\n// Setting the cookies (not a requirement if you want to only use public API)\nif err := bgg.Login(\"user\", \"password\"); err != nil {\n\tlog.Fatalf(\"Login failed with error: %q\", err)\t\n}\n```\nCollection API\n---\nGetting the collection in boardgamegeek is a little tricky, so the library will retry with a backoff\nto get the collection. You can control the timeout using the context passed to the function \nor it will retry forever. \n\n```go \ncollection, err := bgg.GetCollection(ctx, \"fzerorubigd\", gobgg.SetCollectionTypes(gobgg.CollectionTypeOwn))\n```\n\nThings API\n---\nYou can get the things detail (I just use the board game related API so far) it always \ncomes with the statistics (why it should be a flag!)\n\nI decided to follow the same pattern for all the functions even when it is not required. \n\n```go\nthings , err := bgg.GetThings(ctx, gobgg.GetThingIDs(1, 2, 3))\n```\n\nPlays API\n---\n\nGetting a play is like this: \n```go \n// For users\nplays, err := bgg.Plays(ctx, gobgg.SetUserName(\"fzerorubigd\"))\n// For a game\nplays, err := bgg.Plays(ctx, gobgg.SetGameID(1))\n```\n\nPosting Plays\n---\nPosting play is an experimental API that is not using any documented API end point, for this \nyou need to call `Login` first. \n\nPerson API\n---\nFor getting the person image you can use the -undocumented- person API `PersonImage`\n\nGeekList\n--- \nThe library supports getting the lists by their id using the `GeekList` function \n\nHotness\n--- \nIt is possible to get thodays hotness and the the change since yesterday using the `Hotness` function \n\n\nRate Limiting \n---\n\nBoardgamegeek does rate limit on all the api calls. Its a good idea to add a rate limiter to your client. \nit is already supported and I recommend the `go.uber.org/ratelimit`\n\n```go\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"go.uber.org/ratelimit\"\n\t\"github.com/fzerorubigd/gobgg\"\n)\n\nrl := ratelimit.New(10, ratelimit.Per(60*time.Second)) // creates a 10 per minutes rate limiter.\nclient := gobgg.NewBGGClient(gobgg.SetLimiter(rl))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzerorubigd%2Fgobgg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffzerorubigd%2Fgobgg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzerorubigd%2Fgobgg/lists"}