Steam API all games
Asked Answered
J

4

36

I've been reading forums and trying Steam APIs, I'm searching for an API which provides all Steam Games.

I found the API providing all SteamApps, and the Steam Store API which provides information for Apps (I'm looking for the type: 'game'), but for this, I need to call the store API once for each SteamApp... And the Store API is limited to 200 calls every 5 minutes! Is it the only solution?

EDIT:

All Apps API : http://api.steampowered.com/ISteamApps/GetAppList/v0002/?key=STEAMKEY&format=json

App details API : http://store.steampowered.com/api/appdetails?appids={APP_ID}

Jovi answered 20/9, 2017 at 20:1 Comment(0)
B
13

There is no "Steam API all games and all their details in one go".

You use GetAppList to get all the steam apps. Then you have to query each app with appdetails which will take a long time.

{
  "applist": {
    "apps": [
      {"appid": 10, "name": "Counter-Strike"},
      {"appid": 20, "name": "Team Fortress Classic"},
      {"appid": 30, "name": "Day of Defeat"},
      {"appid": 40, "name": "Deathmatch Classic"}
    ]
  }
}
{
  "10": {
    "success": true, 
    "data": {
      "type": "game",
      "name": "Counter-Strike",
      "steam_appid": 10,
      "required_age": 0,
      "is_free": false,
      "detailed_description": "...",
      "about_the_game": "...",
      "short_description": "...",
      "developers": ["Valve"],
      "publishers": ["Valve"],
      "EVEN_MORE_DATA": {}
    }
  }
}

There is a general API rate limit for each unique IP adress of 200 requests in five minutes which is one request every 1.5 seconds.

Another solution would be to use a third-party service such as SteamApis which offers more options but they are inevitably bound to what Steam offers in their API.

Berm answered 27/6, 2020 at 0:44 Comment(1)
SteamApis third party is not providing data covering all games of Steam, but only the games that have a marketplace of items. Also they don't provide all data you could get from official Steam API, like, as a example, tags.Zambia
G
6

A common method here is to cache the results.

So for example, if your using something like PHP to query the results, you would do something like json_encode and json_decode with an array / object to hold the last results.

You can get fancy depending on what you want, but basically you'll need to cache and then perform an update of the oldest.

Gerthagerti answered 25/3, 2019 at 16:51 Comment(1)
I actually did this recently to gather a collection of linux compatible games, Took around 4 days from memory. Tho i saved each initial ID into a SQL database ready for populate so i was able to use the update timestamps easily to determine the oldest.Gerthagerti
C
1

I created a small script that might be helpful. It allows you to get all the games you own, along with some sorting.

https://github.com/ghasani/steam_sorter/blob/main/steam_sorter.py

import requests
import pandas as pd

USER_API_KEY = 'INSERT STEAM API KEY'
USER_STEAM_ID = 'INSERT STEAM ID'

api = 'https://api.steampowered.com/ISteamApps/GetAppList/v2/'
res = requests.get(url=api)
dict = res.json()['applist']['apps']
data_clean = {}
for game in dict:
    data_clean[game['appid']] = game['name']

def get_name(id):
    return data_clean[id]

def get_score(id):
    data = requests.get(f'https://store.steampowered.com/appreviews/{id}?json=1').json()['query_summary']
    score = data['total_positive']/data['total_reviews']
    return score

user_url = f'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={USER_API_KEY}&steamid={USER_STEAM_ID}&format=json'
user_game_data = requests.get(url=user_url).json()

games_owned_id = []
for result in user_game_data['response']['games']:
    games_owned_id.append(result['appid'])

my_games_and_user_scores = {}
for game_id in games_owned_id:
    try:
        my_games_and_user_scores[get_name(game_id)] = get_score(game_id)
    except:
        pass

df = pd.DataFrame(my_games_and_user_scores.items(), columns=('Game', 'User Score'))
df.sort_values(by=('User Score'), inplace=True, ascending=False, ignore_index=True)

df.to_csv('~/Desktop/mygames.csv')
Crackerbarrel answered 25/9, 2023 at 8:11 Comment(0)
O
0

There's the IStoreService/GetAppList endpoint of the Steam Web API which gives information similar to ISteamApps/GetAppList, but at least it's filterable, e.g. to get all games only:

https://api.steampowered.com/IStoreService/GetAppList/v1/?key={your api key}&include_games=true&include_dlc=false&include_software=false&include_videos=false&include_hardware=false

Note: you'll probably need to paginate results as there's a maximum of 50k items per page.

Oca answered 2/5 at 12:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.