# Market Data & Real-Time

## Market Data & Real-Time

*REST snapshots plus live streaming*

Search instruments, read rates, candles, historical closes, exchanges, industries, and instrument metadata over REST — then subscribe to WebSocket topics for live prices and market events with authenticate / subscribe / unsubscribe flows.

### What it provides

- Search instruments by name, symbol, or category with full metadata and classification
- Fetch current rates, bid/ask spreads, and percent-change data for any instrument
- Retrieve OHLC candles and historical closing prices for charting and analysis
- Browse instrument types, exchanges, industries, and detailed metadata
- WebSocket connection to `wss://ws.etoro.com/ws` with topic-based subscriptions
- Push updates for real-time dashboards and alerting without polling

### What you can build

- Instrument screeners and discovery UIs with search, filtering, and classification
- Live price tickers and candlestick charts combining REST snapshots with WebSocket streams
- Alert engines that fire on price thresholds, volume spikes, or percent-change triggers
- Analytics pipelines processing streaming market events for sentiment or momentum signals
- Custom watchlist dashboards with real-time price cards and sparklines

### Builder journeys

- Personal investing
- Build apps & automations
- Enterprise integrations

### Recommended tools

- [WebSocket Playground](/playground/websocket) — Connect to live streams — test subscriptions, candles, and quote events in real time.
- [WebSocket guide](/learn/real-time-market-data-websocket) — Subscribe to price feeds, handle reconnections, and process streaming data.
- [REST Playground](/playground) — Query instruments, rates, and candle history with the REST API explorer.

### Code examples

#### cURL

```bash
curl "https://public-api.etoro.com/api/v1/market-data/rates?instrumentIds=1001,1002,1003" \
  -H "x-api-key: $ETORO_API_KEY" \
  -H "x-user-key: $ETORO_USER_KEY" \
  -H "x-request-id: $(uuidgen)"
```

#### JavaScript

```javascript
const ids = [1001, 1002, 1003];
const res = await fetch(
  `https://public-api.etoro.com/api/v1/market-data/rates?instrumentIds=${ids.join(",")}`,
  {
    headers: {
      "x-api-key": process.env.ETORO_API_KEY,
      "x-user-key": process.env.ETORO_USER_KEY,
      "x-request-id": crypto.randomUUID(),
    },
  }
);

const { rates } = await res.json();
for (const rate of rates) {
  console.log(`${rate.symbol}: ${rate.lastPrice} (${rate.change}%)`);
}
```


### Learn & docs

- [Getting Started with the eToro API](/learn/getting-started-with-etoro-api-v2) — Keys, first requests, and response formats.
- [Real-Time Market Data with WebSockets](/learn/real-time-market-data-websocket) — Connect, reconnect, and process streaming data.
- [Instrument Discovery Guide](/blog/developers-guide-to-instrument-discovery) — Explore the instrument catalog programmatically.
- [Building a Real-Time Price Dashboard](/blog/building-a-real-time-price-dashboard) — Combine WebSocket and Market Data for live dashboards.