
Check out the source code and don’t forget to drop a star EZ Clap
Chess.com [rating]
Given a username, this API will retrieve the user ratings on chess.com as plain text, meant to be used with chat bots
Example: 0ms
API Usage
Call the API directly
curl -X GET 'https://darckfast.com/api/chess' \
--url-query 'username=MagnusCarlsen' \
--url-query 'message=Magnus Carlsen current rating on rapid: =rapid, bullet: =bullet, blitz: =lightning'
Parameter | Description | required |
---|---|---|
username | Username on chess.com | ✅ Yes |
message | The ratings will be replaced within the message, according to its template. The current template keys available are: =chess , =lightning , =tactics , =rapid , =tactics_challenge and =bullet . | ✅ Yes |
In case of error, or if some parameter is missing, a error message be returned with 200 HTTP status code
ops, something went wrong
Browser
The API can also be called within the browser
let rating = await fetch("https://darckfast.com/api/chess?username=MagnusCarlsen&message=Magnus%20Carlsen%20current%20rating%20on%20rapid%3A%20%3Drapid%2C%20bullet%3A%20%3Dbullet%2C%20blitz%3A%20%3Dlightning")
.then(r => r.text())
CORS is enabled by default, and it is returned according to the
Origin
header. Only requests over HTTPS with TLS 1.1 or higher are supported
Integration
Code snippets to help integrate with some chatbots
StreamElements
Add a custom command using the ${customapi.url}
, like the example bellow
${customapi.https://darckfast.com/api/chess?username=chess_com_username&message=$(queryescape "current rating on rapid: =rapid and puzzles: =tactics")}
NightBot
Add a custom command using the $(urlfetch url)
, like the example bellow
$(urlfetch https://darckfast.com/api/chess?username=chess_com_username&message=$(querystring "current rating on rapid: =rapid and puzzles: =tactics"))
FossaBot
Add a custom command using the $(customapi url)
, like the example bellow
$(customapi https://darckfast.com/api/chess?username=chess_com_username&message=$(querystring "current rating on rapid: =rapid and puzzles: =tactics"))
MooBot
Create a URL-Fetch
command, like the example bellow
https://darckfast.com/api/chess?username=chess_com_username&message="current rating on rapid: =rapid and puzzles: =tactics"