-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoints.py
More file actions
44 lines (39 loc) · 1.39 KB
/
endpoints.py
File metadata and controls
44 lines (39 loc) · 1.39 KB
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
#!/usr/bin/env python3
# endpoints.py
# ----------------------------------------------------------------------------
# Author: Nicholas Price
# Last Modified: 4/3/2023
# version '1.0.0'
# ---------------------------------------------------------------------------
# Description
# This file documents the endpoints interacted with. The main purpose of this
# documentation is to allow for easy changes for any API updates or to
# add/subtract endpoints in the future.
# ---------------------------------------------------------------------------
faceit2014hubID = '6439e8de-340a-4325-b02f-9fe1758b9de8'
faceitapi = 'https://open.faceit.com/data/v4'
##### Hubs #####
# Retrieve hub details
def getHubDetails(hubID=faceit2014hubID):
return faceitapi + '/hubs/' + hubID
# Retrieve all matches of a hub
def getHubMatches(hubID):
return getHubDetails(hubID) + '/matches'
# Retrieve all members of a hub
def getHubMembers(hubID):
return getHubDetails(hubID) + '/members'
# Retrieve statistics of a hub
def getHubStatistics(hubID):
return getHubDetails(hubID) + '/stats'
##### Matches #####
# Retrieve match details
matches = faceitapi + '/matches'
# Retrieve Match Statistics
def matchStats(match):
return matches + '/' + match + '/stats'
##### Players #####
# Retrieve player details
player = faceitapi + '/players'
# Retrieve player details
def playerByID(playerID):
return player + '/' + playerID