0.0.2 • Published 9 years ago
steam-web-api-build-url v0.0.2
steam-web-api-build-url
Build the request URL for Steam Web API requests
Installation
$ npm install --save steam-web-api-build-url babel
Usage
require('babel/polyfill')
var steamWebApiBuildUrl = require('steam-web-api-build-url').default
steamWebApiBuildUrl('SteamNews', 'GetNewsForApp', {
version: 2, // optional; 1 by default
query: {
appid: 440,
count: 3,
maxlength: 300
} // optional; empty by default
}) // https://api.steampowered.com/ISteamNews/GetNewsForApp/v0002/?appid=440&count=3&maxlength=300&format=json
steamWebApiBuildUrl('SteamUser', 'GetPlayerSummaries', {
version: 2,
query: {
steamids: '76561197960435530'
},
key: 'XXXXXXXXXXXXXXXXXXXXXXX',
format: 'xml'
}) // https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?steamids=76561197960435530&format=xml&key=XXXXXXXXXXXXXXXXXXXXXXX
API
default(interfaceName, methodName, options)
interfaceName
The first part of the pathname; the leading I is dropped.
methodName
The second part of the pathname.
options
version
Optional. The version of the method to use. 1 by default.
key
Optional. The Steam Web API key. Certain methods don't function without it.
format
Optional. The format to return. JSON by default.
query
Optional. The remaining values of the query string.
0.0.2
9 years ago