https://github.com/pannh/trn-rocket-league
Track any Rocket League player's stats with the Tracker Network API.
https://github.com/pannh/trn-rocket-league
api npm rocket-league rocketleague trn
Last synced: 3 months ago
JSON representation
Track any Rocket League player's stats with the Tracker Network API.
- Host: GitHub
- URL: https://github.com/pannh/trn-rocket-league
- Owner: PannH
- License: mit
- Created: 2023-02-26T00:48:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-03T18:45:16.000Z (about 2 years ago)
- Last Synced: 2025-02-16T23:33:52.354Z (3 months ago)
- Topics: api, npm, rocket-league, rocketleague, trn
- Homepage: https://www.npmjs.com/package/trn-rocket-league
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
 
# 🚗 TRN Rocket League
> `trn-rocket-league` is an easy-to-use and typed library that allows you to fetch data from a Rocket League profile.# ☎️ Support
> You need some help? Contact me: [linktr.ee/pannh](https://linktr.ee/pannh).# 🔰 Getting Started
1. Installation
```bash
npm install trn-rocket-league
```2. Fetch a profile
```js
const { fetchProfile } = require('trn-rocket-league');const profile = await fetchProfile('PannH.', 'epic');
// Returns a Profile instance (see documentation)
```3. Fetch sessions
```js
const { fetchSessions } = require('trn-rocket-league');const sessions = await fetchSessions('PannH.', 'epic');
// Returns an array of Session instances (see documentation)
```# 📖 Documentation
The `fetchProfile()` function returns an instance of `Profile` which can be represented as :
```js
Profile {
platform: 'psn' | 'xbl' | 'steam' | 'epic' | 'switch';
username: string;
avatarURL: string | null;
countryCode: string;
linkedAccounts: {
platform: string;
username: string;
}[];
stats: {
overview: {
assists: number;
goals: number;
goalShotRatio: number;
mvps: number;
saves: number;
shots: number;
wins: number;
seasonRank: {
name: string;
index: number;
imageURL: string;
}
};
ranked: {
duel: {
rank: {
tier: {
index: number;
name: string;
};
division: {
index: number;
name: string;
};
imageURL: string;
};
matchesPlayed: number;
winStreak: number;
loseStreak: number;
mmr: number;
};
double: {...}; // same as above
standard: {...}; // same as above
};
extra: {
dropshot: {...}; // same as above
hoops: {...}; // same as above
rumble: {...}; // same as above
snowday: {...}; // same as above
};
unranked: {...}; // same as above
totalMatchesPlayed: number;
}
}
```
Example: https://sourceb.in/qBXXqD2cgi---
The `fetchSessions()` function returns an array of instances of `Session` which can be represented as :
```js
Session {
matches: {
id: string;
isGrouped: boolean;
date: Date;
playlist: string;
stats: {
rank: {
tier: {
name: string;
index: number;
};
division: {
name: string;
index: number;
};
oldMMR: number;
newMMR: number;
mmrDelta: number;
imageURL: string;
};
saves: number;
assists: number;
goals: number;
matchesPlayed: number;
mvps: number;
shots: number;
wins: number;
}
}[]
}
```
Example: https://sourceb.in/wcaesZzb4P