1.0.5 • Published 4 years ago
retroachievmentsapijs v1.0.5
RetroAchievements Javascript API module
This is a module to access RetroAchievements API easly with javascript. The API has 0 dependencies only vanilla javascript.
Usage
Import module into your file:
const raApi = require('retroachievmentsapijs');
Authentication to the RetroAchievements site must be done so you should first create an account so you can user your user and api key.
If you already have an account or have done the above step you need to authenticate:
const user = 'username'; // get your username from retroachivements.org
const apiKey = 'yourApiKey'; // get your api key from retroachivements.org profile page
const raApi = new RaApi(user,apiKey); // initialize the module
Once the module has been initialzied you can easly use it by calling the require api call function. Each function is a promise function and it can be called like:
// Get top ten users from [RetroAchievements](retroachievements.org)
raApi.getTopTenUsers().then((users)=>{
console.log(users);
})
Avaiabale api endpoints
Below is a table representing each method available, example of return response and what it does.