UNPKG

steamgames

Version:

A package for fetching game data from Steam APIs

11 lines (10 loc) 449 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSteamGameDetails = getSteamGameDetails; async function getSteamGameDetails(appid, country) { const response = await fetch(`http://store.steampowered.com/api/appdetails?appids=${appid}&cc=${country}`); const data = await response.json(); // The API returns an object with the appid as the key const gameData = data[appid]; return gameData; }