Skip to content

Instantly share code, notes, and snippets.

View IRGC's full-sized avatar
🏠
Working from home

IRGC

🏠
Working from home
View GitHub Profile
@bitgord
bitgord / Intro-Bitfinex-API-Websockets
Created December 10, 2016 21:11
Get Bitfinex API data with Websockets
// First go to http://docs.bitfinex.com and click on the websockets tab
// Scroll down and find the SSL websocket connection URL
For example: wss://api.bitfinex.com/ws
// In a new Javascript file create a variable for new websocket
var ws = new WebSocket('wss://api.bitfinex.com/ws');
// Create function to send on open
ws.onopen = function() {
ws.send(JSON.stringify({"event":"subscribe", "channel":"ticker", "pair":"BTCUSD"}));