Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.4casters.io/llms.txt

Use this file to discover all available pages before exploring further.

The 4casters streaming API delivers real-time user and market updates over a raw WebSocket connection.

Endpoints

  • User feed: wss://streaming-api.4casters.io/v2/user
  • Price feed: wss://streaming-api.4casters.io/price-stream

Auth

Both feeds authenticate with a 4Casters token. Send the token in the Authorization header on the WebSocket handshake. The server derives the user from the token — no username in the URL.

Get a token

Log in with your 4Casters username and password by calling the /user/login endpoint of the 4Casters REST API. The response includes a token you can use here. See POST /user/login in the 4Casters REST API docs.

Connect

const WebSocket = require('ws');
const token = process.env.FOURCASTERS_TOKEN;
const ws = new WebSocket('wss://streaming-api.4casters.io/v2/user', {
  headers: { Authorization: token },
});