Elaborate on what data is available through the web interface #23
Replies: 1 comment
-
Hi @rdvAndroid The root :; curl http://127.0.0.1:1080/api
[
{
"athletes": "[GET] Information for all active athletes",
"athletes/<id>": "[GET] Information for specific athlete",
"athletes/self": "[GET] Information for the logged in athlete",
"athletes/watching": "[GET] Information for athlete being watched",
"nearby": "[GET] Information for all nearby athletes",
"groups": "[GET] Information for all nearby groups",
"rpc/<name>": "[POST] Make an RPC call into the backend. Content body should be JSON Array of arguments"
}
] And then... :; curl http://127.0.0.1:1080/api/athletes/watching
{
"athleteId": 5052891,
"athlete": {
"id": 5052891,
"updated": 1665369864343,
"name": [
"J",
"M"
],
"fullname": "J M",
"sanitizedName": [
"J",
"M"
],
"sanitizedFullname": "J M",
"initials": "JM",
"firstName": "J",
<clipped> The RPC calls are more complicated and I don't document the arguments but they work by POSTing a JSON array which corresponds to the arguments list of the respective function. You're best bet for those is to to poke around the UI code in The websocket is your friend too, but that's probably too complicated to try and unravel here. However I did write a simple python client that will hopefully be somewhat self explanatory: https://github.com/SauceLLC/sauce4zwift-python-client And finally, the code you seek: The code you seek: Lines 194 to 256 in 83a55a5 |
Beta Was this translation helpful? Give feedback.
-
I see in the readme "Web server access to all the widgets" and the Sauce's Zwift insider article "S4Z includes a web server that spits out data in standard formats to a local URL".
Where can I find out what specific data is exposed and other details about this feature? Also direct me please to that code in this repository so I can answer further questions for myself and not bother you further? I am familiar with JS and get/post processing so that feature has sparked my curiosity.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions