Quick Start

Prerequisites

  • A valid API key (starts with fxd_)
  • Any HTTP client: curl, Python, or JavaScript

Step 1 — First Request

The simplest test: list available symbols.

cURL
curl -H "X-API-Key: fxd_your_key_here" \
  "https://api.pipdata.net/v1/symbols?limit=5"
Python
import requests

API_KEY = "fxd_your_key_here"
BASE_URL = "https://api.pipdata.net"

headers = {"X-API-Key": API_KEY}
resp = requests.get(f"{BASE_URL}/v1/symbols", headers=headers, params={"limit": 5})
print(resp.json())
JavaScript
const API_KEY = "fxd_your_key_here";
const BASE_URL = "https://api.pipdata.net";

const resp = await fetch(`${BASE_URL}/v1/symbols?limit=5`, {
  headers: { "X-API-Key": API_KEY }
});
const data = await resp.json();
console.log(data);

Sample response:

{
  "symbols": [
    {
      "symbol": "WMMARKETS:ZERO:EURUSD",
      "display_symbol": "EUR/USD",
      "description": "EUR/USD — WM Markets Ltd",
      "type": "forex",
      "digits": 5
    }
  ],
  "total": 230,
  "limit": 5,
  "offset": 0
}

Step 2 — Fetch Historical Data

Get OHLCV bars for EUR/USD at H1 resolution (last 500 candles):

cURL
curl -H "X-API-Key: fxd_your_key_here" \
  "https://api.pipdata.net/v1/history?symbol=WMMARKETS:ZERO:EURUSD&resolution=60&countback=500"
Python
params = {
    "symbol": "WMMARKETS:ZERO:EURUSD",
    "resolution": "60",   # H1
    "countback": 500
}
resp = requests.get(f"{BASE_URL}/v1/history", headers=headers, params=params)
data = resp.json()

if data["s"] == "ok":
    bars = list(zip(data["t"], data["o"], data["h"], data["l"], data["c"]))
    print(f"{len(bars)} bars received")
    print(f"Latest bar: open={bars[-1][1]:.5f}, close={bars[-1][4]:.5f}")
JavaScript
const params = new URLSearchParams({
  symbol: "WMMARKETS:ZERO:EURUSD",
  resolution: "60",
  countback: "500"
});
const resp = await fetch(`${BASE_URL}/v1/history?${params}`, {
  headers: { "X-API-Key": API_KEY }
});
const data = await resp.json();

if (data.s === "ok") {
  console.log(`${data.t.length} bars received`);
  console.log(`Latest close: ${data.c[data.c.length - 1]}`);
}

Sample response:

{
  "s": "ok",
  "t": [1749556800, 1749560400, 1749564000],
  "o": [1.08234, 1.08198, 1.08215],
  "h": [1.08267, 1.08241, 1.08259],
  "l": [1.08190, 1.08182, 1.08198],
  "c": [1.08198, 1.08215, 1.08241],
  "v": [1250, 980, 1100],
  "meta": {
    "symbol": "WMMARKETS:ZERO:EURUSD",
    "resolution": "60",
    "bar_count": 3
  }
}

Step 3 — Live Prices via WebSocket

Subscribe to real-time M1 bar updates as each candle closes:

const ws = new WebSocket(
  "wss://api.pipdata.net/v1/stream?api_key=fxd_your_key_here"
);

ws.onopen = () => {
  ws.send(JSON.stringify({
    action: "subscribe",
    symbols: ["WMMARKETS:ZERO:EURUSD", "WMMARKETS:ZERO:XAUUSD"],
    type: "bar"
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type === "connected") {
    console.log("Connected — session:", msg.session_id);
  }

  if (msg.type === "bar") {
    console.log(`${msg.symbol}: close = ${msg.bar.close}`);
  }
};

Step 4 — Check Service Health

curl -H "X-API-Key: fxd_your_key_here" \
  "https://api.pipdata.net/v1/status"
{
  "status": "ok",
  "server_time": 1749600000,
  "feeds": {
    "WMMARKETS:ZERO": {
      "status": "live",
      "last_candle_age_seconds": 45,
      "symbol_count": 230
    }
  }
}

Endpoint Summary

EndpointDescription
GET /v1/configTradingView configuration object
GET /v1/symbolsSymbol list and search
GET /v1/historyHistorical OHLCV bars
GET /v1/coverageAvailable data date ranges per symbol
GET /v1/statusLive feed health status
GET /v1/usageYour API key usage statistics
WS /v1/streamReal-time M1 bar WebSocket stream

Next Steps

Read the Authentication guide to understand all auth methods, rate-limit headers, and error handling.