[CustomAPI] faceit last games/matches api

Hi, I created an small faceit (.com) api to retrieve last CSGO matches, elo, last match stats and ladder info given a faceit user name.

Usage examples

!elo
!addcom -cd=5 !elo $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { '$(user), my elo is '+ api.elo +' (Lvl: '+ api.level +')' })

output: Xxx, my elo is 2001 (Lvl: 10)

!elo (short format)
!addcom -cd=5 !elo $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=YOUR_FACEIT_USER); if (!api.error) { 'Lvl: '+ api.level + ' Elo: '+ api.elo })

output: Lvl: 10 Elo: 2001

!elo (with today balance)
!addcom -cd=5 !elo $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?&n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { 'Elo: ' + api.elo +' Today: '+ api.today.elo })

output: Elo: 2426 Today: -24

!last (last matches report)
!addcom -cd=5 !last $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { '$(user) my last matches -> ' + api.report; })

output: Xxx, my last matches -> WIN 16:9 Inferno (+11), LOSE 16:13 Nuke (-24), ...)

!today (recent games win, lose count and accumulated elo)
!addcom -cd=5 !today $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?&n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { 'Today -> Win: ' + api.today.win + ' Lose: ' + api.today.lose + ' Elo: ' + api.today.elo })

output: Today -> Win: 3 Lose: 1 Elo: +50

!playing (currently playing match)
!addcom -cd=5 !playing $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?&n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { if (api.current.present) { '$(user), I\'m playing round '+ api.current.round +' on '+ api.current.map +' for '+ api.current.elo +' elo points. Game duration: '+ api.current.duration +' Server: '+ api.current.server +' Hub: '+ api.current.what} else {'$(user), I\'m playing nothing'}})

output: Xxx, I'm playing round 24 on Mirage for +24/-26 elo points. Game duration: 35' Server: Germany Hub: 5v5 PREMIUM

!playing (short version)
!addcom -cd=5 !playing $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?&n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { '$(user), I\'m playing '+ api.playing })

output: Xxx, I'm playing FaceIt 5v5 FREE, Overpass (Germany), Elo: +22/-28

!stats (stats from the last played match)
!addcom -cd=5 !stats $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { '$(user) my last match stats -> ' + api.last_match })

output: Xxx my last match stats -> Victory on Inferno (16:9), KAD: 12/5/20 KDR: 0.6 HS: 50% MVP: 2 ELO: +11)

!ladder (ladder info)
!addcom -cd=5 !ladder $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { '$(user), I\'m ranked '+ api.ladder })

output: I'm ranked 24 on EU Master League (PTS: 797 W/P: 100/167 WR: 0.6))

!fpl (eu fpl ranking, if playing it)
!addcom -cd=5 !fpl $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { api.fpl })

output: Ranking: 144 (Pts: 1482 WR: 0/2 Last: LOSE 16:9 Mirage)

!hub (user rank on whatever hub you want)
!addcom -cd=5 !hub $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?o=hub&n=YOUR_FACEIT_USER&h=FACEIT_HUB_ID); if (api.error) {api.message;} else { api.hub })

output: Ranking: 144 (Pts: 1482 WR: 0/2 Last: LOSE 16:9 Mirage)

Remember that your FACEIT USER NAME IS CASE SENSITIVE, copy it from faceit.

FACEIT_HUB_ID: only for !hub command example, you can get it from the faceit hub url on the address bar, it’s a value like 74caad23-077b-4ef3-8b1d-c6a2254dfa75 (this is the value for FPL EU, default value) .

Ladder data may won’t be available for players not participating on…

LANGUAGE: Most literals returned by the api can be translated by adding the parameter “&l=LANGUAGE_CODE” to the url. Available language codes are: en (English) no (Norwegian) es (Spanish). If needed, please, ask for your language here.

Examples to get data from any faceit user in your chat (eg: !elo s1mple)

Basically replace YOUR_FACEIT_USER with $(touser) and adapt the text.

Elo command (usage: !elo s1mple)
!addcom -cd=5 !elo $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=$(touser)); if (api.error) {api.message;} else { '$(user), $(touser) elo is '+ api.elo +' (Lvl: '+ api.level +')' })

Last games report (usage: !last s1mple)
!addcom -cd=5 !last $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=$(touser)); if (api.error) {api.message;} else { '$(user) last $(touser) matches -> ' + api.report; })

Last game stats (usage: !stats s1mple)
!addcom -cd=5 !stats $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=$(touser)); if (api.error) {api.message;} else { '$(user) last $(touser) match stats -> ' + api.last_match })

Ladder info (usage: !ladder FlipiN)
!addcom -cd=5 !ladder $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=$(touser)); if (api.error) {api.message;} else { '$(user), $(touser) is ranked '+ api.ladder })

Contact me here if you will find some bugs/errors.

3 Likes

Current api output:

{

"elo": 3202,
"level": "10",
"playing": "FaceIt 5v5 PREMIUM, Vertigo (Netherlands), Elo: +23/-27",
"current": {
    "present": true,
    "elo": "+23/-27",
    "map": "Vertigo",
    "server": "Netherlands",
    "what": "5v5 PREMIUM",
    "status": "LIVE",
    "score": "14:14",
    "result": "drawing"
},
"today": {
    "present": true,
    "count": 2,
    "elo": "+14",
    "elo_win": 35,
    "elo_lose": 21,
    "win": 1,
    "lose": 1
},
"ladder": "1575 on EU Master League (PTS: 81 W/P: 17/36 WR: 0.47)",
"report": "WIN 16:6 Mirage (+35), LOSE 16:6 Vertigo (-21), LOSE 16:8 Inferno (-14), LOSE 10:16 Nuke (-26), WIN 11:16 Nuke (+24)",
"trend": "WLLLW",
"last_match": "Victory on Mirage (16:6), KAD: 11/6/14 KDR: 0.79 HS: 45% MVP: 4 ELO: +35",
"hub": "Position 81 (WR: 1/5 Pts: 1480 Last: LOSE 16:8 Vertigo)",
"error": false

}

Notes:

For backward compatibility “hub” is named “fplc” when no o=hub param is given

1 Like

Hello, is it possible to create command, which will print out possible win/lose elo of current match of certain player?

@Javier_Fernandez
Is there any way you could specify how to set it up? Like, mine always say “player not found”
Faceit ID is: Proxi

@proxi

Elo command (command: !elo)
!addcom -cd=5 !elo $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=Proxi); if (api.error) {api.message;} else { '$(user), my elo is '+ api.elo +' (Lvl: '+ api.level +')' })

Last games report command (command: !last)
!addcom -cd=5 !last $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=Proxi); if (api.error) {api.message;} else { '$(user) my last matches -> ' + api.report; })

Last game stats command (command: !stats)
!addcom -cd=5 !stats $(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?n=Proxi); if (api.error) {api.message;} else { '$(user) my last match stats -> ' + api.last_match })

@fimmer

I gonna try but at this moment I don’t know how to get this data once the match has started.

1 Like

@Javier_Fernandez, thank you my guy!

Is there a way how i can use it for six siege when i play on ps4 username NoVeM_Shotgone

hey, is there someway you can or i can change the output to say: Nederlag på Inferno insteed of: Defeat on Inferno? And how to i input the “trend” in the command?

And, is it possible to make 1 command for all 3^^ So it says, Lvl 10: 2506 and then the last match history and the trend at last?

@f1lskov try this, for instance

$(eval const api = $(urlfetch json http://api.faceit.myhosting.info:81/?l=YOUR_LANGUAGE&n=YOUR_FACEIT_USER); if (api.error) {api.message;} else { '$(user) --> Lvl '+ api.level +': '+ api.elo +' << '+ api.report +' << '+ api.trend +' << Last game stats: ' + api.last_match })

Output example:
Lvl 7: 1696 << LOSE 19:17 Inferno (-25), WIN 10:16 Inferno (+21), WIN 10:16 Mirage (+22), LOSE 16:8 Inferno (-25), LOSE 16:9 Mirage (-25) << LWWLL << Last game stats: Defeat on Inferno (19:17), KAD: 29/3/23 KDR: 1.26 HS: 31% MVP: 6 ELO: -25

You must replace
YOUR_FACEIT_USER by your faceit user id, remember it’s case sensitive.
YOUR_LANGUAGE by your language code (available codes are: Norwegian = no, Spanish = es, English = en)

In this command, where it says “Last game stats” you can rewrite with whatever you want. Everything between single quotes is editable.

Hi there. I’ve added a new command !ladder. Find out how to add it on the first post.

This command will give info about the faceit league, current position, points and win rate.

Posible output for command !ladder
I'm ranked 104 on EU Master League (PTS: 419 W/P: 55/94 WR: 0.59)

@Javier_Fernandez is there any way you can do a “elo + trend” command
output example: Lvl: 10 Elo: 2001 Trend: WWLWL
or
Xxx, my elo is 2001 (Lvl: 10) (Trend: WWLWL)

!fplc aint working it says ‘[Error Connecting To WebEval Service]’ what can i do?

Hello @f4ct_cs.

I’ve fixed to show an “error” message: “[player] is not currently playing FPLC”. When no actively playing fplc games.

The reason is that I can’t have knowledge of the last season you’ve played, so I can only rely on last early games data.

hi, !fplc doesnt work. Bot says that (fplc player name) is not playing FPLC . How to fix it? p.s. i’m inputting correct YOUR_FACEIT_USERБез названия (15)

Is it possible to get a stats command for last 20 matches? the stats faceit enhancer provides just in a twitch command instead?

@Javier_Fernandez I have a javascript function which calculates the stats of the last 20 match statistics. If it is possible, I can give you the script to add this to your API ?

1 Like

I fixed fplc data some week ago.

@dietze if you still have this I can try to include it. Sounds good. I’ve added cache system so I stopped mashing up faceit and wherever I get data.

I’m sorry for the big delay but I fixed this in last weeks. I’ve included an option to get the user ranking from any faceit hub, specifying it’s faceit hub id.

So if you still have this need you’ll get this info from FPL, FPLC or whatever hub you need.

Just give look to the main post.

Finally I found the way and the api returns this data on field api.playing.elo, give a look to the second post.

Also I added to the main post a new suggested !playing command with data about the currently playing match.

Added !today command with recent consecutive matches resume of wins, loses and elo balance.

I’ve also added detailed data of current match so you can play with and create your own customized output.