Preview:
// alpaca-api.js

// Import websocket libraries
const Websocket = require('ws');
const ReconnectingWebSocket = require('reconnecting-websocket');
// set up the Alpaca stream endpoint
const ALPACA_STREAM_URL = "wss://paper-api.alpaca.markets/stream";
// get the access_token from your OAuth Login function
const { access_token } = loginAlpaca();
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter