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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tl3n/steam-api-wrapper

v1.0.0

Published

Steam API wrapper with TypeScript support.

Readme

@tl3n/steam-api-wrapper

A simple wrapper for Steam Web API with support of TypeScript types.

Installation

# Using npm
npm install @tl3n/steam-api-wrapper

Getting Started

Before proceeding further, make sure that you have obtained Steam Web API key. More information can be found here.

Let's start with an example. Imagine, that you need to obtain news posts for Team Fortress 2, or your hamster will die tomorrow. Don't panic! It's really easy to do:

import { SteamClient, SteamNewsService } from "@tl3n/steam-api-wrapper";

// Create a new Steam client with your API key.
const steamClient = new SteamClient("YOUR_API_KEY_HERE");

// Create news service with your steamClient.
const newsService = new SteamNewsSerivce(steamClient);

// And now, all we need to do is to call our method.
const news = await newsService.GetNewsForApp({ appid: 440 });

And voilà! Your hamster will live another day.

{
  appnews: {
    appid: 440,
    newsitems: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object]
    ],
    count: 3687
  }
}

Documentation

This package provides functionality described here. So, if the following section doesn't supply your needs, feel free to follow the link.

SteamClient

Responsible for communication with Steam API. Remember to pass your API key!

const steamClient = new SteamClient("YOUR_API_KEY");

// Send request to Steam Web API URL with specified params
const response = await steamClient.get<T>("API URL", params);

SteamNewsService

Wrapper for ISteamNews interface.

const newsService = new SteamNewsService(steamClient);

// Get news for specified appid.
const news = await newsService.GetNewsForApp({
  appid: 440,
  count: 3,
  maxlength: 300,
});

SteamUserStatsService

Wrapper for ISteamUserStats interface.

const userStatsService = new SteamUserStatsService(steamClient);

// Get global achievements overview of a specific game in percentages.
const achievementPercentages =
  await userStatsService.GetGlobalAchievementPercentagesForApp({ gameid: 440 });

// Get list of user's achievements for by appid.
const playerAchievements = await userStatsService.GetPlayerAchievements({
  steamid: "76561197972495328",
  appid: 440,
});

// Get list of user's stats by appid.
const userStats = await userStatsService.GetUserStatsForGame({
  steamid: "76561197972495328",
  appid: 440,
});

SteamUserService

Wrapper for ISteamUser interface.

const userService = new SteamUserService(steamClient);

// Get basic profile information for a list of 64-bit Steam IDs.
const playerSummaries = await userService.GetPlayerSummaries({
  steamids: "76561197960435530",
});

// Get a list of user's friends, provided their Steam Community profile is set to "Public".
const friendList = await userService.GetFriendList({
  steamid: "76561197960435530",
  relationship: "friend",
});

SteamPlayerService

Wrapper for ISteamPlayer interface.

const playerService = new SteamPlayerService(steamClient);

// Get a list of games player owns along with some playtime information, if profile is public.
const ownedGames = await playerService.GetOwnedGames({
  steamid: "76561197960434622",
});

// Get a list of games that player has played in the last two weeks.
const recentlyPlayedGames = await playerService.GetRecentlyPlayedGames({
  steamid: "76561197960434622",
});