1.2.0 • Published 7 years ago
node-csgotm-api v1.2.0
CSGO.tm API
This is a node module for interacting with the csgo.tm API. Docs available here
Installation
npm install node-csgotm-api
Usage
var csgotm = require('node-csgotm-api');
var api = new csgotm.API(options);or
import {API as api} from 'node-csgotm-api';Constructor params
Params:
options[apiKey]: your API key requiredoptions[baseUrl]: url to API. Default:https://market.csgo.com/.options[apiPath]: relative path to API. Default:api.options[extendedError]: Should module return full response and got options on market error. Default:false.options[useLimiter]: enable bottleneck limiter. Default:true.options[defaultGotOptions]: default options for got module for all API-call methods withoutgotOptionsparam(except static). Default:{}.options[limiterOptions]: options for bottleneck limiter. Default:
{
maxConcurrent: 1,
minTime: 200,
highWater: -1,
strategy: Bottleneck.strategy.LEAK,
rejectOnDrop: true
}Properties
Dynamic
options: merged object of your passed options and default onesapiUrl: composed api url from base url and api path
Static
defaultAppId: CS:GO Steam AppId - 730defaultBaseUrl:https://market.csgo.com/LANGUAGES: languages, supported by csgo.tmCREATE_TRADE_REQUEST_TYPE: available types of trade requestsMASS_INFO_SELL_BUY: available types of 'SELL' and 'BUY' param in 'MassInfo' requestMASS_INFO_HISTORY: available types of 'HISTORY' param in 'MassInfo' requestMASS_INFO_INFO: available types of 'INFO' param inMassInforequestDEFAULT_MASS_INFO_PARAMS: default params that will be substituted, when you did not provide some of them
Methods
All API-call methods return Promise, and they have gotOptions param for got module
All methods are divided into blocks with a special prefix (except static) like in docs
accountitemsellbuyordernotificationsearchquickadditional
Static Methods
requestJSON(url, gotOptions)dbName(appId, baseUrl, gotOptions)itemDb(dbName, baseUrl, gotOptions)currentItemDb(appId, baseUrl, gotOptions)history(baseUrl, gotOptions)getItemIds(item, asNumbers)formatItem(item, symbol)
Many of methods require item in the params. It should be an object with properties:
i_classidorclassidorclassIdi_instanceidorinstanceidorinstanceIdorui_real_instance
Example
api.accountGetTrades().then(trades => {
console.log(trades);
}).catch(error => {
console.log(error);
});1.2.0
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
8 years ago
1.0.11
8 years ago
1.0.10
8 years ago
1.0.9
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago
0.1.8
9 years ago
0.1.7
9 years ago
0.1.6
9 years ago
0.1.5
9 years ago
0.1.4
9 years ago
0.1.3
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago
0.0.3
9 years ago
0.0.2
9 years ago
0.0.1
9 years ago