A basic package to interface with the Steam API.
Project description
SteamUser API Wrapper
A Python class to interact with the Steam Web API, providing access to user information, friends lists, game libraries, achievements, and recently played games.
Features
- Fetch Friends List: Retrieve the Steam user's friends, with an option to return only Steam IDs.
- User Summary: Access high-level profile information like name, avatar, and online status.
- Owned Games: Retrieve the list of games owned by the user, including playtime details.
- User Game Stats: Get game-specific statistics and achievement progress for a given game.
- Recently Played Games: Fetch the user's recently played games along with playtime information.
Installation
Ensure you have Python 3.8+ installed and the requests package:
pip install requests
Usage
- Import the
SteamUserclass. - Instantiate the class with your Steam API key and the target Steam ID.
from steam_user import SteamUser
# Initialize the SteamUser object
user = SteamUser(api_key="YOUR_API_KEY", steam_id="76561198012345678")
Methods
getFriendsList()
Fetches the user's friends list.
-
Returns:
list: List of friends with details.
-
Example:
friends = user.getFriendsList()
print(friends)
getUserSummary()
Retrieves a summary of the user's profile.
-
Returns:
dict: Profile information including Steam ID, name, avatar, and more.
-
Example:
summary = user.getUserSummary()
print(summary)
getOwnedGames()
Fetches the list of games owned by the user.
-
Returns:
dict: Game details including app ID, name, and playtime.
-
Example:
games = user.getOwnedGames()
print(games)
getUserGameStats(APP_ID)
Fetches stats and achievements for a specific game.
-
Parameters:
APP_ID(int): The Steam application ID of the game.
-
Returns:
dict: Game-specific stats and achievements.
-
Example:
stats = user.getUserGameStats(105600) # Terraria
print(stats)
getRecentlyPlayed()
Retrieves the user's recently played games.
-
Returns:
dict: Details of recently played games and playtime information.
-
Example:
recent_games = user.getRecentlyPlayed()
print(recent_games)
Notes
- The Steam API is subject to privacy settings. If data is restricted, methods may return
Noneor incomplete information. - Ensure your API key is valid and the Steam ID is correct.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file steam_api_pkg-0.1.1.tar.gz.
File metadata
- Download URL: steam_api_pkg-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a19a7d817244a578c4e096c8bfc37c9baadad1c2e5dc1cfa5794dd08187fc33
|
|
| MD5 |
9bd6039763a76bd4367022e79a10dc22
|
|
| BLAKE2b-256 |
f2560ebcbade0932170f06d8006fa4dff1d3fc2b4a347bb5396a3660350d9b79
|
File details
Details for the file steam_api_pkg-0.1.1-py3-none-any.whl.
File metadata
- Download URL: steam_api_pkg-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
520f405061474c98e8e5d63c5e6f4a080bb4e6c7f1549940b98baea9a446fd4e
|
|
| MD5 |
5f8f24d51a8b4867abc86d9ec90e7d31
|
|
| BLAKE2b-256 |
58ca627fcb533dab1d3302483af9277bbcdd8ff1496168b3f21bf4548e172726
|