Small Faceit (.com) api to retrieve last CS2 matches, elo, last match stats, live match data, ladder and hub info given a faceit user name.
Last update: added secured url with a new domain faceit.lcrypt.eu (the old one will remain working).
Usage examples
!elo
!addcom -cd=5 !elo $(eval const api = $(urlfetch json https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?&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 https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?&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 https://faceit.lcrypt.eu/?&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 https://faceit.lcrypt.eu/?&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 https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?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, this command is outdated, use !hub command below)
!addcom -cd=5 !fpl $(eval const api = $(urlfetch json https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?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ā¦ Iāve added ladder detailed data, so you can create more flexible commands fitting your needs. Check the second post to find out the available detailed data.
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 https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?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 https://faceit.lcrypt.eu/?n=$(touser)); if (api.error) {api.message;} else { '$(user), $(touser) is ranked '+ api.ladder })
Contact me here if you will find some bugs/errors.