Socket
Socket
Sign inDemoInstall

steam-market-search

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    steam-market-search

A NodeJS package for searching the steam marketplace


Version published
Weekly downloads
73
decreased by-82.45%
Maintainers
1
Install size
31.5 kB
Created
Weekly downloads
 

Readme

Source

NPM NPM NPM

Steam Market Search is a NodeJS package to search the Steam Community Market. Using this package you will be able to search and retrieve images, prices, descriptions, listing counts and other various information made available by each app.

ContentsType
Getting StartedSetup
search(appid, options)Method
Basic SearchCode Example
Advanced SearchCode Example
setRequestOptions(options)Method
Custom HeadersCode Example
ShortcutsCode Example
Steam Item TypesTable Data
Multiple FiltersCode Example
SearchOptionsType

Getting Started

Install via NPM

npm install steam-market-search

Then you can require the package in your project using TypeScript

import { market } from 'steam-market-search';

or JavaScript

const market = require('steam-market-search').market;  

Usage

Below is my attempt at documenting how to use this package. If you feel like you can do better please feel free to make a pull request.

search(appid, options);

Searches the marketplace for items.

PropertyDescriptionTypeDefault
appidThe AppID of the game you want to fetch items for. Use 753 (steam) for items like trading cards.numbernone
optionsEither a SearchOptions object or a string to be used as the search query.SearchOptions or stringnone

Search 730 (CSGO) for a gun skin called Death by Kitty.

market.search(730, 'Death By Kitty').then(results => {
    console.log(results);
});

Search 290340 (Armello) for a Dire Key item using a custom item type

market.search(290340, { query: 'Dire', 'category_290340_type[]': 'tag_key' }).then(results => {
    console.log(results);
});

setRequestOptions(RequestOptions)

Allows you to define custom RequestOptions like headers to be passed when making API Calls.

PropertyDescriptionTypeDefault
RequestOptionsAn object of custom request options to be passed during the API Call.RequestOptions{ }
Custom Headers

This is an example that uses setRequestOptions() to change the language of the search results

market.setRequestOptions({
    headers: {
        'Accept-Language': 'de'
    }
});

Now all requests made on market will be in German.

market.search(730, 'Death by Kitty').then(results => console.log(results));  

Shortcuts

As a lot of people use this for apps like CS:GO, TF2 or Dota there are several shortcuts to quickly search that specific app.

market.searchCSGO('Death by Kitty');
market.searchTF2('Crate Key');  

// tag_item_class_4 = Emoticons
market.searchCommunity({ query: 'Heart', 'category_753_item_class[]': 'tag_item_class_4' });

Additional Examples

Below are some more examples or explanations that may be helpful

Steam Item Types

When using searchCommunity() you may want to only fetch certain types of items. Below is a table listing each type and the value required to filter

TypeOptionValue
Trading Cardcategory_753_item_class[]tag_item_class_2
Emotioncategory_753_item_class[]tag_item_class_4
Profile Backgroundcategory_753_item_class[]tag_item_class_3
Booster Packcategory_753_item_class[]tag_item_class_5
Sale Items (saliens)category_753_item_class[]tag_item_class_10
Consumablecategory_753_item_class[]tag_item_class_6
Normal Cardscategory_753_cardborder[]tag_cardborder_0
Foil Cardscategory_753_cardborder[]tag_cardborder_1
Rarity (Common)category_753_droprate[]tag_droprate_0
Rarity (Uncommon)category_753_droprate[]tag_droprate_1
Rarity (Rare)category_753_droprate[]tag_droprate_2
Rarity (Extraordinary)category_753_droprate[]tag_droprate_3
Gamecategory_753_Game[]tag_app_APPID
Multiple Filters

The following example will search for any Normal or Foil Trading Cards that contain the word Heart

market.searchCommunity({
    query: 'Heart',
    'category_753_cardborder[]': [
        'tag_cardborder_0', // Normal Border
        'tag_cardborder_1'  // Foil Border
    ],
    'category_753_item_class[]': 'tag_item_class_2' // Trading Cards
}).then(results => console.log(results));
Filter by game

If you only want community items from a specific game you can filter them using the category_753_Game[] option. Like all options ending with square brackets you can pass multiple game appids at once.

// Search for steam community items from the game "100% Orange Juice" 
market.search(753, { 'category_753_Game[]': 'tag_app_282800', query: 'stars' });
Type: SearchOptions

This is the options object you would pass instead of a string when searching

PropertyDescriptionTypeDefault
queryThe search querystringNone
appidThe game AppID you want to find items for.numberNone
startStart atnumberNone
countNumber of results to be returned in the search.number50
sort_columnSort the results by price or quantity availablestringNone
sort_dirSort the results ascending or descendingstringasc
search_descriptionsAllows your search query to match descriptions toonumber0
norenderEnables or disables HTML response. Changing this will likely prevent the search results from returning.number1
customAllows custom parameters like cateogry filtersstring or arrayNone

Keywords

FAQs

Last updated on 21 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc