# steamapi

> A nice Steam API wrapper.

Latest version **3.1.5** (published 2026-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install steamapi
pnpm add steamapi
yarn add steamapi
bun add steamapi
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.1.5 |
| Published | 2026-01-23 |
| First published | 2017-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 267.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 199 |
| Author | xDimGG |
| Maintainers | lloti |
| Keywords | steam, api, wrapper, steam-api, steampowered |

## Links

- npm: https://www.npmjs.com/package/steamapi
- Repository: https://github.com/xDimGG/node-steamapi
- Homepage: https://github.com/xDimGG/node-steamapi#readme
- Issues: https://github.com/xDimGG/node-steamapi/issues
- npm.io page: https://npm.io/package/steamapi

## Dependencies (2)

- [steamid](https://npm.io/package/steamid.md) ^2.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.3.2

## Recent versions

- 3.1.5 (latest) — 2026-01-23
- 3.1.4 — 2026-01-05
- 3.1.3 — 2025-06-17
- 3.1.2 — 2025-06-12
- 3.1.1 — 2025-04-15
- 3.1.0 — 2025-04-11
- 3.0.12 — 2024-08-09
- 3.0.11 — 2024-06-29
- 3.0.10 — 2024-06-26
- 3.0.9 — 2024-06-23
- 3.0.8 — 2024-02-13
- 3.0.7 — 2024-01-19
- 3.0.6 — 2024-01-19
- 3.0.5 — 2024-01-19
- 3.0.4 — 2024-01-19
- … 33 more at https://npm.io/package/steamapi/versions

## README

## SteamAPI
<div align="center">
	<p>
		<a href="https://www.npmjs.com/package/steamapi"><img src="https://nodei.co/npm/steamapi.png?compact=true" alt="" /></a>
	</p>
	<p>
		<a href="https://www.npmjs.com/package/steamapi"><img src="https://img.shields.io/npm/v/steamapi.svg?maxAge=3600" alt="NPM" /></a>
		<a href="https://discord.gg/6d698nhnKx"><img src="https://img.shields.io/discord/1119337655780520057?maxAge=3600" alt="Discord" /></a>
	</p>
</div>

## Documentation
A list of all the methods SteamAPI provides is available [here](https://github.com/xDimGG/node-steamapi/blob/master/docs/classes/default.md#methods).

## Breaking changes from 2.x to 3.x
- CommonJS Modules -> ES Modules
- Import using `import` statement instead of `require()`
- SteamAPI constructor now takes false as the first parameter if you don't want to supply a key
- Options for constructor have changes from `{ enabled, expires, disableWarnings }` to `{ language, currency, headers, baseAPI, baseStore, baseActions, inMemoryCacheEnabled, gameDetailCacheEnabled, gameDetailCacheTTL, userResolveCacheEnabled, userResolveCacheTTL }`
- Custom caching may be enabled by setting `inMemoryCacheEnabled: false` and setting `<SteamAPI>.gameDetailCache`/`<SteamAPI>.userResolveCache`. Must implement `CacheMap<K, V>` interface in src/Cache.ts
- getFeaturedGames() returns object instead of array
- Server#game -> Server#gameDir
- App IDs are passed as numbers not strings (although a string will probably still work)
- Any other changes to the API can be found in https://github.com/xDimGG/node-steamapi/blob/master/PORT.md

## Future plans for 4.x
- Allow `getGameDetails` to return either a GameDetails object or a map of string to GameDetails depending on if the user supplied a single id or an array of ids.
- Maybe separate groups of endpoints into different classes so there isn't just a monolithic SteamAPI class? Not quite sure how they would be grouped.
- Add some convenience methods to the Cache class to reduce double logic in SteamAPI.ts

## Setup
### Installation
```
npm i steamapi
```
### Getting an API Key
Once signed into Steam, head over to http://steamcommunity.com/dev/apikey to generate an API key.
### Usage
First, we start by making a SteamAPI "user".
```js
import SteamAPI from 'steamapi';

const steam = new SteamAPI('steam token');
```
Now, we can call methods on the `steam` object.

For example, let's retrieve the SteamID64 of a user. SteamAPI provides a `resolve` method, which accepts URLs and IDs.
```js
steam.resolve('https://steamcommunity.com/id/DimGG').then(id => {
	console.log(id); // 76561198146931523
});
```
Now let's take that ID, and fetch the user's profile.
```js
steam.getUserSummary('76561198146931523').then(summary => {
	console.log(summary);
	/**
	UserSummary {
		steamID: '76561198146931523',
		avatar: {
			small: 'https://avatars.steamstatic.com/7875e33529232d95cad28ea1054897618907fa03.jpg',
			medium: 'https://avatars.steamstatic.com/7875e33529232d95cad28ea1054897618907fa03_medium.jpg',
			large: 'https://avatars.steamstatic.com/7875e33529232d95cad28ea1054897618907fa03_full.jpg',
			hash: '7875e33529232d95cad28ea1054897618907fa03'
		},
		url: 'https://steamcommunity.com/id/DimGG/',
		visible: true,
		personaState: 0,
		personaStateFlags: 0,
		allowsComments: true,
		nickname: 'dim',
		lastLogOffTimestamp: 1704553877,
		createdTimestamp: 1406393110,
		realName: undefined,
		primaryGroupID: '103582791457347196',
		gameID: undefined,
		gameName: undefined,
		gameServerIP: undefined,
		gameServerID: undefined,
		countryCode: 'US',
		stateCode: undefined,
		cityID: undefined
	}
	*/
});
```

---
_Source: https://npm.io/package/steamapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
