WebSocket Connection Guide

Open the socket, send your key, and confirm the session before you subscribe.

Endpoint
wss://api.0xarchive.io/ws
Auth
API key on connect

Connection Guide

Open the socket

Connect to wss://api.0xarchive.io/ws with your API key.

const ws = new WebSocket(
"wss://api.0xarchive.io/ws?apiKey=0xa_your_api_key"
);
ws.onopen = () => {
console.log("Connected to 0xArchive WebSocket");
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log("Received:", data);
};

Keep exploring WebSocket