forked from alfredocdmiranda/igdb-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
49 lines (42 loc) · 1022 Bytes
/
example.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
#from ig import igdb
#from igdb_api_python import igdb
from igdb_api_python.igdb import igdb as igdb
import time, os
#ENTER YOUR KEY HERE
igdb = igdb(os.environ['api_key'])
#RETRIEVE ONE GAME
result = igdb.games(1942)
for game in result:
print("Retrieved: " + game["name"])
#Get information about ,multiple games
result = igdb.games({
'ids':[27193,23212,1942]
})
#Get information about ,multiple games
result = igdb.pulses(25039)
#GET PLAYSTATION GAMES
result = igdb.platforms({
'ids':42,
'fields' : 'games'
})
#GET PLAYSTATION GAMES
result = igdb.platforms({
'ids':42,
'fields' : ['games','name']
})
#GET COMING SOOM PLAYSTATION 4 GAMES
result = igdb.release_dates({
'filters' :{
"[platform][eq]": 48,
"[date][gt]" : int(round(time.time() * 1000))
},
'order':"date:asc",
'fields':"game"
})
# 5 game companies with name descending and offset of 5
result = igdb.companies({
'fields': 'name',
'limit': 5,
'offset': 5,
'order': 'name:desc'
})