{"id":21650799,"url":"https://github.com/muffinking-jpeg/wg-api-lib","last_synced_at":"2026-05-20T19:06:51.928Z","repository":{"id":60024404,"uuid":"539593196","full_name":"MuffinKing-jpeg/wg-api-lib","owner":"MuffinKing-jpeg","description":"Lib for obtaining players stats in games made by Wargaming.net","archived":false,"fork":false,"pushed_at":"2022-10-15T08:38:00.000Z","size":1044,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T13:14:12.145Z","etag":null,"topics":["api","lib","library","wargaming","wargaming-api","worldoftanks","wot","wotb","wotblitz"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MuffinKing-jpeg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-21T16:52:32.000Z","updated_at":"2024-02-11T10:46:53.000Z","dependencies_parsed_at":"2023-01-20T00:31:45.949Z","dependency_job_id":null,"html_url":"https://github.com/MuffinKing-jpeg/wg-api-lib","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuffinKing-jpeg%2Fwg-api-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuffinKing-jpeg%2Fwg-api-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuffinKing-jpeg%2Fwg-api-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuffinKing-jpeg%2Fwg-api-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MuffinKing-jpeg","download_url":"https://codeload.github.com/MuffinKing-jpeg/wg-api-lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244544233,"owners_count":20469640,"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":["api","lib","library","wargaming","wargaming-api","worldoftanks","wot","wotb","wotblitz"],"created_at":"2024-11-25T07:42:47.602Z","updated_at":"2026-05-20T19:06:46.884Z","avatar_url":"https://github.com/MuffinKing-jpeg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WG-API-Lib\n\nAvailable on:\n\n[**EN**](https://muffinking-jpeg.github.io/wg-api-lib/) | [**UA**](https://muffinking-jpeg.github.io/wg-api-lib/readme-ua) | [**RU**](https://muffinking-jpeg.github.io/wg-api-lib/readme-ru)\n\n## Description\n\nThis is NodeJS package for easy work with Wargaming.net API.\nIn current version supports only World of Tanks and World of Tanks Blitz.\n\u003e **IMPORTANT!**  \n\u003e Starting from october 14th 2022 support for .ru (CIS earlier) will be deprecated.  \n\u003e This package do not support Lesta Games API (and probably will not)\n\n## Installing\n\nTo install package type in console:\n\n```sh\nnpm i @muffinking-jpeg/wg-api-lib\n```\n\n## Usage\n\n### Initialization\n\nTo start using package import this as ES6 module (No support for CommonJS. Let's move forward) and initialize object with your WG api key.\n\n```js\nimport { wgApi } from '@muffinking-jpeg/wg-api-lib';\n\n...\n\nconst api = new wgApi('Put your WG key here')\n```\n\nBest practice is to use environment variables or `.env` file to store api keys\n\nFile `.env`:\n\n```js\n...\nWG_API_KEY = \"YourApiKey\"\n...\n```\n\nYour code:\n\n```js\nimport * as dotenv from 'dotenv';\nimport { wgApi } from '@muffinking-jpeg/wg-api-lib';\n...\n\ndotenv.config();\n\nconst apiKey = process.env['WG_API_KEY']\nconst api = new wgApi(apiKey)\n...\n```\n\n### Methods\n\n#### .searchPlayer(paramsObject)\n\n\u003eFor searching players by name.\n\n| Params   |              Types              |        Meaning         |\n|--------- |-------------------------------- |------------------------|\n| game:    | 'wotb' \\| 'worldoftanks'        | Choosing the game      |\n| region:  | 'eu' \\|         'na' \\| 'asia'  | Choose region of game  |\n| query:   |             string              | Player's name          |\n\n#### .getPlayerData(paramsObject)\n\n\u003eFor loading player's statistics.\n\n| Params   |              Types              |        Meaning         |\n|--------- |-------------------------------- |:---------------------- |\n| game:    | 'wotb' \\| 'worldoftanks'        | Choosing the game      |\n| region:  | 'eu' \\|         'na' \\| 'asia'  | Choose region of game  |\n| id:      |             number              | Player's id            |\n\n#### .getPlayerAchievements(paramsObject)\n\n\u003eFor loading player's achievements.\n\n| Params   |              Types              |        Meaning         |\n|--------- |-------------------------------- |----------------------- |\n| game:    | 'wotb' \\| 'worldoftanks'        | Choosing the game      |\n| region:  | 'eu' \\|         'na' \\| 'asia'  | Choose region of game  |\n| id:      |             number              | Player's id            |\n\n### Examples\n\n#### How to get players list\n\n```js\napi.searchPlayer({\n    game: 'wotblitz',\n    query: 'Holly_Carbonara',\n    region: 'eu'\n  }).then(res =\u003e {\n    //Your response handler here\n  })\n```\n\n#### Get player's stats\n\n```js\napi.getPlayerData({\n    game: 'wotblitz',\n    id: 594863503,\n    region: 'eu'\n  }).then(res =\u003e {\n    //Your response handler here\n  })\n```\n\n#### Get player's achievements\n\n```js\napi.getPlayerAchievements({\n    game: 'wotblitz',\n    id: 594863503,\n    region: 'eu'\n  }).then(res =\u003e {\n    //Your response handler here\n  })\n```\n\n## TODO\n\n- Check for undef and\\or incorrect API key.\n- Expand methods availability for tanks\\ships.\n- Add WOWS and WOT Console support.\n- Implementing every feature from [Wargaming API reference](https://developers.wargaming.net/reference/all)\n- Better readme\n- ~~Translating readme to more languages~~\n\n## NEVER PLANED\n\n- Support for Lesta Games API\n- Support for wargaming authentication (Maybe it will be another module. This feature requires http server)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuffinking-jpeg%2Fwg-api-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuffinking-jpeg%2Fwg-api-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuffinking-jpeg%2Fwg-api-lib/lists"}