
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
riot-games-api-nodejs
Advanced tools
This module is no longer maintained. Pull requests will still be accepted.
Access all information that Riot provides using thier API. This is an extremly simple node module that allows you to gather information from Riot.
Please refer to the Riot Games Official API. Also, please note that when an update occures to a specific API that you are using, it will most likely break. If this happens, please report it on the github repo.
riot.champion.id(
'21',
{},
function(err, data) {
if (err instanceof Error) {
console.log("Error 1: " + err);
return 0;
}
else {
var rankedEnabled = data.rankedPlayEnabled;
if (rankedEnabled == true){
console.log('Champion 21 (Miss Fortune) can be played in ranked');
} else {
console.log('Champion 21 (Miss Fortune) can not be played in ranked');
}
}
}
)
The npm release is always the recent stable version.
npm install riot-games-api-nodejs
var riot = require('riot-games-api-nodejs')
The code on Github is the most recent version, but may be untested.
git clone https://github.com/hardtacos/riot-games-api-nodejs
cd riot-games-api-nodejs
npm install
var riot = require('/path/to/riot-games-api-nodejs')
// load the module
var riot = require('riot-games-api-nodejs')
// search by summoner id, their league information
riot.leaugue.bySummoner( "123456", {}, console.log)
httpProtocol (string)Which HTTP protocol to use: http (default) or https
timeout (integer)Destroy the request after this number of milliseconds. Default: 30000 (30 sec).
developerKey (string)var riot = require('riot-games-api-nodejs')
riot.developerKey = '1234578-1234-1234-123456789000'
riot.static.champions( {}, cb );
Each method takes a callback function as last parameter. When everything seems alright err
is null, otherwise err will be instanceof Error for tracing.
function( err, data ) {
if( err instanceof Error ) {
console.log( err )
} else {
console.log( data )
}
}
Properties:
err.message : the error message
err.stack : stack trace
err.origin : what it relates to (api, method, request)
err.details : api response or other information when available, or `null`
Messages:
Error: invalid response api API response can't be parsed
Error: not json api Expected JSON, received something else
Error: not found method Requested data was not found
Error: not allowed method No permission to requested data
Error: invalid id method Requested video ID is invalid
Error: connection closed api Connection dropped early
Error: connection error request Can't connect to API
Error: request timeout request The request took too long to connect or process
Error: error api API returned an error, see err.details
Error: developer key missing api developerKey is not set, see Configuration.
===========================================================================================
riot.champion.all(
{
'freeToPlay': 'true'
},
console.log
);
riot.champion.id(
"21", {},
console.log
)
===========================================================================================
riot.game.bySummoner(
"5908", {},
console.log
)
===========================================================================================
Retrieve league information for both individuals and teams
riot.league.bySummoner(
"5908", {},
console.log
);
riot.league.bySummonerEntry(
"5908, xxxxx", {},
console.log
);
riot.league.byTeam(
"TEAM-c80824c9-c568-42de-bdbb-271543b209e1", {},
console.log
);
riot.league.byTeamEntry(
"TEAM-c80824c9-c568-42de-bdbb-271543b209e1, xxxxx", {},
console.log
);
riot.league.challenger(
{
type : 'RANKED_SOLO_5X5'
},
console.log
);
===========================================================================================
Retrieve static information about League of Legends (i.e. champions, runes, masteries, items, etc...)
riot.staticData.champions(
{},
console.log
);
riot.staticData.championsId(
"21",
{},
console.log
);
riot.staticData.item(
{
itemData : 'name, description'
},
console.log
);
riot.staticData.itemId(
'3454',
{
itemData : 'stats'
},
console.log
);
===========================================================================================
Retrieve server statuses
riot.lolStatus(console.log).shards();
riot.lolStatus(console.log).region(settings.region);
===========================================================================================
riot.match.match(
"5908",
{},
console.log
)
Retrieve match by match ID.
===========================================================================================
riot.matchHistory.matchHistory(
"5908",
{},
console.log
)
Retrieve match history by match ID.
===========================================================================================
riot.stats.ranked(
"5908",
{
season : 'SEASON4'
},
console.log
);
riot.stats.summary(
"5908",
{
season : 'SEASON4'
},
console.log
)
Retrieve stats by summoner ID.
===========================================================================================
riot.summoner.byName(
'Dyrus', //or 'Dyrus,I DIED TO WOLVES,InsertSmurfHere'
{},
console.log
);
riot.summoner.summonerIds(
'5908' //or '5908,52322873,44979373'
{},
console.log
);
riot.summoner.masteries(
'5908' //or '5908,52322873,44979373'
{},
console.log
);
riot.summoner.name(
'5908' //or '5908,52322873,44979373'
{},
console.log
);
riot.summoner.runes(
'5908' //or '5908,52322873,44979373'
{},
console.log
);
Retrieve summoner information by summoner name or summonerID.
===========================================================================================
riot.team.bySummonerId(
'5908',
{},
console.log
);
riot.team.teamId(
'TEAM-c80824c9-c568-42de-bdbb-271543b209e1', //or multiple teams, separated by commas
{},
console.log
);
Retrieve teams information by either summonerId or teamID
===========================================================================================
Directly talk to the API. This function takes care of connecting and calling the callback only when valid JSON is returned.
Param Type Description
---------- -------- ----------------------------------------------------
path string full method path without leading slash
fields object GET parameters
callback function callback function to receive results
FAQs
Access Riot Games API with ease.
We found that riot-games-api-nodejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.