Skip to content

Commit

Permalink
Steam Web API
Browse files Browse the repository at this point in the history
  • Loading branch information
sreevidya-16 committed Aug 10, 2024
1 parent 0815fe5 commit 9e90ee4
Show file tree
Hide file tree
Showing 7 changed files with 973 additions and 0 deletions.
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

0 comments on commit 9e90ee4

Please sign in to comment.