{"_id":"@arbakti_store/freefire-api","name":"@arbakti_store/freefire-api","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.5":{"name":"@arbakti_store/freefire-api","version":"1.0.5","description":"A powerful Node.js library to interact with Garena Free Fire API using Protobuf. Login, Search Players, and get Profile Stats.","main":"index.js","scripts":{"test":"node test/search.js","test:login":"node test/login.js","test:search":"node test/search.js","test:profile":"node test/profile.js","test:stats":"node test/stats.js","test:items":"node test/items.js","test:all":"node test/all.js"},"keywords":["freefire","checker","game-api","player-stats","ff","freefire-api","garena-freefire","player-info","stats-checker","game-data","sdk","wrapper","nodejs","javascript"],"author":{"name":"Arbakti"},"license":"GPL-3.0","repository":{"type":"git","url":"git+https://github.com/ARBAKTI/freefire-api.git"},"bugs":{"url":"https://github.com/ARBAKTI/freefire-api/issues"},"homepage":"https://github.com/ARBAKTI/freefire-api#readme","dependencies":{"axios":"^1.6.0","protobufjs":"^7.2.0"},"_id":"@arbakti_store/freefire-api@1.0.5","gitHead":"dc5efdee3d450097d1d11c992d4c88fa72a3bdba","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-lT5Tu14IvdUz32QxM2WIHZ5bQNOlzIsHQz175hdIilpdebRVDXMtDJ+xlBJQKlbJErlbcMLKFEJDLBOmYLRttA==","shasum":"8037e144b690adf5d985985735ef75c18144e334","tarball":"https://registry.npmjs.org/@arbakti_store/freefire-api/-/freefire-api-1.0.5.tgz","fileCount":25,"unpackedSize":6727988,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICdsrvDW3ddGogcW1qqSAMNGHuqvFERCgEDS+laYnf+dAiEAhbQf7ShStnQfHt5HX2hrmKEWjr0ZSvLLClfMBxh1Aco="}]},"_npmUser":{"name":"arbakti_store","email":"arbaktistore@gmail.com"},"directories":{},"maintainers":[{"name":"arbakti_store","email":"arbaktistore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/freefire-api_1.0.5_1772284200411_0.887195733221563"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-28T13:10:00.316Z","1.0.5":"2026-02-28T13:10:00.656Z","modified":"2026-02-28T13:10:00.879Z"},"maintainers":[{"name":"arbakti_store","email":"arbaktistore@gmail.com"}],"description":"A powerful Node.js library to interact with Garena Free Fire API using Protobuf. Login, Search Players, and get Profile Stats.","homepage":"https://github.com/ARBAKTI/freefire-api#readme","keywords":["freefire","checker","game-api","player-stats","ff","freefire-api","garena-freefire","player-info","stats-checker","game-data","sdk","wrapper","nodejs","javascript"],"repository":{"type":"git","url":"git+https://github.com/ARBAKTI/freefire-api.git"},"author":{"name":"Arbakti"},"bugs":{"url":"https://github.com/ARBAKTI/freefire-api/issues"},"license":"GPL-3.0","readme":"<div align=\"center\">\r\n  <img src=\"https://raw.githubusercontent.com/ARBAKTI/freefire-api/refs/heads/main/public/logo.png\" width=\"120\" alt=\"Free Fire Logo\" />\r\n</div>\r\n\r\n# Free Fire API\r\n\r\nA Node.js library to interact with Free Fire endpoints using Protobuf.\r\n\r\n## Disclaimer\r\nThis project is **unofficial** and is not affiliated with Garena.\r\n\r\n## Features\r\n- Login and session management\r\n- Search account by nickname\r\n- Get player profile\r\n- Get BR/CS stats\r\n- Get equipped player items\r\n- YAML-based configuration\r\n\r\n## Installation\r\n```bash\r\nnpm install @arbakti_store/freefire-api\r\n```\r\n\r\n## Requirements\r\n- Node.js 14+\r\n\r\n## Quick Start\r\n```js\r\nconst FreeFireAPI = require('@arbakti_store/freefire-api');\r\n\r\nasync function main() {\r\n  const api = new FreeFireAPI();\r\n\r\n  // Auto login via config/credentials.yaml\r\n  const players = await api.searchAccount('Spin');\r\n  console.log(players);\r\n}\r\n\r\nmain().catch(console.error);\r\n```\r\n\r\n## Configuration (Optional)\r\n\r\n### 1. Credentials (`config/credentials.yaml`)\r\nUsed when calling `login()` without parameters.\r\n\r\n```yaml\r\nUID: \"YOUR_UID\"\r\nPASSWORD: \"YOUR_PASSWORD\"\r\n```\r\n\r\n### 2. Core Settings (`config/settings.yaml`)\r\nPrimary source for internal constants: `AE`, `HEADERS`, `URLS`, `GARENA_CLIENT`.\r\n\r\n```yaml\r\nHEADERS_COMMON_RELEASE_VERSION: \"OB52\"\r\nURL_MAJOR_LOGIN: \"https://loginbp.ggblueshark.com/MajorLogin\"\r\n```\r\n\r\n## API Reference\r\n\r\n### `new FreeFireAPI()`\r\nCreates a new API client instance.\r\n\r\n### `api.login(uid?, password?)`\r\nOptional account authentication (not required).\r\n\r\n```js\r\nawait api.login('YOUR_UID', 'YOUR_PASSWORD');\r\n```\r\n\r\nUse this only if you want to login manually.  \r\nDefault provider credentials are already available, so calling `login()` is optional.\r\n\r\nIf parameters are omitted, the library reads credentials from `config/credentials.yaml`.\r\n\r\n### `api.searchAccount(keyword)`\r\nSearches accounts by nickname.\r\n\r\n```js\r\nconst results = await api.searchAccount('Spin');\r\n```\r\n\r\n### `api.getPlayerProfile(uid)`\r\nFetches detailed player profile information.\r\n\r\n```js\r\nconst profile = await api.getPlayerProfile('16207002');\r\n```\r\n\r\n### `api.getPlayerStats(uid, mode, matchType)`\r\nFetches player statistics.\r\n\r\n- `mode`: `br` | `cs`\r\n- `matchType`: `career` | `ranked` | `normal`\r\n\r\n```js\r\nconst brCareer = await api.getPlayerStats('16207002', 'br', 'career');\r\nconst csRanked = await api.getPlayerStats('16207002', 'cs', 'ranked');\r\n```\r\n\r\n### `api.getPlayerItems(uid)`\r\nFetches currently equipped player items.\r\n\r\n```js\r\nconst items = await api.getPlayerItems('16207002');\r\nconsole.log(items);\r\n```\r\n\r\nSample response:\r\n```json\r\n{\r\n  \"basic_info\": {\r\n    \"accountid\": \"16207002\",\r\n    \"nickname\": \"Spin\",\r\n    \"level\": 74,\r\n    \"region\": \"ID\"\r\n  },\r\n  \"items\": {\r\n    \"outfit\": [{ \"id\": 101001, \"name\": \"Skull Mask\" }],\r\n    \"weapons\": {\r\n      \"shown_skins\": [{ \"id\": 907001, \"name\": \"AK47 - Blue Flame\" }]\r\n    },\r\n    \"skills\": {\r\n      \"equipped\": [{ \"id\": 123, \"name\": \"Alok: Drop the Beat\" }]\r\n    },\r\n    \"pet\": {\r\n      \"name\": \"Falco\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## Error Handling\r\nUse `try/catch` for all async calls.\r\n\r\n```js\r\ntry {\r\n  const profile = await api.getPlayerProfile('16207002');\r\n  console.log(profile);\r\n} catch (err) {\r\n  console.error('API error:', err.message);\r\n}\r\n```\r\n\r\n## Testing\r\n```bash\r\nnpm test\r\nnpm run test:login\r\nnpm run test:search\r\nnpm run test:profile\r\nnpm run test:stats\r\nnpm run test:items\r\nnpm run test:all\r\n```\r\n\r\n### Full Test Output Example\r\nThe following is a complete, readable example from `npm run test:all`:\r\n\r\n```text\r\nRunning all tests sequentially...\r\n\r\n-------------- login.js:\r\nLoaded 27989 items into database.\r\nStarting Login Test...\r\n[i] No credentials provided, loading from config/credentials.yaml.\r\nLogin success!\r\nToken: eyJhbGciOiJIUzI1NiIs...\r\nOpenID: ee3fa75646052bbf713d9f7f3e0a5c81\r\n\r\n-------------- search.js:\r\nLoaded 27989 items into database.\r\nStarting Search Test for 'folaa'...\r\n[i] No credentials provided, loading from config/credentials.yaml.\r\nFound 10 players.\r\nTop Result: Folaa (UID: 16778836)\r\n[1] Folaa - UID: 16778836 - LVL: 3\r\n[2] FolAa_66 - UID: 1943283579 - LVL: 46\r\n[3] Folaa_golgem - UID: 14576052221 - LVL: 6\r\n[4] folaa_ji - UID: 9436868269 - LVL: 7\r\n[5] Folaa- - UID: 2357144535 - LVL: 1\r\n[6] FOLAA-khna9 - UID: 2359319137 - LVL: 1\r\n[7] Folaa! - UID: 8638700824 - LVL: 7\r\n[8] folaa!! - UID: 8341924255 - LVL: 17\r\n[9] folaa..... - UID: 6973843243 - LVL: 2\r\n[10] folaa***** - UID: 5824293752 - LVL: 5\r\n\r\n-------------- profile.js:\r\nLoaded 27989 items into database.\r\nStarting Profile Test for UID: 12345678...\r\n[i] No credentials provided, loading from config/credentials.yaml.\r\n\r\n--- Basic Info ---\r\nNickname: FB:ㅤ@GMRemyX\r\nLevel: 68\r\nEXP: 2327466\r\nRegion: SG\r\nLikes: 3682188\r\nCreated At: 12/7/2017, 5:19:29 AM\r\nLast Login: 2/19/2026, 6:02:53 PM\r\n\r\n--- Pet Info ---\r\nPet Name: SiNo\r\nPet Level: 7\r\n\r\n-------------- stats.js:\r\nLoaded 27989 items into database.\r\nStarting Stats Test for UID: 16207002...\r\nFetching BR Career...\r\n[i] No credentials provided, loading from config/credentials.yaml.\r\n\r\n--- BR Career ---\r\nSolo: {\"accountid\":\"16207002\",\"gamesplayed\":1055,\"wins\":88,\"kills\":2769,\"detailedstats\":{\"deaths\":967,\"top10times\":0,\"topntimes\":279,\"distancetravelled\":3224879,\"survivaltime\":458396,\"revives\":0,\"highestkills\":20,\"damage\":812652,\"roadkills\":47,\"headshots\":1453,\"headshotkills\":630,\"knockdown\":0,\"pickups\":58619}}\r\nDuo: {\"accountid\":\"16207002\",\"gamesplayed\":461,\"wins\":80,\"kills\":1383,\"detailedstats\":{\"deaths\":381,\"top10times\":0,\"topntimes\":144,\"distancetravelled\":1544324,\"survivaltime\":217132,\"revives\":98,\"highestkills\":22,\"damage\":487692,\"roadkills\":48,\"headshots\":960,\"headshotkills\":367,\"knockdown\":1320,\"pickups\":32130}}\r\nSquad: {\"accountid\":\"16207002\",\"gamesplayed\":6451,\"wins\":1225,\"kills\":16041,\"detailedstats\":{\"deaths\":5226,\"top10times\":0,\"topntimes\":2059,\"distancetravelled\":26527594,\"survivaltime\":3204309,\"revives\":1305,\"highestkills\":34,\"damage\":7241365,\"roadkills\":122,\"headshots\":12622,\"headshotkills\":3899,\"knockdown\":17564,\"pickups\":586395}}\r\nFetching BR Ranked...\r\n\r\n--- BR Ranked ---\r\nSolo: {\"accountid\":\"16207002\",\"gamesplayed\":4,\"wins\":1,\"kills\":25,\"detailedstats\":{\"deaths\":3,\"top10times\":0,\"topntimes\":3,\"distancetravelled\":13591,\"survivaltime\":1857,\"revives\":0,\"highestkills\":15,\"damage\":6317,\"roadkills\":0,\"headshots\":19,\"headshotkills\":8,\"knockdown\":0,\"pickups\":483}}\r\nDuo: {\"accountid\":\"16207002\",\"gamesplayed\":3,\"wins\":1,\"kills\":8,\"detailedstats\":{\"deaths\":2,\"top10times\":0,\"topntimes\":2,\"distancetravelled\":14501,\"survivaltime\":1607,\"revives\":3,\"highestkills\":4,\"damage\":2561,\"roadkills\":0,\"headshots\":2,\"headshotkills\":0,\"knockdown\":10,\"pickups\":383}}\r\nSquad: {\"accountid\":\"16207002\",\"gamesplayed\":548,\"wins\":50,\"kills\":1520,\"detailedstats\":{\"deaths\":498,\"top10times\":0,\"topntimes\":74,\"distancetravelled\":1859691,\"survivaltime\":169414,\"revives\":57,\"highestkills\":21,\"damage\":672006,\"roadkills\":0,\"headshots\":1287,\"headshotkills\":392,\"knockdown\":1741,\"pickups\":47692}}\r\nFetching CS Career...\r\n\r\n--- CS Career ---\r\nData: {\r\n  \"csstats\": {\r\n    \"accountid\": \"16207002\",\r\n    \"gamesplayed\": 3102,\r\n    \"wins\": 1788,\r\n    \"kills\": 12555\r\n  }\r\n}\r\nFetching CS Ranked...\r\n\r\n--- CS Ranked ---\r\nData: {\r\n  \"csstats\": {\r\n    \"accountid\": \"16207002\",\r\n    \"gamesplayed\": 56,\r\n    \"wins\": 30,\r\n    \"kills\": 196\r\n  }\r\n}\r\n\r\n-------------- items.js:\r\nLoaded 27989 items into database.\r\nStarting Items Test for UID: 12345678...\r\nGetting Player Items...\r\n[i] No credentials provided, loading from config/credentials.yaml.\r\n\r\n--- Summary ---\r\nNickname: FB:ㅤ@GMRemyX\r\nUID: 12345678\r\nOutfit Items: 1\r\nWeapon Items: 0\r\nSkills Equipped: 6\r\nSkills: 211000028, 214049006, 205000805, 211043045, 203038045, 204041011\r\nPet Name: SiNo\r\nPet ID: Poring\r\n\r\n--- First 5 Outfits ---\r\n- Unknown Item (ID: 50)\r\n\r\nAll tests passed successfully!\r\n```\r\n\r\n## Project Structure\r\n- `lib/api.js`: core API client\r\n- `lib/protobuf.js`: protobuf encode/decode\r\n- `lib/crypto.js`: AES encryption\r\n- `lib/utils.js`: item processing utilities\r\n- `config/settings.yaml`: core settings\r\n- `config/credentials.yaml`: default login credentials\r\n- `proto/`: protobuf schema files\r\n- `data/items.json`: item data source\r\n\r\n## Metadata\r\n- npm: `@arbakti_store/freefire-api`\r\n- repository: `https://github.com/ARBAKTI/freefire-api`\r\n- license: GPL-3.0\r\n\r\n## Acknowledgements\r\nWe perform this work standing on the shoulders of giants. Special thanks to the open-source community for their Reverse Engineering efforts.\r\n\r\n- `0xMe/FreeFire-Api`: Prior research established a Python-based workflow. This project converts that logic into an easy-to-use JavaScript implementation, with equivalent functionality.\r\n\r\n## License\r\nGNU General Public License v3.0\r\n","readmeFilename":"README.md","_rev":"1-47dd326f63a1df5873b037419f46e12d"}