-
Notifications
You must be signed in to change notification settings - Fork 0
/
userapi.py
54 lines (40 loc) · 1.12 KB
/
userapi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
"""
Author: Aycan Katitas
Date: 05/13/2023
Description: Learning how to use steam api
"""
import requests
#KEY = <YOUR_KEY_HERE>
ID = '76561199505328285'
ID = '76561197960435530'
ID = '76561198119266856'
# Get owned games
slink1 = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key="
slink2 = "&steamid=" + ID + "&format=json"
slink = slink1 + KEY + slink2
r = requests.get(slink)
print(r.status_code)
steam=r.json()
print(steam)
# Get player summaries
slink1 = "https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key="
slink2 = "&steamids=" + ID
slink= slink1 + KEY + slink2
r = requests.get(slink)
print(r.status_code)
# Get friend list
slink1 = "http://api.steampowered.com/ISteamUser/GetFriendList/v001/?key="
slink2 = "&steamid=" +ID
slink = slink1 + KEY + slink2
r = requests.get(slink)
print(r.status_code)
steam=r.json()
print(steam)
slink1 = "https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key="
slink2 = "&steamid=" + ID + "&format=json"
slink = slink1 + KEY + slink2
r = requests.get(slink)
print(r.status_code)
steam = r.json()
print(steam)