Web package for the Splinterlands API.
Has common API calls and simple methods to obtain images from Splinterlands, such as cards, rulesets, and abilities.
npm i splinterlands-web-api
These are the current api calls that are supported.
getSettings()
getPlayerQuest(username)
getPlayerDetails(username)
getPlayerCollectionCards(username)
getAllCardDetails()
getCardDetailsFromUid([cardId1, cardId2])
getPlayerBattles(username, /*optional*/ format)
getSingleBattle(battleId)
getOutstandingMatch(username, accessToken)
getForRentCardSummary()
getForRentByCard(cardId, edition, isGold)
getActiveRentals(username)
getForSaleGrouped()
getForSaleByCard(cardId, edition, isGold)
Current images urls that can be requested are
A base card url which has no stats can be requested as follows
getCardImageBaseById(cardId, /* optional */ isGold, /* optional */ edition)
If isGold is not specified, the card will be standard foil. If edition is not specified, the image returned will be the latest edition. For Example getCardImageBaseById(/* cardId */ 13)
would return
To request the gold foil alpha version
getCardImageBaseById(cardId, /* isGold */ true, /* edition */ 0)
A detailed card url which includes stats at each level can be requested as such
getCardImageLevelById(cardId, level, /* optional */ isGold, /* optional */ edition)
Again, if the optional parameters are not provided, the card will latest edition and standard foil.
For example getCardImageLevelById(/* cardId */ 13, /* level */ 5)
will return
To request the gold foil alpha version
getCardImageLevelById(/* cardId */ 13, /* level */ 5, /* isGold */ true, /* edition */ 0)
You can request an ability image in two ways, using the ABILITY_IMAGE
object, or calling getAbilityImage(abilityName)
For example both
ABILITY_IMAGE.TANK_HEAL
getAbilityImage('Tank Heal')
Will return
You can request rulesets in two ways, using the RULESET_IMAGE
object, or calling getRulesetImage(rulesetName)
For example both
RULESET_IMAGE.BACK_TO_BASICS
getRulesetImage('Back to Basics')
Will return