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

steamstash

v2.0.0

Published

steamstash

Readme

SteamStash

A powerful, lightweight library for interacting with Steam Community and Store data.

Features

  • Fetch user profiles, mini profiles, and friends lists
  • Get Steam group information and members
  • Check app details from the Steam store
  • Proxy support for all requests
  • Configurable timeout handling

Installation

bun add steamstash

Or using npm:

npm install steamstash

Basic Usage

import steamAPI from "steamstash";

// Get a user's profile data
const profile = await steamAPI.getProfileData("76561198028121353");
console.log(`User name: ${profile.name}, Level: ${profile.level}`);

// Get a user's friends list
const friends = await steamAPI.getFriendsList("76561198028121353");
console.log(`User has ${friends.length} friends`);

Advanced Configuration

import { SteamAPI } from "steamstash";

// Create a custom instance with advanced options
const customAPI = new SteamAPI({
  timeout: 5000, // 5 second timeout
  httpProxy: "1.2.3.4:8080", // Use proxy for requests
});

// Use the custom instance
const profile = await customAPI.getProfileData("76561198028121353");

API Reference

User Data

getMiniProfileData(steamid64: string): Promise<SteamMiniProfile>

Fetches mini profile data for a Steam user.

const miniProfile = await steamAPI.getMiniProfileData("76561198028121353");
console.log(miniProfile.persona_name);

getFriendsList(steamid64: string): Promise<SteamFriend[]>

Fetches friend list data for a Steam user.

const friends = await steamAPI.getFriendsList("76561198028121353");
friends.forEach((friend) => {
  console.log(`${friend.name} - ${friend.status}`);
});

getProfileData(steamid64: string): Promise<SteamProfileData>

Fetches profile data for a Steam user.

const profile = await steamAPI.getProfileData("76561198028121353");
console.log(`Name: ${profile.name}`);
console.log(`Level: ${profile.level}`);
console.log(`Game count: ${profile.gameCount}`);

Group Data

getGroupDataById(groupId: string): Promise<SteamGroupData>

Fetches data for a Steam group by numeric ID.

const group = await steamAPI.getGroupDataById("45887305");
console.log(`Group name: ${group.name}`);
console.log(`Members: ${group.memberCount}`);
console.log(`Founded: ${group.founded}`);
if (group.founded_date) {
  console.log(`Founded date: ${group.founded_date}`);
}

getGroupDataByUrl(groupUrl: string): Promise<SteamGroupData>

Fetches data for a Steam group by URL identifier.

const group = await steamAPI.getGroupDataByUrl("valve");
console.log(`Group name: ${group.name}`);
console.log(`Members: ${group.memberCount}`);
console.log(`Founded: ${group.founded}`);
if (group.founded_date) {
  console.log(`Founded date: ${group.founded_date}`);
}

The SteamGroupData object includes:

  • name: The name of the group
  • tag: The group tag/abbreviation
  • url: The group URL identifier
  • imageHash: The group image hash
  • memberCount: Number of members in the group
  • founded: When the group was founded (as a string, e.g., "24 April, 2024" or "7 December")
  • founded_date: ISO timestamp of when the group was founded, ending in 00:00:00.000Z (optional, only present if the date can be parsed)
  • state: Group access state ("public", "private", or "inviteOnly")

getGroupMembers(groupId: string, page?: number): Promise<SteamGroupMembersPage>

Fetches members for a Steam group. Supports pagination.

// Get first page of group members
const membersPage = await steamAPI.getGroupMembers("valve");
console.log(`Total members: ${membersPage.totalMembers}`);
console.log(
  `Current page: ${membersPage.currentPage} of ${membersPage.totalPages}`
);

// Members on the current page
membersPage.members.forEach((member) => {
  console.log(`${member.name} - ${member.status}`);
});

// Get the second page
const secondPage = await steamAPI.getGroupMembers("valve", 2);

App Data

getAppDetails(appId: string): Promise<AppDetails>

Fetches app details for a Steam app.

const app = await steamAPI.getAppDetails("220"); // Half-Life 2
console.log(`App name: ${app.name}`);
console.log(`Counts as game: ${app.countsAsGame}`);
console.log(`Region restricted: ${app.regionRestricted}`);

The AppDetails object includes:

  • name: The name of the app
  • countsAsGame: Whether the item counts as a game in Steam profiles
  • regionRestricted: Whether the app is unavailable in your current region (if true, countsAsGame will be false)

Market Listings

getMarketListingsByName(marketHashName: string, start?: number, count?: number, country?: string, language?: string, currency?: number): Promise<MarketListingResult>

Fetches market listings for a specific item name (marketHashName) in CS:GO (appId 730).

const listings = await steamAPI.getMarketListingsByName(
  "Glock-18 | High Beam (Factory New)"
);
console.log(listings.length); // Number of listings found
console.log(listings[0].price); // Price of the first listing
console.log(listings[0].inspect); // Inspect link for the first listing

Each listing is a MarketListing object:

  • id: Listing ID
  • price: Price in the selected currency
  • inspect: Inspect link for the item
  • fee: Fee amount
  • steam_fee: Steam's fee
  • converted_price: Price in the selected currency
  • converted_fee: Fee in the selected currency
  • converted_price_with_fee: Total price (converted_price + converted_fee)

The return type is MarketListingResult, which is an array of MarketListing objects.

Market Data

getPriceOverview(appid: number, marketHashName: string, country?: string, currency?: number): Promise<PriceOverview>

Fetches an overview of the price of an item on the Steam Community Market.

const priceOverview = await steamAPI.getPriceOverview(
  730, // App ID (e.g., 730 for CS:GO)
  "AK-47 | Redline (Field-Tested)",
  "US", // Country code
  1 // Currency ID (1 for USD)
);
console.log(`Lowest Price: ${priceOverview.lowest_price}`);
if (priceOverview.volume) {
  console.log(`Volume: ${priceOverview.volume}`);
}
if (priceOverview.median_price) {
  console.log(`Median Price: ${priceOverview.median_price}`);
}

The PriceOverview object includes:

  • success: Boolean indicating if the request was successful.
  • lowest_price (optional): The lowest price of the item.
  • volume (optional): The number of items sold in the last 24 hours.
  • median_price (optional): The median sale price of the item.

queryMarket(appid: number, query?: string, start?: number, count?: number, searchDescriptions?: boolean, sortColumn?: string, sortDir?: string, noRender?: number): Promise<MarketQueryResult>

Queries the Steam Community Market for items.

Parameters:

  • appid (number): The application ID for the game to query items from.
  • query (string, optional): The search query string. Defaults to "".
  • start (number, optional): The starting offset for results. Defaults to 0.
  • count (number, optional): The number of results to return. Defaults to 10.
  • searchDescriptions (boolean, optional): Whether to search in descriptions as well (0 or 1). Defaults to false.
  • sortColumn (string, optional): Column to sort by (e.g., 'popular', 'price').
  • sortDir (string, optional): Sort direction ('asc' or 'desc').
  • noRender (number, optional): Set to 1 for JSON response. Defaults to 1.

Returns: Promise<MarketQueryResult>


getGemValue(appid, itemType, borderColor)

Fetches the "goo value" (gem value) for a specific item type from the Steam Community Auction.

Parameters:

  • appid (number): The application ID of the game the item belongs to (e.g., 2400 for some auction-related items).
  • itemType (number): The specific type of the item.
  • borderColor (number): The border color identifier for the item.

Returns: Promise<GemValueResponse> - An object containing: _ success (number): 1 if successful. _ goo_value (string): The gem value as a string (e.g., "60").

Example Usage:

const steamAPI = new SteamAPI();

async function fetchGemValue() {
  try {
    const gemData = await steamAPI.getGemValue(2400, 4, 1);
    console.log("Gem Value:", gemData.goo_value); // Output: Gem Value: 60 (or other value)
  } catch (error) {
    console.error("Failed to fetch gem value:", error);
  }
}

fetchGemValue();

Utility Functions

convertSteamID64ToSteamID32(steamid64: string): number

Converts a 64-bit Steam ID to its 32-bit representation.

import { convertSteamID64ToSteamID32 } from "steamstash";

const steamid32 = convertSteamID64ToSteamID32("76561198028121353");
console.log(steamid32); // Outputs the 32-bit Steam ID

License

MIT