Skip to content

Instantly share code, notes, and snippets.

@peter9811
Last active February 28, 2025 14:25
Show Gist options
  • Save peter9811/5cbca1535ed44dcebd5b9bb7dd65d227 to your computer and use it in GitHub Desktop.
Save peter9811/5cbca1535ed44dcebd5b9bb7dd65d227 to your computer and use it in GitHub Desktop.
Code to Add (mass and automatic) Games (by gameIDs) to Steam Wishlist
// 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);
@peter9811
Copy link
Author

peter9811 commented Sep 4, 2024

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

  1. Prepare Your Game IDs:

    • Identify the Steam game IDs you want to add to your wishlist
    • Use only numbers, separated by commas
    • Example IDs in the code are: 1549970, 440, 730
  2. Steps:

    1. Go to Steam's store page in your web browser
    2. Log in to your Steam account
    3. Open Developer Tools:
      • Press F12 or
      • Press Ctrl + Shift + I and click on the "Console" tab
    4. Copy and paste the code into the console and press Enter

Important Notes

  • The script includes error handling for failed requests
  • It uses async/await for proper request handling
  • It includes a rate limiting mechanism to prevent overwhelming Steam's servers
  • Replace the example game IDs with your desired game IDs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment