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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xtsusaku/steamapi-wrapper

v1.1.0

Published

Bun-first compatible Steam Web API client library dynamically mapped like steamapi.xpaw.me

Readme

Steam Web API Client (@xtsusaku/steamapi-wrapper)

A lightweight, zero-dependency, Bun-first client library for the Steam Web API. This library uses modern JavaScript Proxy objects to dynamically route calls to all 200+ Steam API interfaces and thousands of methods documented on steamapi.xpaw.me, while providing rich TypeScript autocomplete and documentation matching xPaw's site.

Features

  • Bun-first / Native ESM: Works out of the box in Bun, Node.js (18+), and standard browsers via native ES Module exports and the built-in fetch API. No dependencies.
  • Dynamic Proxy Mapping: Allows you to call any documented or undocumented Steam API interface (e.g. steam.IPlayerService.GetOwnedGames or even publisher-only/custom APIs) dynamically without library updates.
  • Auto-formatting of Services: Automatically groups parameters inside the input_json query/body parameters for interfaces ending in "Service", following the official Steam Web API guidelines.
  • Service-Aware Array Serialization: Preserves arrays as JSON arrays inside input_json for Service interfaces, and flattens arrays into the zero-indexed format (e.g. steamids[0]=...) only for standard/legacy endpoints.
  • Automatic Partner API Routing: Securely routes publisher-only endpoints (e.g. IOnlinePlayService.GetCoPlayStatus) to the Steam partner domain (https://partner.steam-api.com) when a partnerKey is provided.
  • Complete Typings: Includes inline TypeScript definitions and JSDoc annotations directly mimicking xPaw's documentation (type, required status, descriptions) for all 200+ interfaces and thousands of endpoints.

Installation

# Using Bun
bun add @xtsusaku/steamapi-wrapper

# Using npm
npm install @xtsusaku/steamapi-wrapper

Usage

Basic Initialization

import { SteamAPI } from "@xtsusaku/steamapi-wrapper";

const steam = new SteamAPI({
  apiKey: "YOUR_STEAM_WEB_API_KEY", // Can be obtained from https://steamcommunity.com/dev/apikey
  partnerKey: "YOUR_PUBLISHER_KEY", // Optional: required for publisher-only endpoints
});

Retrieving Owned Games (IPlayerService)

All Service-based endpoints automatically format parameters using input_json under the hood.

const ownedGames = await steam.IPlayerService.GetOwnedGames({
  steamid: "76561198341746656",
  include_appinfo: true,
  include_played_free_games: true,
});

console.log(ownedGames.response.games);

Retrieving Player Summaries (ISteamUser)

Arrays are automatically flattened to steamids[0], steamids[1], etc., since ISteamUser is a non-Service interface.

const summaries = await steam.ISteamUser.GetPlayerSummaries({
  steamids: ["76561198341746656", "76561197960287930"],
});

console.log(summaries.response.players);

Partner & Publisher-Only Endpoints

Publisher-only endpoints are automatically routed to https://partner.steam-api.com using the partnerKey query parameter. If a developer attempts to call a publisher-only method without providing a partnerKey in the constructor options, a validation error is thrown instantly.

Additionally, if only partnerKey is provided (without an apiKey), the library defaults to routing all API calls (even those that do not normally require a publisher key) to the secure partner host https://partner.steam-api.com using the publisher key.

// Automatically routed to https://partner.steam-api.com/?key=YOUR_PUBLISHER_KEY
const coplayStatus = await steam.IOnlinePlayService.GetCoPlayStatus({
  steamid: "76561198341746656",
  steamid2: "76561197960287930",
  appid: 440,
  time_range_begin: 1700000000,
  time_range_end: 1710000000,
});

Dynamic / Undocumented Endpoints Fallback

If there is a new or undocumented interface not listed in the TypeScript typings, you can still call it directly! The Proxy pattern will resolve it dynamically:

// Call any interface dynamically; type safety falls back to `any` for unknown interfaces
const appDetails = await steam.IStoreService.GetAppList({
  include_games: true,
  max_results: 10,
});

Overriding Versions & HTTP Methods

By default, the library detects if a method is a POST (e.g., if it starts with Set, Add, Remove, Create, etc.) and determines the correct API version (defaulting to v1). If you need to override these defaults, use prefixed underscore parameters:

const response = await steam.ISteamNews.GetNewsForApp({
  appid: 440,
  count: 3,

  // Custom metadata controls (stripped out before sending parameters to Steam)
  _version: 2, // Forces /v2/ instead of /v1/
  _httpMethod: "POST", // Forces POST method instead of GET
});

Configuration Options

The SteamAPI constructor accepts the following options:

| Option | Type | Default | Description | | :------------ | :------- | :------------------------------- | :------------------------------------------------------------------------------ | | apiKey | string | "" | Your Steam Web API Key (for user-level queries) | | partnerKey | string | "" | Your Steamworks Publisher Web API Key (required for publisher-only endpoints) | | accessToken | string | "" | Steam Access Token (for Store/Community APIs) | | baseUrl | string | "https://api.steampowered.com" | Base API host (automatically changed to secure partner host for publisher APIs) | | format | string | "json" | Response format (json, xml, vdf) | | headers | object | {} | Custom headers to pass with every fetch call |

License

This project is licensed under the GNU Affero General Public License v3.0 or later - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.