Package Exports
- steam-provider
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (steam-provider) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Steam Provider Library
Usage
Install the dependency
npm install steam-provider Import the library
TypeScript
import { SteamProvider } from 'steam-provider';JavaScript
var steam = require('steam-provider')Search for a game (Limited to 10 first results)
TypeScript
let provider = new SteamProvider();
provider.search("Portal 2").then(result => {
console.log(result);
})JavaScript
var provider = new steam.SteamProvider();
provider.search("Portal 2").then(result => {
console.log(result)
})Search Results
[ SteamSearchEntry {
id: '620',
name: 'Portal 2',
url: 'http://store.steampowered.com/app/620/Portal_2/?snr=1_7_7_151_150_1',
price: '19.99',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '104600',
name: 'Portal 2 - The Final Hours',
url: 'http://store.steampowered.com/app/104600/Portal_2__The_Final_Hours/?snr=1_7_7_151_150_1',
price: '1.99',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '660',
name: 'Portal 2 Sixense MotionPack DLC',
url: 'http://store.steampowered.com/app/660/Portal_2_Sixense_MotionPack_DLC/?snr=1_7_7_151_150_1',
price: '',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '323180',
name: 'Portal 2 Soundtrack',
url: 'http://store.steampowered.com/app/323180/Portal_2_Soundtrack/?snr=1_7_7_151_150_1',
price: '',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '247120',
name: 'Portal 2 Sixense Perceptual Pack',
url: 'http://store.steampowered.com/app/247120/Portal_2_Sixense_Perceptual_Pack/?snr=1_7_7_151_150_1',
price: '',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '400',
name: 'Portal',
url: 'http://store.steampowered.com/app/400/Portal/?snr=1_7_7_151_150_1',
price: '9.99',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '317400',
name: 'Portal Stories: Mel',
url: 'http://store.steampowered.com/app/317400/Portal_Stories_Mel/?snr=1_7_7_151_150_1',
price: '',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '684410',
name: 'Bridge Constructor Portal',
url: 'http://store.steampowered.com/app/684410/Bridge_Constructor_Portal/?snr=1_7_7_151_150_1',
price: '9.99',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '374040',
name: 'Portal Knights',
url: 'http://store.steampowered.com/app/374040/Portal_Knights/?snr=1_7_7_151_150_1',
price: '19.99',
priceWithDiscount: '',
score: '' },
SteamSearchEntry {
id: '446750',
name: 'Portal Stories: VR',
url: 'http://store.steampowered.com/app/446750/Portal_Stories_VR/?snr=1_7_7_151_150_1',
price: '',
priceWithDiscount: '',
score: '' } ]Get game details
TypeScript
let provider = new SteamProvider();
provider.detail("620").then(result => {
console.log(result);
})JavaScript
var provider = new steam.SteamProvider();
provider.detail("620").then(result => {
console.log(result)
})Detail Results
SteamDetailEntry {
id: '620',
name: 'Portal 2',
priceData:
PriceInfo {
initialPrice: '19.99',
finalPrice: '19.99',
discountPercent: 0 },
otherData:
OtherInfo {
imageUrl: 'https://steamcdn-a.akamaihd.net/steam/apps/620/header.jpg?t=1490208943',
platforms: [ 'Windows', 'MacOS', 'Linux' ],
metacriticScore: 95,
features:
[ 'Single-player',
'Co-op',
'Steam Achievements',
'Full controller support',
'Steam Trading Cards',
'Captions available',
'Steam Workshop',
'Steam Cloud',
'Stats',
'Includes level editor',
'Commentary available' ],
developer: [ 'Valve' ],
publisher: [ 'Valve' ] } }Notes
By default the library will recover data in US English and will get the prices in USD currency.
You can choose the language and the currency optionally.
provider.search("Portal 2", "spanish", "es").then(result => {
console.log(result);
})
provider.detail("620", "spanish", "es").then(result => {
console.log(result)
})Known Issues
About & Credits
steam-provider provides basic functionality for parsing Steam games information.
Credits to: ckatzorke for providing me an excelent starting point for this project
