championgg-api
v1.0.2
Published
Node.js sdk library for calling the champion.gg api
Downloads
3
Readme
championgg-api
NodeJS client for the champion.gg api
Prerequisites
You'll need to get a Champion.GG API key from
http://api.champion.gg/
Installation and Initialization
npm install championgg-api
yarn add championgg-api
Then in your Node application
let api = require('championgg-api');
api.init({
apikey: <insert your api key here>
});
Exported Functions
init(options)
Needs to be called before the api can be utilized.
let option = {
apikey: <insert your api key here>,
dev: {
host : <host>,
user : <user>,
password : <password>,
database : <dbname>
},
clearCache: <true/false>,
})
dev
mode makes a connection to a sql database (specified in the argument). When requests are made to the api, the DB is first queried and stored requests are returned without making the network request. If the request is not in the database, the query is made and stored. Since results can expire / change, this allows a developer to fix their api input while building their application.
clearCache
empties out the database before making queries.
final()
Should be called as your app shuts itself down, cleans up module artifacts. (really just important for dev mode)
Champions
champions
As described here: http://api.champion.gg/docs/#api-Champions-GetChampions
matchups
As described here: http://api.champion.gg/docs/#api-Champions-GetMatchup
matchupsByChampId
As described here: http://api.champion.gg/docs/#api-Champions-GetMatchups
championsByChampId
As described here: http://api.champion.gg/docs/#api-Champions-GetChampion
General
general
As described here: http://api.champion.gg/docs/#api-General-GetGeneral
overall
As described here: http://api.champion.gg/docs/#api-General-GetOverall