A simple, straightforward PHP script designed to fetch and display essential information about a Steam user's profile and game library using the Steam Web API. Just enter a Steam ID, and instantly view recently played games, most played titles, and total accumulated playtime.
✨ Features
- User Profile Display: Shows the Steam user's persona name and avatar.
- Recently Played Games: Lists games played in the last two weeks with their respective playtime.
- Most Played Games: Highlights the top 7 games by total playtime.
- Total Playtime Calculation: Aggregates and displays the total hours played across all owned games.
- Dynamic Game Image Fetching: Attempts to fetch game logos/icons from Steam Community, with a fallback to Steam Store header images if community assets are unavailable.
- Simple Web Interface: An intuitive HTML form to input the Steam ID.
📚 Tech Stack
- Backend: PHP (Vanilla)
- Frontend: HTML, CSS
- API: Steam Web API
🚀 Installation
To get this project up and running on your local machine, follow these steps:
-
Download the
steam.phpfile: You can either clone the repository (if applicable) or simply download thesteam.phpfile directly. -
Obtain a Steam Web API Key:
- Visit the Steam Web API Key registration page.
- Log in with your Steam account and register a new API key. You can use any domain name, even
localhostif you're running it locally.
-
Configure the API Key: Open the
steam.phpfile and locate the$steamApiKeyvariable. Replace the empty string with your newly obtained Steam Web API Key.// In steam.php $steamApiKey = 'YOUR_STEAM_WEB_API_KEY_HERE'; // <-- Replace this line with your actual API key
-
Set up a Web Server with PHP: You'll need a web server (like Apache or Nginx) with PHP installed and configured.
- Place the
steam.phpfile in your web server's document root (e.g.,htdocsfor Apache,wwwfor Nginx).
Alternatively, for quick local testing, you can use PHP's built-in web server:
php -S localhost:8000
Then, navigate to
http://localhost:8000/steam.phpin your web browser. - Place the
-
Once the
steam.phpfile is accessible via your web server, open it in your browser. -
You will see a simple form asking for a Steam ID.
-
Enter a valid SteamID64 (a 17-digit number) or a profile link into the input field.
-
Click "Senden" (Submit) to view the profile and game statistics.
Example SteamID64:
76561197960435530(Valve's Robin Walker) Example Profile Link:[76561197960435530](https://steamcommunity.com/profiles/76561197960435530/)(Valve's Robin Walker)
🤝 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
📝 License
Distributed under the MIT License.