{"_id":"564b851685e4e92b00fb4fa2","category":{"_id":"55773b0407e7110d001043f1","project":"55773a5ba042551900b002cb","pages":["564b851685e4e92b00fb4fa2","564b853adda79a19000f2670","564b8548cc472d0d00da945b"],"version":"55773a5ba042551900b002ce","__v":3,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-09T19:14:12.710Z","from_sync":false,"order":13,"slug":"streaming-api","title":"Streaming API"},"__v":15,"version":{"_id":"55773a5ba042551900b002ce","project":"55773a5ba042551900b002cb","__v":18,"createdAt":"2015-06-09T19:11:23.764Z","releaseDate":"2015-06-09T19:11:23.764Z","categories":["55773a5ca042551900b002cf","55773a6ce6063e0d00481380","55773ab007e7110d001043ec","55773abaa042551900b002d5","55773ac207e7110d001043ed","55773acb07e7110d001043ee","55773ad3a042551900b002d6","55773adce6063e0d00481383","55773ae4a042551900b002d7","55773af307e7110d001043ef","55773af907e7110d001043f0","55773b0407e7110d001043f1","563a4f7ad25e8919005f3f39","563a4fcaa19edf0d00972321","564a70dc4cd0521700523edf","564b797bcc472d0d00da9435","564b855b766d4923004e1fd1","59cd4b81935249001c77c48e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Motherboard","version_clean":"1.0.0","version":"1"},"user":"546d17e2eb9cfd1400dd4529","parentDoc":null,"githubsync":"","project":"55773a5ba042551900b002cb","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-17T19:50:46.437Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The **Streaming API** allows developers to integrate real-time streaming data into their applications. Live timing and twitter commentary are delivered via a websocket connection for all supported live events.\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/NZO6n5mSqqYHfjlr51lg_del_4379.jpg\",\n \"del_4379.jpg\",\n \"1036\",\n \"690\",\n \"#7b7841\",\n \"\"\n ],\n \"caption\": \"Stream live data directly into your application\"\n }\n ]\n}\n[/block]\nThe websocket endpoint for all connections is **wss://socket.api.triathlon.org**. The Websocket echo test can be used for debugging. The Streaming API currently does not require any authentication and any usage is subject to the general [terms and conditions](http://google.com).\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Usage with Live REST API\"\n}\n[/block]\nThe Streaming API complements the [Live API](https://developers.triathlon.org/docs/live-api-overview) in that the Live API is generally used to load an initial state and then all future updates are obtained via the Streaming API. \n\nFor example for live timing data, data is only pushed at periodic intervals corresponding to timing interactions therefore to avoid delay in displaying timing data you should first load the [/live/timing](https://developers.triathlon.org/docs/live-timing-1) data and update this data from the streaming API.\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Websocket Libraries\"\n}\n[/block]\n**Javascript**\nFor front-end Javascript applications we recommend the [ReconnectingWebSocket library](https://github.com/joewalnes/reconnecting-websocket) which will handle the reconnection of the websocket should a client become disconnected.","excerpt":"","slug":"streaming-api-overview","type":"basic","title":"Streaming API Overview"}

TriathlonLive API

Streaming API Overview

The **Streaming API** allows developers to integrate real-time streaming data into their applications. Live timing and twitter commentary are delivered via a websocket connection for all supported live events.
[block:image]
{
"images": [
{
"image": [
"https://files.readme.io/NZO6n5mSqqYHfjlr51lg_del_4379.jpg",
"del_4379.jpg",
"1036",
"690",
"#7b7841",
""
],
"caption": "Stream live data directly into your application"
}
]
}
[/block]
The websocket endpoint for all connections is **wss://socket.api.triathlon.org**. The Websocket echo test can be used for debugging. The Streaming API currently does not require any authentication and any usage is subject to the general [terms and conditions](http://google.com).
[block:api-header]
{
"type": "basic",
"title": "Usage with Live REST API"
}
[/block]
The Streaming API complements the [Live API](https://developers.triathlon.org/docs/live-api-overview) in that the Live API is generally used to load an initial state and then all future updates are obtained via the Streaming API.
For example for live timing data, data is only pushed at periodic intervals corresponding to timing interactions therefore to avoid delay in displaying timing data you should first load the [/live/timing](https://developers.triathlon.org/docs/live-timing-1) data and update this data from the streaming API.
[block:api-header]
{
"type": "basic",
"title": "Websocket Libraries"
}
[/block]
**Javascript**
For front-end Javascript applications we recommend the [ReconnectingWebSocket library](https://github.com/joewalnes/reconnecting-websocket) which will handle the reconnection of the websocket should a client become disconnected.