{"id":22743113,"url":"https://github.com/rikas/brawlhalla-api","last_synced_at":"2025-04-14T08:42:43.831Z","repository":{"id":62554566,"uuid":"159596474","full_name":"rikas/brawlhalla-api","owner":"rikas","description":"Brawlhalla API — Ruby wrapper","archived":false,"fork":false,"pushed_at":"2021-05-21T16:08:27.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T05:22:30.720Z","etag":null,"topics":["brawlhalla","brawlhalla-api"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/rikas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-29T02:36:33.000Z","updated_at":"2022-02-07T18:42:13.000Z","dependencies_parsed_at":"2022-11-03T05:15:21.766Z","dependency_job_id":null,"html_url":"https://github.com/rikas/brawlhalla-api","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikas%2Fbrawlhalla-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikas%2Fbrawlhalla-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikas%2Fbrawlhalla-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikas%2Fbrawlhalla-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rikas","download_url":"https://codeload.github.com/rikas/brawlhalla-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248849695,"owners_count":21171623,"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":["brawlhalla","brawlhalla-api"],"created_at":"2024-12-11T01:16:37.489Z","updated_at":"2025-04-14T08:42:43.813Z","avatar_url":"https://github.com/rikas.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brawlhalla API\n\nA ruby wrapper for the [Brawlhalla API](http://dev.brawlhalla.com/).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'brawlhalla-api'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install brawlhalla-api\n\n## Usage\n\nBefore using Brawlhalla::API you need to set it up with a valid API key.\n\n```ruby\nBrawlhalla::API.configure do |config|\n  config.api_key = 'YOUR_API_KEY_HERE'\n  config.debug = false # set to true for debugging\nend\n```\n\n### Search By Steam ID\n\nA Player can be looked up by steam ID. This returns the player’s name and brawlhalla_id.\n\n_(A player’s steamid in format steamID64 (ex 76561198048321884).)_\n\n```ruby\nBrawlhalla::API.search('76561198048321884')\n# =\u003e #\u003cBrawlhalla::API::PlayerSearch:0x00007fa9db937a10 @brawlhalla_id=8817417, @name=\"Rikas\"\u003e\n```\n\n### Players\n\n#### Stats\n\nThis endpoint retrieves all stats about a player, given a `brawlhalla_id`. It will return a new\n`Brawlhalla::API::Player` instance with all the stats as attributes.\n\n```ruby\nplayer = Brawlhalla::API::Player.find('8817417')\n# =\u003e #\u003cBrawlhalla::API::Player:0x00007f9642b71350 ...\u003e\n\nplayer.games # =\u003e 1839\nplayer.brawlhalla_id # =\u003e 8817417\nplayer.damagebomb  # =\u003e 5516\nplayer.kobomb # =\u003e 47\n```\n\nYou also get individual stats (`Brawlhalla::API::LegendStat` instance) for each legend.\n\n```ruby\nplayer.legend_stats.size # =\u003e 42\n\nscarlet_stats = player.legend_stats.first\n\nscarlet_stats.damagedealt # =\u003e 4481\nscarlet_stats.damagegadgets # =\u003e 53\nscarlet_stats.games # =\u003e 45\n```\n\n#### Ranked\n\nThis endpoint retrieves ranked data about a player. It receives one argument - the brawlhalla_id of\nthe player.\n\n```ruby\nranked = Brawlhalla::API::Ranking.find('8817417')\nranked.wins # =\u003e 172\nranked.region # =\u003e \"EU\"\nranked.rating # =\u003e 1394\nranked.peak_rating # =\u003e 1415\n```\n\n**Note**: You can also get the ranked data if you already have a `Brawlhalla::API::Player` instance\nby calling the `#ranking` method. Keep in mind that this will also trigger an API call:\n\n```ruby\nplayer = Brawlhalla::API::Player.find('8817417')\nplayer.ranking #=\u003e All the ranked data like the one you get with `Brawlhalla::API::Ranked.find`\n```\n\nYou can check each legend's rankings by calling the `#legend_rankings` method. This will return an\narray of `Brawlhalla::API::LegendRanking` instances:\n\n```ruby\nranked = Brawlhalla::API::Ranking.find('8817417')\nlegend_rankings = ranked.legend_rankings # Array of LegendRanking instances\nlegend_rankings.size # =\u003e 10\n\nbodvar_ranking = legend_rankings.first\nbodvar_ranking.games # =\u003e 31\nbodvar_ranking.peak_rating # =\u003e 1200\nbodvar.rating # =\u003e 1199\nbodvar_ranking.tier # =\u003e \"Silver 2\"\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run\nthe tests. You can also run `bin/console` for an interactive prompt that will allow you to\nexperiment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rikas/brawlhalla-api.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikas%2Fbrawlhalla-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frikas%2Fbrawlhalla-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikas%2Fbrawlhalla-api/lists"}