Skip to content
RealMarketAPI

portfolio tracker market data api

Build a Real-Time Portfolio Tracker with a Market Data API

Aggregate live prices across Forex, Crypto, Stocks, and Metals into a unified portfolio tracker using REST and WebSocket feeds.

Summary

Combine multi-asset price streams into a single portfolio view with live P&L calculations and currency conversion.

Runnable example

Multi-symbol portfolio snapshot (Node.js). Replace YOUR_KEY with your API key.

Multi-symbol portfolio snapshot (Node.js)
const symbols = ["XAUUSD", "BTCUSD", "AAPL", "EURUSD"];

const prices = await Promise.all(
  symbols.map(s =>
    fetch(`https://api.realmarketapi.com/api/v1/price?ApiKey=YOUR_KEY&symbolCode=${s}&timeFrame=M1`)
      .then(r => r.json())
  )
);

const portfolio = symbols.map((s, i) => ({
  symbol: s,
  price: prices[i].ClosePrice,
}));
console.log(portfolio);

Production notes

  • 01Switch to WebSocket streams for holdings above a material threshold to avoid polling overhead.
  • 02Normalise all prices to a single base currency before aggregating cross-asset P&L.
  • 03Cache entry prices at position-open time; only fetch current price deltas for live P&L updates.

How it works, step by step

Where each step happens, from the price data to the people using what you build.

How you can make money from it

Common business models for this kind of product. Commercial use is allowed on every RealMarketAPI plan, including Free.

  • Freemium tracker

    Let people track a few holdings for free and charge for unlimited holdings and multiple portfolios.

  • Premium features

    Sell price alerts, exports and performance history as an upgrade.

  • Plans for advisers

    Offer a version where advisers or communities manage several client portfolios.

  • Partner offers

    Feature relevant tools and services your users already look for, through affiliate partnerships.

You can build and sell products on any plan; what you cannot do is resell or redistribute the raw price feed itself (see the terms). Building for other developers? The affiliate program pays 25% recurring commission on the paid plans you refer.

Run this example with your own key

Create a free account, then try the request in the playground before wiring it into production.