{"id":24430566,"url":"https://github.com/tomimelo/bhapi.js","last_synced_at":"2026-05-06T14:31:29.485Z","repository":{"id":62461412,"uuid":"560620173","full_name":"tomimelo/bhapi.js","owner":"tomimelo","description":"A TypeScript/JavaScript library to interact with Brawlhalla API","archived":false,"fork":false,"pushed_at":"2022-11-05T22:19:56.000Z","size":297,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T00:37:13.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/bhapi.js","language":"TypeScript","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/tomimelo.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":"2022-11-01T22:27:20.000Z","updated_at":"2024-04-02T17:40:43.000Z","dependencies_parsed_at":"2022-11-02T00:45:52.101Z","dependency_job_id":null,"html_url":"https://github.com/tomimelo/bhapi.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomimelo/bhapi.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomimelo%2Fbhapi.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomimelo%2Fbhapi.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomimelo%2Fbhapi.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomimelo%2Fbhapi.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomimelo","download_url":"https://codeload.github.com/tomimelo/bhapi.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomimelo%2Fbhapi.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32698093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"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":[],"created_at":"2025-01-20T14:31:29.119Z","updated_at":"2026-05-06T14:31:29.452Z","avatar_url":"https://github.com/tomimelo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tomimelo/bhapi.js\"\u003e\n    \u003cimg src=\"images/logo.webp\" alt=\"Steam logo\" width=\"150\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eBrawlhalla API\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A TypeScript/JavaScript library to interact with Brawlhalla API. It also has extended functionalities not included in original API\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/tomimelo/bhapi.js\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/tomimelo/bhapi.js\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/tomimelo/bhapi.js/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/tomimelo/bhapi.js/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\n          \u003ca href=\"#methods\"\u003eMethods\u003c/a\u003e\n          \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#new-brawlhallaapiconfig--brawlhallaapi-object\"\u003enew BrawlhallaAPI\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#searchbysteamidsteamid--promiseplayer\"\u003esearchBySteamId\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getrankingsoptions--promisereadonlyarrayranking\"\u003egetRankings\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getplayerstatsbrawlhallaid--promiseplayerstats\"\u003egetPlayerStats\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getplayerrankeddatabrawlhallaid--promiseplayerrankeddata\"\u003egetPlayerRankedData\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getclanclanid--promiseclan\"\u003egetClan\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getlegends--promisereadonlyarraylegenddata\"\u003egetLegends\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getlegendlegendid--promiselegend\"\u003egetLegend\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#getweapons--promisereadonlyarrayweapon\"\u003egetWeapons\u003c/a\u003e\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n# About The Project\n\nTypeScript/JavaScript wrapper around Brawlhalla API. Consume the API easily through different methods and access extended functionalities not included originally in the API. This is not an official Brawlhalla Application and it has no connection with Brawlhalla nor its developers.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Built With\n\n- [![Node][node.js]][node-url]\n- [![TypeScript][typescript]][typescript-url]\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n\n# Getting Started\n\nYou need to follow some steps to get this running.\n\n## Prerequisites\n\nYou need to acquire an API key from Brawlhalla. If you do not have an API key, please [read this](https://dev.brawlhalla.com/#authentication) to know how to get one.\n\n## Installation\n\nInstall the package using your package manager of choice.\n\n```sh\nnpm install bhapi.js --save\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\n# Usage\n\nYou may then import `BrawlhallaAPI` into your project.\n\n```js\n// ES Modules\nimport BrawlhallaAPI from 'bhapi.js'\n\n// CommonJS\nconst BrawlhallaAPI = require('bhapi.js')\n```\n\nAfter that, you need to instantiate the class providing the Brawlhalla API key in the config and you're ready to use it!\n\n```js\nconst bhapi = new BrawlhallaAPI({ apiKey: 'YOUR-API-KEY' })\n\nconst legends = await bhapi.getLegends()\n```\n\n## Methods\n\n### `new BrawlhallaAPI(config) ===\u003e BrawlhallaAPI object`\n\nConstructor to create a new `BrawlhallaAPI` object. You need to provide a `config` object\n\n1.  Constructor Arguments\n\n    - **config:** {BrawlhallaAPIConfig}. Config object that contains the API key\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n```\n\n### `searchBySteamID(steamId) ===\u003e Promise\u003cPlayer\u003e`\n\nFind a player by Steam ID\n\n1.  Method Arguments\n\n    - **steamId:** {SteamId64} (string). A player’s Steam ID in format steamID64 (ex 76561198025185087).\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst player = await bhapi.searchBySteamID('76561198025185087')\n\n// {\n//     \"brawlhalla_id\": 2,\n//     \"name\": \"\"\n// }\n```\n\n### `getRankings(options) ===\u003e Promise\u003cReadonlyArray\u003cRanking\u003e\u003e`\n\nGet rankings ordered and paginated 50 at a time\n\n1.  Method Arguments\n\n    - **options:** {RankingsOptions}. Search options.\n      Default values = {\n      **bracket**: '1v1',\n      **region**: 'all',\n      **page**: 1,\n      }\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst options = {\n  bracket: '1v1',\n  region: 'brz',\n  page: 1,\n  name: 'John Doe',\n}\n\nconst rankings = await bhapi.getRankings(options)\n\n// [\n//     {\n//         \"rank\": \"1\",\n//         \"name\": \"John Doe\",\n//         \"brawlhalla_id\": 20877,\n//         \"best_legend\": 25,\n//         \"best_legend_games\": 719,\n//         \"best_legend_wins\": 642,\n//         \"rating\": 2872,\n//         \"tier\": \"Diamond\",\n//         \"games\": 719,\n//         \"wins\": 642,\n//         \"region\": \"BRZ\",\n//         \"peak_rating\": 2872\n//     },\n//     ...\n// ]\n```\n\n### `getPlayerStats(brawlhallaId) ===\u003e Promise\u003cPlayerStats\u003e`\n\nGet all stats about a player\n\n1.  Method Arguments\n\n    - **brawlhallaId:** {number}. The Brawlhalla ID of a player.\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst playerStats = await bhapi.getPlayerStats(2)\n\n// {\n//     \"brawlhalla_id\": 2,\n//     \"name\": \"bmg | dan\",\n//     \"xp\": 191718,\n//     \"level\": 47,\n//     \"xp_percentage\": 0.6252398209337,\n//     \"games\": 8,\n//     \"wins\": 2,\n//     \"damagebomb\": \"29\",\n//     \"damagemine\": \"0\",\n//     \"damagespikeball\": \"0\",\n//     \"damagesidekick\": \"14\",\n//     \"hitsnowball\": 0,\n//     \"kobomb\": 0,\n//     \"komine\": 0,\n//     \"kospikeball\": 0,\n//     \"kosidekick\": 0,\n//     ...(more data)\n// }\n```\n\n### `getPlayerRankedData(brawlhallaId) ===\u003e Promise\u003cPlayerRankedData\u003e`\n\nGet ranked data about a player\n\n1.  Method Arguments\n\n    - **brawlhallaId:** {number}. The Brawlhalla ID of a player.\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst playerRankedData = await bhapi.getPlayerRankedData(2)\n\n// {\n//     \"name\": \"bmg | dan\",\n//     \"brawlhalla_id\": 2,\n//     \"rating\": 1745,\n//     \"peak_rating\": 1792,\n//     \"tier\": \"Platinum 2\",\n//     \"wins\": 207,\n//     \"games\": 391,\n//     \"region\": \"US-E\",\n//     \"global_rank\": 5698,\n//     \"region_rank\": 1644,\n//     \"legends\": [\n//         {\n//             \"legend_id\": 4,\n//             \"legend_name_key\": \"cassidy\",\n//             \"rating\": 1736,\n//             \"peak_rating\": 1792,\n//             \"tier\": \"Platinum 1\",\n//             \"wins\": 161,\n//             \"games\": 300\n//         },\n//      ... (more data)\n// }\n```\n\n### `getClan(clanId) ===\u003e Promise\u003cClan\u003e`\n\nGet information about a specific clan and its members\n\n1.  Method Arguments\n\n    - **clanId:** {number}. The clan ID of a clan.\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst clan = await bhapi.getClan(1)\n\n// {\n//     \"clan_id\": 1,\n//     \"clan_name\": \"Blue Mammoth Games\",\n//     \"clan_create_date\": 1464206400,\n//     \"clan_xp\": \"86962\",\n//     \"clan\": [\n//         {\n//             \"brawlhalla_id\": 3,\n//             \"name\": \"[BMG] Chill Penguin X\",\n//             \"rank\": \"Leader\",\n//             \"join_date\": 1464206400,\n//             \"xp\": 6664\n//         },\n//         {\n//             \"brawlhalla_id\": 2,\n//             \"name\": \"bmg | dan\",\n//             \"rank\": \"Officer\",\n//             \"join_date\": 1464221047,\n//             \"xp\": 4492\n//         }\n//     ]\n// }\n```\n\n### `getLegends() ===\u003e Promise\u003cReadonlyArray\u003cLegendData\u003e\u003e`\n\nGet summarized data for all legends. Use `getLegend(legendId)` for more details about a legend.\n\n1.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst legends = await bhapi.getLegends()\n\n// [\n//     {\n//         \"legend_id\": 3,\n//         \"legend_name_key\": \"bodvar\",\n//         \"bio_name\": \"B\\u00f6dvar\",\n//         \"bio_aka\": \"The Unconquered Viking, The Great Bear\",\n//         \"weapon_one\": \"Hammer\",\n//         \"weapon_two\": \"Sword\",\n//         \"strength\": \"6\",\n//         \"dexterity\": \"6\",\n//         \"defense\": \"5\",\n//         \"speed\": \"5\"\n//     },\n//     {\n//         \"legend_id\": 4,\n//         \"legend_name_key\": \"cassidy\",\n//         \"bio_name\": \"Cassidy\",\n//         \"bio_aka\": \"The Marshal of the Old West\",\n//         \"weapon_one\": \"Pistol\",\n//         \"weapon_two\": \"Hammer\",\n//         \"strength\": \"6\",\n//         \"dexterity\": \"8\",\n//         \"defense\": \"4\",\n//         \"speed\": \"4\"\n//     },  ...\n// ]\n```\n\n### `getLegend(legendId) ===\u003e Promise\u003cLegend\u003e`\n\nGet detailed data about a specific legend.\n\n1.  Method Arguments\n\n    - **legendId:** {number}. The legend ID of a legend.\n\n2.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst legend = await bhapi.getLegend(3)\n\n// {\n//     \"legend_id\": 3,\n//     \"legend_name_key\": \"bodvar\",\n//     \"bio_name\": \"B\\u00f6dvar\",\n//     \"bio_aka\": \"The Unconquered Viking, The Great Bear\",\n//     \"bio_quote\": \"\\\"I speak, you noble vikings, of a warrior who surpassed you all. I tell of a great bear-man who overcame giants and armies, and of how he came to leave our world and challenge the Gods.\\\"\",\n//     \"bio_quote_about_attrib\": \"\\\"                   -The Saga of B\\u00f6dvar Bearson, first stanza\\\"\",\n//     \"bio_quote_from\": \"\\\"Listen you nine-mothered bridge troll, I'm coming in, and the first beer I'm drinking is the one in your fist.\\\"\",\n//     \"bio_quote_from_attrib\": \"\\\"                   -B\\u00f6dvar to Heimdall, guardian of the gates of Asgard\\\"\",\n//     \"bio_text\": \"Born of a viking mother and bear father, ...\",\n//     \"bot_name\": \"B\\u00f6tvar\",\n//     \"weapon_one\": \"Hammer\",\n//     \"weapon_two\": \"Sword\",\n//     \"strength\": \"6\",\n//     \"dexterity\": \"6\",\n//     \"defense\": \"5\",\n//     \"speed\": \"5\"\n// }\n```\n\n### `getWeapons() ===\u003e Promise\u003cReadonlyArray\u003cWeapon\u003e\u003e`\n\nGet all weapons from legends.\n\n1.  Example Use\n\n```js\nconst config = {\n  apiKey: 'YOUR-API-KEY',\n}\n\nconst bhapi = new BrawlhallaAPI(config)\n\nconst weapons = await bhapi.getWeapons()\n\n// [\n//     { name: 'Hammer' },\n//     { name: 'Sword' },\n//     { name: 'Pistol' },\n//     { name: 'RocketLance' },\n//     { name: 'Spear' },\n//     { name: 'Katar' },\n//     { name: 'Axe' },\n//     { name: 'Bow' },\n//     { name: 'Fists' },\n//     { name: 'Scythe' },\n//     { name: 'Cannon' },\n//     { name: 'Orb' },\n//     { name: 'Greatsword' }\n// ]\n```\n\n\u003c!-- CONTRIBUTING --\u003e\n\n# Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- LICENSE --\u003e\n\n# License\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTACT --\u003e\n\n# Contact\n\nTomas Melone - [@tomzdotjs](https://twitter.com/tomzdotjs)\n\nProject Link: [https://github.com/tomimelo/bhapi.js](https://github.com/tomimelo/bhapi.js)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[contributors-shield]: https://img.shields.io/github/contributors/tomimelo/bhapi.js.svg?style=for-the-badge\n[contributors-url]: https://github.com/tomimelo/bhapi.js/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/tomimelo/bhapi.js.svg?style=for-the-badge\n[forks-url]: https://github.com/tomimelo/bhapi.js/network/members\n[stars-shield]: https://img.shields.io/github/stars/tomimelo/bhapi.js.svg?style=for-the-badge\n[stars-url]: https://github.com/tomimelo/bhapi.js/stargazers\n[issues-shield]: https://img.shields.io/github/issues/tomimelo/bhapi.js.svg?style=for-the-badge\n[issues-url]: https://github.com/tomimelo/bhapi.js/issues\n[license-shield]: https://img.shields.io/github/license/tomimelo/bhapi.js.svg?style=for-the-badge\n[license-url]: https://github.com/tomimelo/bhapi.js/blob/master/LICENSE.txt\n[node.js]: https://img.shields.io/badge/-Node.js-3C873A?style=for-the-badge\u0026logo=Node.js\u0026logoColor=white\n[node-url]: https://nodejs.org/\n[typescript]: https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\n[typescript-url]: https://www.typescriptlang.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomimelo%2Fbhapi.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomimelo%2Fbhapi.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomimelo%2Fbhapi.js/lists"}