Skip to main content

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

  1. Import the SteamUser class.
  2. Instantiate the class with your Steam API key and the target Steam ID.
from steam_api_pkg.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 None or 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steam_api_pkg-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steam_api_pkg-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file steam_api_pkg-0.1.2.tar.gz.

File metadata

  • Download URL: steam_api_pkg-0.1.2.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

Hashes for steam_api_pkg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9106ac5edde8a714643b1c26929d12b3bfa48d429e5c1b6c9910905a14e29006
MD5 6f16bbc410ada565aad36c3c7313c1e7
BLAKE2b-256 dc09d307636b2116811e0d87f27c58679fa824b5acbaa79010e0dcacc354faef

See more details on using hashes here.

File details

Details for the file steam_api_pkg-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: steam_api_pkg-0.1.2-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

Hashes for steam_api_pkg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22c01fe3afccb8ad26905cd542a13cc1accdcdc34d3f6cc041339ff6156ffa55
MD5 da81d09454d8da41cc50a1a7d98f0142
BLAKE2b-256 d44300d627ac776ee71e5becedd739e2734599165bb880038422828d8cf3b8c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page