Files
st-steamus-prime/steam_api/lib/steam_api.ex
2025-09-21 14:58:50 +02:00

12 lines
376 B
Elixir

defmodule SteamApi do
@moduledoc """
Documentation for `SteamApi`.
"""
def get_games(steam_id) do
# TODO: Add case statement to check for nil
steam_api_key = System.get_env("STEAM_API_KEY")
Req.get!("http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=#{steam_api_key}&steamid=#{steam_id}&format=json").body["response"]["games"]
end
end