Arcfeed Docs
arcfeed.finance ↗

Quickstart

Stream your first trades in three steps. Select your language above to see the relevant commands and code.

Step 1 — Install the client library

Install the Arcfeed protobuf package and the gRPC/Connect client for your language:

typescript
npm install @connectrpc/connect @connectrpc/connect-node @arcfeed-dev/protobuf

Step 2 — Create a client

Connect to stream.arcfeed.finance:443 and attach your API token to every request:

typescript
import { createClient } from '@connectrpc/connect';
import { createGrpcTransport } from '@connectrpc/connect-node';
import { StreamService } from '@arcfeed-dev/protobuf/gen/es/streamservice/v1/stream_pb';

const transport = createGrpcTransport({
  baseUrl: 'https://stream.arcfeed.finance',
  httpVersion: '2',
  interceptors: [
    (next) => async (req) => {
      req.header.set('Authorization', 'YOUR_API_TOKEN');
      return next(req);
    }
  ]
});

const client = createClient(StreamService, transport);

Replace YOUR_API_TOKEN with the token from your arcfeed.finance dashboard.

Step 3 — Subscribe and receive trades

Call streamData with a filter specifying the trading pairs you want. Each StreamDataResponse contains a trade with price, quantity, and timestamp (Unix nanoseconds), plus top-level pair and source fields:

typescript
const stream = client.streamData({
  filter: [{ pair: 'BTC-USDT' }]
});

for await (const response of stream) {
  const { trade, pair, source } = response;
  if (trade) {
    console.log(`[${source}] ${pair}: ${trade.price} x ${trade.quantity}`);
    // Convert nanoseconds to milliseconds
    const ms = Number(trade.timestamp) / 1_000_000;
    console.log('  at', new Date(ms).toISOString());
  }
}

The filter array accepts up to 100 entries. Each entry can filter by pair (e.g. BTC-USDT), by source (exchange identifier), or both. An empty filter array streams all pairs from all sources.

Next steps