This is a NodeJS server that makes it easy to use Steam Web API.
It allows to get data from the API to client side.
I.E allows Cross Origin Resource Sharing
(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/matthew-hub/steam-api-serve.git
npm install
node server.js
- Install the Server with NodeJS
- Get a Steam Web API developer key. Get one here.
- Read the Steam Web API documentation. Doc.
- Once you have the key, copy it to the file 'server.js'
// server.js
const express = require('express');
const request = require('request');
const app = express();
const port = 8080; // PORT
const STEAM_API_KEY = 'YOUR STEAM WEB API KEY';
- All API are located in the
"api"
folder. Same as below. - It's similar to the Steam Web API, you use methods, parameters or query, see below.
- Create request on client side.
Steam API Server request:
https://{base_url}/steam/{method}/{parameters}
Sample:
http://locahost:8080/steam/GetPlayerSummaries/76561198119402590
Steam Web API request:
https://{base_url}/{interface}/{method}/{version}?{parameters}
Sample:
http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=1234567890&steamids=000123000456
// yur 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:8080/steam/GetPlayerAchievements/${steam_id}/${app_id}`;
fetch(url)
.then(res => res.json())
.then(data => {
console.log('[DATA]:', data);
})
ISteamUser:
'/steam/GetPlayerSummaries/steamid'
'/steam/ResolveVanityURL/vanityurl'
'/steam/GetPlayerBans/steamid'
'/steam/GetFriendList/steamid'
ISteamUserStats:
'/steam/GetSchemaForGame/appid'
'/steam/GetGlobalStatsForGame/appid/?count=1&name='avaiablegamestats'
'/steam/GetPlayerAchievements/steamid/appid'
'/steam/GetGlobalAchievementPercentagesForApp/gameid'
'/steam/GetUserStatsForGame/steamid/:appid'
IPlayerService:
'/steam/GetOwnedGames/steamid'
'/steam/GetRecentlyPlayedGames/steamid'
'/steam/IsPlayingSharedGame/steamid/appid_playing'
ISteamNews:
'/steam/GetNewsForApp/appid/?count=10&maxlength=300'
MIT © Feel free to make any changes.