NightDev Community Forums

[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

!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), ...)

!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))

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

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.

Ladder data may not be available for active PRO players like s1mple cause they don’t participate.

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

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.

Current api output:

{

"elo": 1903,
"level": "9",
"ladder": "63 on EU Gold League (PTS: 80 W/P: 7/9 WR: 0.78)",
"report": "WIN 16:8 Inferno (+25), WIN 16:8 Mirage (+28), LOSE 16:11 Vertigo (-31), WIN 8:16 Inferno (+24), LOSE 19:22 Dust II (-26)",
"trend": "WWLWL",
"last_match": "Victory on Inferno (16:8), KAD: 30/2/13 KDR: 2.31 HS: 30% MVP: 6 ELO: +25",
"error": false

}

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.

@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 at this moment !fplc command is intended to work only while fplc is active, that’s when the player has an fplc game in his last 5 games.

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)