Skip to main content
“TradingView API” means three different things, and only one of them puts a chart in your app. TradingView’s data reaches you through its MCP server, for your own use in your own AI chat. Its REST API is for brokers. Its chart libraries draw whatever data you hand them. So you use TradingView’s chart and bring your own data. The two files below stream live Aries market data into TradingView’s free Lightweight Charts. The data is the full SIP feed, free with an Aries account, from the same infrastructure that runs Aries, a FINRA-member brokerage.

Does TradingView Have an API for Real-Time Data?

Yes, but only for you. TradingView’s MCP server signs in with your TradingView account and gives an AI client like Claude or ChatGPT tools for candles and quotes. Calls per day depend on your plan, from 10 on Essential to 500 on Ultimate, and the terms spell out what “for you” means: “don’t put it into a product, report, newsletter, signal service, website or app,” and “don’t let an AI client place, change or cancel broker orders.” TradingView’s REST API isn’t a data API at all: “Our REST API is meant for brokers who want to be supported on our trading platform.” The “TradingView API” packages and the scrapers you’ll find don’t come from TradingView. If what you want is Claude reading quotes and placing orders in your Aries account, with your OK on each order, that’s the Aries MCP server, not a chart.

Real-Time Data for a TradingView Chart: The Server

You need an Aries account, a personal-token client from Client Center, and Node.js 22 or later. The server has no packages to install, keeps your client secret off the browser and hands the page two things: past candles and live prices.
server.mjs
  • The token. The server trades your client ID and secret for an access token with Client Credentials and gets a new one a minute before it expires.
  • History. /history passes the chart’s request to GET /v1/chart/history, which returns candles as arrays: t (Unix seconds), o, h, l, c, v.
  • Live prices. /stream opens one charting WebSocket per open chart, signs in with the token, subscribes to the symbol’s quotes and sends each price to the browser as Server-Sent Events.
  • Two quirks. One frame can carry several JSON messages, one per line, and a quote event carries only the fields that changed. If you port this to another language, parse every line and don’t expect a price in every event.
This sample signs in as you, so it’s for your own chart. For a chart other people use, each person signs in with their own Aries account through OAuth2 with PKCE.

TradingView Lightweight Charts: The Page With Live Candles

Save this as index.html next to server.mjs. It loads Lightweight Charts from a CDN. In a bundled app, run npm install lightweight-charts and import createChart and CandlestickSeries instead.
index.html
setData draws the history once. After that, every price lands in a 5-minute slot. A price in the current slot moves that candle’s high, low and close, and a price in a new slot starts a new one. update only replaces the last candle or adds a newer one, so a late trade for an earlier slot is dropped. Run it with your client’s credentials:
Open http://localhost:3000. To try it on the Aries staging server first, also set ARIES_API=https://api.tradearies.dev. Before the market opens, the stream sends bid and ask changes but no trades, so the last candle starts moving with the first trade of the session.
A TradingView Lightweight Charts candlestick chart of AAPL in 5-minute candles over three sessions, from about $345 to $360, with times on the axis in New York time and the last price, 358.54, marked on the right. TradingView's attribution mark sits in the bottom left corner.

The page above on the Aries staging server: AAPL 5-minute candles through the close on Nov 27, 2026. AAPL is an example, not a recommendation.

Is TradingView Lightweight Charts Free?

Yes. Lightweight Charts is open source under the Apache 2.0 license. The license asks you to keep TradingView’s attribution notice and a link to tradingview.com on the page. The small TradingView logo the chart shows by default, the attributionLogo option, covers the link, so leave it on unless your page links to TradingView elsewhere. For a dark chart, pass colors in layout and grid when you create it:
The candlestick chart on a dark background: AAPL 5-minute candles from late morning on Nov 25 to the 1:00 PM close on Nov 27, 2026, between about $345 and $360, with the last price, 358.54, marked on the right and TradingView's attribution mark in the bottom left corner.

The same page with those colors: AAPL 5-minute candles from Nov 25 and Nov 27, 2026, from the Aries staging server.

TradingView Charting Library (Advanced Charts) With the Aries API

TradingView’s Advanced Charts, the library with drawing tools and indicators, is free but not open: “These licenses are only available to companies for use in public web projects and/or applications.” For a live chart in your own app, we’d start with Lightweight Charts and reach for Advanced Charts only when your users need those. If your company has that license, Aries’ chart endpoints already answer in the shape of its UDF datafeed: Every Aries call needs a Bearer token, and TradingView’s UDF adapter has no documented way to add one. TradingView also recommends its Datafeed API for real-time data. So write a small datafeed: point getBars at your server’s /history and subscribeBars at its /stream, fold prices into bars the way the page above does, and keep the token on the server. For every message and field on the stream, see the Charting WebSocket reference.