mika-ffstalk
Version:
A modern CLI and TypeScript library to inspect Free Fire player accounts using public API data.
191 lines (141 loc) โข 3.58 kB
Markdown
# ๐ FreeFire Stalker




> A blazing-fast, fully typed, and CLI-ready toolkit to fetch and inspect **Garena Free Fire** player profiles using public community APIs.
> Designed for **Node.js**, **TypeScript**, and modern development workflows.
<p align="center">
<img src="https://files.catbox.moe/md4zwm.jpeg" alt="Free Fire Banner" width="600" />
</p>
## โจ Features
- ๐ง **TypeScript-first** with full typings
- โก๏ธ Supports **ESM**, **CJS**, and **CLI**
- ๐ Fetches detailed **player metadata**, **pet**, **profile**, and **credit score**
- ๐ท Built-in URLs for **banner** and **outfit** images
- ๐งช Battle-tested with **Vitest**
- ๐ก Ideal for: bots, dashboards, analytics, gamer tools
## ๐ฆ Installation
```bash
# Using npm
npm install mika-ffstalk
# Or using yarn
yarn add mika-ffstalk
```
## ๐ Programmatic Usage
```ts
import { fetchFreeFireAccountDetails } from "mika-ffstalk";
(async () => {
const data = await fetchFreeFireAccountDetails("470699855");
console.log(data.metadata.nickname); // e.g., "Mika ST"
})();
```
## ๐ง CLI Usage
```bash
npx mika-ffstalk 470699855
# or
npm link
mika-stalk 470699855
```
Optional flags:
```bash
--json # Output raw JSON
--table # Output in table format
```
Example:
```bash
npx mika-ffstalk 470699855 --table
```
## ๐ Output Format (Simplified)
```ts
type FreeFireAccountData = {
metadata: {
nickname: string;
accountId: string;
region: string;
level: string;
rank: string;
exp: string;
lastLoginAt: string;
diamondCost: string;
};
pet: {
name: string;
level: string;
exp: string;
};
profile: {
avatarId: string;
clothes: string[];
equippedSkills: string[];
};
social: {
battleTags: { tag: string; count: number }[];
language: string;
signature: string;
};
credit: {
score: string;
rewardState: string;
};
assets: {
bannerImageUrl: string;
outfitImageUrl: string;
};
};
```
## ๐งพ Sample Output
```json
{
"metadata": {
"nickname": "PontaSensei",
"accountId": "470699855",
"region": "ID",
"level": "57",
"rank": "Diamond IV"
},
"assets": {
"bannerImageUrl": "https://discordbot.freefirecommunity.com/banner_image_api?uid=470699855®ion=id",
"outfitImageUrl": "https://discordbot.freefirecommunity.com/outfit_image_api?uid=470699855®ion=id"
}
}
```
## ๐ API Reference
### `fetchFreeFireAccountDetails(uid: string): Promise<FreeFireAccountData>`
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ---------------------------- |
| `uid` | string | โ
| The Free Fire UID to inspect |
Returns a structured object with all account details, suitable for UIs or APIs.
## ๐ผ๏ธ UI-Ready Assets
- โ
`bannerImageUrl`
- โ
`outfitImageUrl`
Embed them directly into dashboards or profile cards.
## ๐งโ๐ป Local Development
Clone and install:
```bash
git clone https://github.com/MikaYelovich/mika-ffstalk
cd mika-ffstalk
npm install
npm run dev
```
Run tests:
```bash
npm run test
```
## ๐ค Contributing
Contributions are welcome!
If you'd like to fix a bug or add a feature, please open an issue or submit a PR.
## ๐ License
MIT ยฉ 2025 Mika Yelovich