trn-rocket-league
is an easy-to-use and typed library that allows you to fetch data from a Rocket League profile.
You need some help? Contact me: linktr.ee/pannh.
- Installation
npm install trn-rocket-league
- Fetch a profile
const { fetchProfile } = require('trn-rocket-league');
const profile = await fetchProfile('PannH.', 'epic');
// Returns a Profile instance (see documentation)
- Fetch sessions
const { fetchSessions } = require('trn-rocket-league');
const sessions = await fetchSessions('PannH.', 'epic');
// Returns an array of Session instances (see documentation)
The fetchProfile()
function returns an instance of Profile
which can be represented as :
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 :
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