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.
/historypasses the chart’s request toGET /v1/chart/history, which returns candles as arrays:t(Unix seconds),o,h,l,c,v. - Live prices.
/streamopens 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.
TradingView Lightweight Charts: The Page With Live Candles
Save this asindex.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:
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.

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, theattributionLogo 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 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.