{"id":15393861,"url":"https://github.com/mitchellh/go-bnet","last_synced_at":"2025-10-09T13:06:14.010Z","repository":{"id":66228456,"uuid":"56451990","full_name":"mitchellh/go-bnet","owner":"mitchellh","description":"Go (golang) client for the Battle.net API","archived":false,"fork":false,"pushed_at":"2017-07-07T23:05:38.000Z","size":35,"stargazers_count":55,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-23T16:55:50.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mitchellh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2016-04-17T18:33:37.000Z","updated_at":"2025-09-11T15:11:38.000Z","dependencies_parsed_at":"2023-05-01T09:00:31.216Z","dependency_job_id":null,"html_url":"https://github.com/mitchellh/go-bnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitchellh/go-bnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-bnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-bnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-bnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-bnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellh","download_url":"https://codeload.github.com/mitchellh/go-bnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-bnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001541,"owners_count":26083102,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-01T15:20:36.171Z","updated_at":"2025-10-09T13:06:13.981Z","avatar_url":"https://github.com/mitchellh.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-bnet\n\ngo-bnet is a Go client library for accessing the\n[Battle.net API](https://dev.battle.net). In addition to providing an API\nclient, this package provides OAuth endpoints.\n\n**Documentation:** [![GoDoc](https://godoc.org/github.com/mitchellh/go-bnet?status.svg)](https://godoc.org/github.com/mitchellh/go-bnet)\n\n**Build Status:** [![Build Status](https://travis-ci.org/mitchellh/go-bnet.svg?branch=master)](https://travis-ci.org/mitchellh/go-bnet)\n\n**API Coverage:** Currently only the account information API is implemented.\nHowever, the base helpers are there to easily and quickly implement any other\nAPIs such as the WoW or SC2 data.\n\n## Usage\n\n```go\nimport \"github.com/mitchellh/go-bnet\"\n```\n\n### Authentication\n\nAuthenticate using the [Go OAuth2](https://golang.org/x/oauth2) library.\nEndpoints are provided via the `Endpoint` function. A guide to using OAuth2\nto authenticate [is available in this blog post](https://blog.kowalczyk.info/article/f/Accessing-GitHub-API-from-Go.html).\nThe blog post uses GitHub as an example but it is almost identical for\nBattle.net and this library.\n\nBattle.net endpoints are region-specific, so specify the region to the\n`Endpoint` function and use the resulting value. Example:\n\n```go\noauthCfg := \u0026oauth2.Config{\n    // Get from dev.battle.net\n    ClientID:     \"\",\n    ClientSecret: \"\",\n\n    // Endpoint from this library\n    Endpoint: bnet.Endpoint(\"us\"),\n}\n```\n\nOnce you have access to the OAuth client, you can initilize the Battle.net\nAPI client:\n\n```go\n// Token from prior auth\nauthClient := oauthCfg.Client(oauth2.NoContext, token)\n\n// Initialize the client\nclient := bnet.NewClient(oauthClient)\n\n// ... API calls\n```\n\n### API Calls\n\nOnce a client is made, basic API calls can easliy be made:\n\n```go\nuser, resp, err := client.Account().User()\nfmt.Printf(\"User: %#v\", user)\n```\n\nAll API calls return a `*Response` value in addition to a richer type\nand error. The response contains the http.Response as well as metadata\nsuch as quotas, QPS, etc. from Battle.net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-bnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellh%2Fgo-bnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-bnet/lists"}