steamgames
Version:
A package for fetching game data from Steam APIs
23 lines (22 loc) • 945 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const getSteamPriceOverviews_1 = require("../api/getSteamPriceOverviews");
const getSteamGameNamefromID_1 = require("../api/getSteamGameNamefromID");
// Example usage together with getSteamGameNamefromID
async function testGetSteamGameAPIs() {
const appids = [3240220, 292030, 377160];
const country = "de"; // Example country code
try {
const result = await (0, getSteamPriceOverviews_1.getSteamPriceOverview)(appids, country);
for (const appid of appids) {
const price = result[appid]?.data?.price_overview?.final_formatted;
const name = await (0, getSteamGameNamefromID_1.getSteamGameNamefromID)(appid);
console.log(`Current Price of ${name}:`, price);
}
}
catch (error) {
console.error("Error fetching game details:", error);
}
}
// Call the test
testGetSteamGameAPIs();