Node server which makes it easier to use the Steam Web API.
(CORS) is an HTTP-header based mechanism that allows a server to indicate any other origins (domain, scheme, or port) than its own from which a browser should permit loading of resources
$ git clone https://github.come/matt-ressel/steam-api-node-server.git
$ node server.js
- Get your Steam Web API developer key. Get one here.
- Read the Steam Web API documentation. Doc.
- Once you have the key, copy it into the "server.js" file.
// server.js
const http = require('http');
const steamAPI = require('./api/index');
const port = 3000; // PORT
const STEAM_API_KEY = 'YOUR STEAM WEB API KEY';
// ...
- All APIs are located in the 'api' folder.
- It's similar to the Steam Web API, you use methods, parameters or query.
- Create a client-side request.
https://{hostname}/{method}/{parameters}
http://locahost:3000/GetPlayerSummaries/76561198119402590
// your code..
// steam_id
const steam_id = '76561198119402590';
// app_id
const app_id = '292030';
// create the Steam API URL we want to use
const url = `http://localhost:3000/steam/GetPlayerAchievements/${steam_id}/${app_id}`;
fetch(url)
.then((res) => res.json())
.then((data) => {
console.log('[DATA]:', data);
})
.catch((err) => console.log('[ERROR]:', err));
ISteamUser:
'/GetPlayerSummaries/steamid'
'/ResolveVanityURL/vanityurl'
'/GetPlayerBans/steamid'
'/GetFriendList/steamid'
ISteamUserStats:
'/GetSchemaForGame/appid'
'/GetGlobalStatsForGame/appid/?count=1&name='avaiablegamestats'
'/GetPlayerAchievements/steamid/appid'
'/GetGlobalAchievementPercentagesForApp/gameid'
'/GetUserStatsForGame/steamid/:appid'
IPlayerService:
'/GetOwnedGames/steamid'
'/GetRecentlyPlayedGames/steamid'
'/IsPlayingSharedGame/steamid/appid_playing'
ISteamNews:
'/GetNewsForApp/appid/?count=10&maxlength=300'
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.