Does bitstamp have a public websocket/streaming API?
Also, are there any request limits to usual API?
Yes:
var trades_socket = io.connect('https://websocket.bitstamp.net:8080/live_trades');
var orders_socket = io.connect('https://websocket.bitstamp.net:8080/live_orders');
Yes:
up to 1 per second
How do we use the Socket.IO API? There doesn't seem to be happening much besides a connected message when using this:
<script src="https://websocket.bitstamp.net:8080/socket.io/socket.io.js"></script>
<script>
var conn = io.connect('https://websocket.bitstamp.net:8080/live_trades');
conn.on('connect', function() {
alert('Connected!');
});
conn.on('disconnect', function() {
alert('Disconnected!');
});
conn.on('message', function(data) {
alert('Got Something!');
});
conn.on('anything', function(data) {
alert('Got Something!');
});
conn.on('error', function() {
alert('Got Error!');
});
</script>
Change your conn.on('message', to conn.on('trade'.
I'd really like to see non-https access to websocket too. I have problems using ruby gems to create a connection.