npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

splinterlands-web-api

v1.0.11

Published

Package for the Splinterlands API. Includes common API calls as well as easily creating image urls to cards.

Downloads

29

Readme

Splinterlands Web API

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 Package

Installing

npm i splinterlands-web-api

Documentation

API calls

These are the current api calls that are supported.

Splinterlands

  • getSettings()
    • https://api2.splinterlands.com/settings

Player

  • getPlayerQuest(username)
    • https://api2.splinterlands.com/players/quests?username=bubke
  • getPlayerDetails(username)
    • https://api2.splinterlands.com/players/details?name=bubke
  • getPlayerCollectionCards(username)
    • https://api2.splinterlands.com/cards/collection/bubke

Cards

  • getAllCardDetails()
    • https://api2.splinterlands.com/cards/get_details
  • getCardDetailsFromUid([cardId1, cardId2])
    • https://api2.splinterlands.com/cards/find?ids=C4-159-5PENLDCX68,C7-401-KHC7OS88PS

Battle

  • getPlayerBattles(username, /*optional*/ format)
    • https://api2.splinterlands.com/battle/history?player=bubke
  • getSingleBattle(battleId)
    • https://api2.splinterlands.com/battle/result?id=sm_gyjLSvXAUyhWfBhJOymA
  • getOutstandingMatch(username, accessToken)
    • https://api2.splinterlands.com/players/outstanding_match?username=bubke&token=accessToken

Market

Rental

  • getForRentCardSummary()
    • https://api2.splinterlands.com/market/for_rent_grouped
  • getForRentByCard(cardId, edition, isGold)
    • https://api2.splinterlands.com/market/for_rent_by_card?card_detail_id=205&gold=false&edition=2
  • getActiveRentals(username)
    • https://api2.splinterlands.com/market/active_rentals?owner=bubke

For Sale

  • getForSaleGrouped()
    • https://api2.splinterlands.com/market/for_sale_grouped
  • getForSaleByCard(cardId, edition, isGold)
    • https://api2.splinterlands.com/market/for_sale_by_card?card_detail_id=334&gold=false&edition=3

Images

Current images urls that can be requested are

Card

Base card

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

Base Image

To request the gold foil alpha version

  • getCardImageBaseById(cardId, /* isGold */ true, /* edition */ 0)

Gold foil alpha Image

Detailed card

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 Level 5 Spineback turtle

To request the gold foil alpha version

  • getCardImageLevelById(/* cardId */ 13, /* level */ 5, /* isGold */ true, /* edition */ 0)

Gold 5 Spineback turtle

Ability

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

Tank heal ability

Ruleset

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

Back to basics ruleset