Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam Web API #449

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions New_APIs/Steam Web API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Steam Web API Demo

This is a simple web application that interacts with the Steam Web API to retrieve user profiles and game achievements.

## Features

- **User Profile Retrieval**: Enter a Steam ID to fetch and display the user's profile.
- **Game Achievements**: Enter a game ID and Steam ID to retrieve the achievements for that game.

## Technologies Used

- **HTML/CSS/JavaScript**: For the frontend.
- **Node.js & Express**: Backend server to handle API requests.
- **Steam Web API**: Fetches data related to Steam user profiles and game achievements.

## Installation

### Prerequisites

- **Node.js** (v12+ recommended)
- **npm** (Node Package Manager)

### Steps

1. **Clone the Repository**:

```
git clone https://github.com/your-username/steam-web-api-demo.git
cd steam-web-api-demo

```

2. **Install Dependecies**
```
npm install
```

## Contributor
### Sree Vidya
26 changes: 26 additions & 0 deletions New_APIs/Steam Web API/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Steam Web API Demo</title>
</head>
<body>
<h1>Steam Web API Demo</h1>
<div id="app">
<h2>Get User Profile</h2>
<input type="text" id="steamId" placeholder="Enter Steam ID">
<button id="getProfileButton">Get Profile</button>

<h2>Get Game Achievements</h2>
<input type="text" id="gameId" placeholder="Enter Game ID">
<button id="getAchievementsButton">Get Achievements</button>

<h2>Results</h2>
<pre id="results"></pre>
</div>

<script src="index.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions New_APIs/Steam Web API/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
document.getElementById('getProfileButton').addEventListener('click', async () => {
const steamId = document.getElementById('steamId').value;
const response = await fetch(`/getProfile?steamId=${steamId}`);
const result = await response.json();
document.getElementById('results').textContent = JSON.stringify(result, null, 2);
});

document.getElementById('getAchievementsButton').addEventListener('click', async () => {
const gameId = document.getElementById('gameId').value;
const steamId = document.getElementById('steamId').value;
const response = await fetch(`/getAchievements?gameId=${gameId}&steamId=${steamId}`);
const result = await response.json();
document.getElementById('results').textContent = JSON.stringify(result, null, 2);
});
Loading
Loading