{"_id":"56acecb32a7860170013f6e9","githubsync":"","parentDoc":null,"version":{"_id":"56acd71213ac890d001c3c7d","project":"56acd71213ac890d001c3c7a","__v":15,"createdAt":"2016-01-30T15:30:26.928Z","releaseDate":"2016-01-30T15:30:26.928Z","categories":["56acd71313ac890d001c3c7e","56acd8f113ac890d001c3c81","56acd8f95ac4060d0027865e","56acd93a13ac890d001c3c82","56ad20660ab3c00d00ce3347","56ad356a2a7860170013f714","56ad47eb0ab3c00d00ce334f","56afd523bc304a0d00ace1df","56b29a019621f20d00efb37e","56b657e11bc6970d009feee7","5845cc3c39950c1b002afe77","5845cde163c11b250037967e","5846efd45d064323007b17b4","588604da4674e32300efd160","588627882393d50f00f1322c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":1,"project":"56acd71213ac890d001c3c7a","category":{"_id":"56acd8f113ac890d001c3c81","__v":6,"pages":["56acecb32a7860170013f6e9","56acedfed21f1b0d00fd2f70","56aceedb5ac4060d0027866d","56acef31693f0a0d0085f0ab","56acf23d2a7860170013f6f3","56ad4b89c00d120d00744353"],"project":"56acd71213ac890d001c3c7a","version":"56acd71213ac890d001c3c7d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-30T15:38:25.293Z","from_sync":false,"order":8,"slug":"singularity","title":"Singularity"},"user":"56acd6caa040860d00ac94a2","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-30T17:02:43.589Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Who should use Singularity?\",\n  \"body\": \"Singularity is a real-time API powered by WebSockets. It's ideal for bots, alert applications, or other programs that require real-time updates about GameWisp channels.\"\n}\n[/block]\nThe Singularity API is real-time API that is meant to be interacted with using WebSockets. Clients connect to the API and listen to specific events of interest and receive data from the API in real-time. **Unlike a conventional REST API, there is no need to repeatedly poll or request on specific endpoints.**. This API is ideal for bots and other services that require immediate and on-going access to GameWisp data; however, request functionality (see: On-Demand Events ) is also included such that data can be provided to clients on-demand when necessary.\n\nCurrently, the Singularity API is read only. Connected clients can receive data in real-time, but can perform no operation which alters the state of any data stored by GameWisp.\n\nFully functional [examples](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples) of using the API can be found here:\n* [Client](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples/SocketIO-client-app) - A single page application with minimal dependencies that interacts with Singularity directly in the browser.\n* [Server](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples/SocketIO-server-app) - A NodeJS server that communicates with Singularity.\n* [TwitchBot](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples/Twitch-bot) - A NodeJS server application that passes data from Singularity into a Twitch channel’s chat.","excerpt":"The basics of the Singularity Real-Time API","slug":"introduction","type":"basic","title":"Introduction"}

Introduction

The basics of the Singularity Real-Time API

[block:callout] { "type": "info", "title": "Who should use Singularity?", "body": "Singularity is a real-time API powered by WebSockets. It's ideal for bots, alert applications, or other programs that require real-time updates about GameWisp channels." } [/block] The Singularity API is real-time API that is meant to be interacted with using WebSockets. Clients connect to the API and listen to specific events of interest and receive data from the API in real-time. **Unlike a conventional REST API, there is no need to repeatedly poll or request on specific endpoints.**. This API is ideal for bots and other services that require immediate and on-going access to GameWisp data; however, request functionality (see: On-Demand Events ) is also included such that data can be provided to clients on-demand when necessary. Currently, the Singularity API is read only. Connected clients can receive data in real-time, but can perform no operation which alters the state of any data stored by GameWisp. Fully functional [examples](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples) of using the API can be found here: * [Client](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples/SocketIO-client-app) - A single page application with minimal dependencies that interacts with Singularity directly in the browser. * [Server](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples/SocketIO-server-app) - A NodeJS server that communicates with Singularity. * [TwitchBot](https://github.com/GameWisp/GameWisp-Singularity-Examples/tree/master/examples/Twitch-bot) - A NodeJS server application that passes data from Singularity into a Twitch channel’s chat.