API Documentation

Complete reference for the Jaaz Feed real-time and historical market data APIs.

Overview

Jaaz Feed provides real-time and historical market data via WebSocket and REST APIs. Stream live forex, metals, and crypto ticks over WebSocket, or fetch historical candles and ticks via REST.

All endpoints require authentication via API key. Data is delivered in JSON format with sub-millisecond latency from our binary tick storage engine.

Base URL: All REST endpoints use https://feed.jaazmarkets.net as the base URL. WebSocket connections use wss://feed.jaazmarkets.net.

Authentication

Every request to the Jaaz Feed API must include a valid API key. API keys are generated from your dashboard and are scoped to your account and plan.

REST API Authentication

Pass your API key in the x-api-key header with every HTTP request:

HTTP Header
x-api-key: YOUR_API_KEY

WebSocket Authentication

Pass your API key as a query parameter when establishing the WebSocket connection:

WebSocket URL
wss://feed.jaazmarkets.net/ws/feed?apiKey=YOUR_API_KEY
Security: Keep your API key secret. Do not expose it in client-side code or public repositories. If your key is compromised, regenerate it immediately from the dashboard.

WebSocket API

The WebSocket API provides real-time streaming tick data. After connecting and authenticating, subscribe to symbols to begin receiving price updates.

Connection

WebSocket
wss://feed.jaazmarkets.net/ws/feed?apiKey=YOUR_API_KEY

Subscribe to Symbols

Send a subscribe message after connection is established:

JSON
{
  "action": "subscribe",
  "symbols": ["EURUSD", "GBPUSD", "XAUUSD"]
}

Unsubscribe from Symbols

JSON
{
  "action": "unsubscribe",
  "symbols": ["EURUSD"]
}

Tick Message

Once subscribed, you will receive tick messages for each price update:

JSON — Tick
{
  "type": "tick",
  "symbol": "EURUSD",
  "bid": 1.08523,
  "ask": 1.08535,
  "spread": 0.00012,
  "timestamp": 1710600000000
}

Heartbeat

The server sends a heartbeat every 30 seconds to keep the connection alive:

JSON — Heartbeat
{
  "type": "heartbeat",
  "timestamp": 1710600030000
}
Connection Limits: The number of concurrent WebSocket connections is enforced per your plan tier. Exceeding the limit will result in a 403 error on connection.

REST API

The REST API provides access to symbol metadata, latest prices, and historical candle/tick data. All responses are JSON.

GET /api/v1/symbols

Returns a list of all available symbols with their specifications.

Response
{
  "symbols": [
    {
      "symbol": "EURUSD",
      "category": "forex",
      "digits": 5,
      "pipSize": 0.0001,
      "contractSize": 100000
    },
    {
      "symbol": "XAUUSD",
      "category": "metals",
      "digits": 2,
      "pipSize": 0.01,
      "contractSize": 100
    }
  ]
}
GET /api/v1/prices

Returns the latest bid/ask prices for all available symbols.

Response
{
  "prices": [
    {
      "symbol": "EURUSD",
      "bid": 1.08523,
      "ask": 1.08535,
      "spread": 0.00012,
      "timestamp": 1710600000000
    }
  ]
}
GET /api/v1/prices/:symbol

Returns the latest price for a specific symbol.

Example
GET /api/v1/prices/EURUSD
GET /api/v1/candles/:symbol

Returns historical OHLCV candle data for a symbol. Supported timeframes: M1, M5, M15, M30, H1, H4, D1.

Query Parameters

ParameterTypeRequiredDescription
timeframestringYesCandle timeframe (M1, M5, M15, M30, H1, H4, D1)
fromstringNoStart date (ISO 8601, e.g. 2024-01-01)
tostringNoEnd date (ISO 8601, e.g. 2024-01-02)
limitintegerNoMax candles to return (default 500, max 1000)
Response
{
  "candles": [
    {
      "timestamp": 1710547200000,
      "open": 1.08450,
      "high": 1.08623,
      "low": 1.08410,
      "close": 1.08523,
      "volume": 1245.50,
      "tickCount": 3842
    }
  ]
}
GET /api/v1/ticks/:symbol

Returns historical tick data for a symbol.

Query Parameters

ParameterTypeRequiredDescription
fromstringNoStart date (ISO 8601)
tostringNoEnd date (ISO 8601)
limitintegerNoMax ticks to return (default 1000, max 5000)
Response
{
  "ticks": [
    {
      "timestamp": 1710600000123,
      "bid": 1.08523,
      "ask": 1.08535
    }
  ]
}

Rate Limits

Rate limits are enforced per API key based on your subscription plan. WebSocket connections and REST API calls have separate limits.

PlanWebSocket ConnectionsSymbolsHistory API Calls/DayPrice
Basic110100$99/mo
Pro3501,000$299/mo
Enterprise10UnlimitedUnlimited$799/mo
When you exceed your rate limit, the API returns a 429 status code. Implement exponential backoff in your client to handle rate limiting gracefully.

Code Examples

Complete code examples for connecting to the Jaaz Feed API in multiple languages.

WebSocket — Real-Time Ticks

JavaScript
// Connect to Jaaz Feed WebSocket
const ws = new WebSocket('wss://feed.jaazmarkets.net/ws/feed?apiKey=YOUR_API_KEY');

ws.onopen = () => {
  console.log('Connected to Jaaz Feed');
  ws.send(JSON.stringify({
    action: 'subscribe',
    symbols: ['EURUSD', 'GBPUSD', 'XAUUSD']
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  if (data.type === 'tick') {
    console.log(`${data.symbol}: ${data.bid} / ${data.ask}`);
  }
};

ws.onerror = (err) => console.error('WebSocket error:', err);
ws.onclose = () => console.log('Disconnected');
Python
# Install: pip install websockets
import asyncio
import json
import websockets

async def connect():
    uri = "wss://feed.jaazmarkets.net/ws/feed?apiKey=YOUR_API_KEY"
    async with websockets.connect(uri) as ws:
        # Subscribe to symbols
        await ws.send(json.dumps({
            "action": "subscribe",
            "symbols": ["EURUSD", "GBPUSD", "XAUUSD"]
        }))

        # Receive ticks
        async for message in ws:
            data = json.loads(message)
            if data["type"] == "tick":
                print(f"{data['symbol']}: {data['bid']} / {data['ask']}")

asyncio.run(connect())

REST API — Historical Data

cURL
# Get available symbols
curl -H "x-api-key: YOUR_API_KEY" \
  https://feed.jaazmarkets.net/api/v1/symbols

# Get latest prices
curl -H "x-api-key: YOUR_API_KEY" \
  https://feed.jaazmarkets.net/api/v1/prices

# Get historical candles
curl -H "x-api-key: YOUR_API_KEY" \
  "https://feed.jaazmarkets.net/api/v1/candles/EURUSD?timeframe=H1&from=2024-01-01&to=2024-01-02&limit=100"

# Get historical ticks
curl -H "x-api-key: YOUR_API_KEY" \
  "https://feed.jaazmarkets.net/api/v1/ticks/EURUSD?from=2024-01-01&to=2024-01-02&limit=5000"
JavaScript (fetch)
const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://feed.jaazmarkets.net';

// Fetch historical candles
const response = await fetch(
  `${BASE}/api/v1/candles/EURUSD?timeframe=H1&from=2024-01-01&to=2024-01-02`,
  { headers: { 'x-api-key': API_KEY } }
);

const { candles } = await response.json();
candles.forEach(c => {
  console.log(`${new Date(c.timestamp).toISOString()} O:${c.open} H:${c.high} L:${c.low} C:${c.close}`);
});
Python (requests)
# Install: pip install requests
import requests

API_KEY = "YOUR_API_KEY"
BASE = "https://feed.jaazmarkets.net"
headers = {"x-api-key": API_KEY}

# Get symbols
symbols = requests.get(f"{BASE}/api/v1/symbols", headers=headers).json()
print(f"Available symbols: {len(symbols['symbols'])}")

# Get historical candles
params = {
    "timeframe": "H1",
    "from": "2024-01-01",
    "to": "2024-01-02",
    "limit": 100
}
candles = requests.get(
    f"{BASE}/api/v1/candles/EURUSD",
    headers=headers,
    params=params
).json()

for c in candles["candles"]:
    print(f"O:{c['open']} H:{c['high']} L:{c['low']} C:{c['close']}")

Error Codes

The API uses standard HTTP status codes. Error responses include a JSON body with details:

Error Response Format
{
  "error": {
    "code": 401,
    "message": "Invalid or missing API key"
  }
}
CodeStatusDescription
401UnauthorizedInvalid or missing API key. Verify your key is correct and included in the request.
403ForbiddenPlan limit exceeded. Too many WebSocket connections or symbol subscriptions for your plan.
404Not FoundSymbol not found. The requested symbol does not exist or is not available on your plan.
429Too Many RequestsRate limit exceeded. You have exceeded your daily history API call quota. Implement backoff.
500Internal Server ErrorAn unexpected error occurred on the server. Contact support if the issue persists.