Last active
February 28, 2025 14:25
-
-
Save peter9811/5cbca1535ed44dcebd5b9bb7dd65d227 to your computer and use it in GitHub Desktop.
Code to Add (mass and automatic) Games (by gameIDs) to Steam Wishlist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your Steam game IDs | |
var gameIDs = [1549970, 440, 730]; // Replace with your game IDs | |
// Get the session ID from cookies | |
var sessionID = document.cookie.match(/sessionid=([^;]+)/)[1]; | |
// Function to add games to the wishlist | |
async function addToWishlist(gameIDs) { | |
for (let i = 0; i < gameIDs.length; i++) { | |
let appID = gameIDs[i]; | |
await fetch('https://store.steampowered.com/api/addtowishlist', { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/x-www-form-urlencoded' | |
}, | |
body: `appid=${appID}&sessionid=${sessionID}` | |
}).then(response => { | |
if (response.ok) { | |
console.log(`Added appID: ${appID} to wishlist`); | |
} else { | |
console.error(`Failed to add appID: ${appID}`); | |
} | |
}).catch(error => console.error(`Error adding appID: ${appID}`, error)); | |
await new Promise(resolve => setTimeout(resolve, 150)); // Delay to avoid triggering rate limits | |
} | |
console.log('All games processed'); | |
} | |
// Start the process | |
addToWishlist(gameIDs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add Games to Steam Wishlist Script
Description
This JavaScript code allows users to automatically add multiple games to their Steam wishlist by using their game IDs. The script fetches the user's session ID from cookies and makes POST requests to Steam's wishlist API for each game ID provided.
Usage Instructions
Prepare Your Game IDs:
Steps:
Important Notes