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

steamgrab

v1.0.3

Published

A TypeScript library for scraping game information from Steam

Readme

Steam Game Scraper (steamgrab)

A TypeScript library for fetching game information from the Steam store. This library provides easy-to-use functions for searching games by name and retrieving detailed game information by Steam App ID.

Features

  • Search for games by name and get multiple results
  • Fetch detailed game information using Steam App ID
  • TypeScript support with full type definitions
  • Modern async/await API
  • Error handling with custom error types
  • Compatible with Node.js 16+ and modern browsers

Installation

npm install steamgrab
# or
yarn add steamgrab
# or
bun add steamgrab

This package is distributed as TypeScript source files rather than compiled JavaScript, which provides several benefits:

  • Better type information directly from the source
  • Easier debugging with source maps
  • Ability to adapt the code to your TypeScript configuration

Note that you'll need TypeScript ≥4.5.0 in your project to use this package.

Usage

Searching for games

import { Steam } from 'steamgrab';

async function searchGames() {
  try {
    // Get up to 10 games matching "Portal"
    const games = await Steam.getGames('Portal');
    
    console.log(`Found ${games.length} games:`);
    games.forEach(game => {
      console.log(`${game.title} (${game.appid}) - ${game.price}`);
    });
  } catch (error) {
    if (error instanceof Steam.SteamScraperError) {
      console.error('Steam scraper error:', error.message);
    } else {
      console.error('Error:', error);
    }
  }
}

searchGames();

Getting game details by App ID

import { Steam } from 'steamgrab';

async function getGameDetails(appId: number) {
  try {
    const game = await Steam.getGameInfoById(appId);
    
    if (game) {
      console.log(`Title: ${game.title}`);
      console.log(`Release Date: ${game.release}`);
      console.log(`Price: ${game.price}`);
      console.log(`Image URL: ${game.image}`);
    } else {
      console.log(`No game found with AppID: ${appId}`);
    }
  } catch (error) {
    if (error instanceof Steam.SteamScraperError) {
      console.error('Steam API error:', error.message);
    } else {
      console.error('Error:', error);
    }
  }
}

// Get details for Portal 2 (App ID: 620)
getGameDetails(620);

API Reference

getGames(query: string, limit?: number): Promise<GameInfo[]>

Searches for games by name and returns an array of game information.

  • query: The game name to search for
  • limit: Maximum number of results to return (default: 10)

getFirstGameInfo(query: string): Promise<GameInfo | null>

Fetches the first game information result by searching for a game name.

  • query: The game name to search for

Note: This function is deprecated. Use getGames(query, 1) instead.

getGameInfoById(appId: string | number): Promise<GameInfo | null>

Fetches game information directly using the Steam API with a game ID.

  • appId: The Steam app ID of the game

GameInfo Interface

interface GameInfo {
  title: string;
  release: string;
  price: string;
  image: string | undefined;
  appid: number | undefined;
}

Development

# Clone the repository
git clone https://github.com/RedWilly/steamgrab.git
cd steamgrab

# Install dependencies
npm install

# Build the library
npm run build

# Run tests
npm test

License

MIT