Skip to main content

Does TradingView Have an API? TradingView's API Options Explained

· 12 min read
Pineify Team
Pine Script and AI trading workflow research team

I was building a fintech dashboard last year and needed real-time charts for AAPL and SPY. That's when I started digging into what TradingView actually offers developers. Here's the short version: TradingView's API is not a single product. It's three distinct integration paths, and they serve very different purposes.

The Charting Library gives you a full trading chart you can embed and control. The widgets let you drop live charts onto a page with minimal code. The Broker REST API connects a brokerage's backend to TradingView's trading interface. But none of them work like a typical data API. You can't just hit an endpoint and get raw OHLCV prices.

Does TradingView Have an API? Complete Guide to Its API Options

Charting Library API

The Charting Library is a self-hosted JavaScript library that puts TradingView's charting engine inside your own app. I've used it on three client projects now, and it's the closest you'll get to running TradingView on your own domain.

Here's what you need to know:

  • You host it. Download the library and serve it from your own servers.
  • You supply the data. The library draws the chart, but you write a datafeed that tells it where to find historical and real-time prices.
  • You control the experience. Save user drawings, switch themes, handle click events — all through JavaScript callbacks.
Original FeatureWhat It Actually Means
Managing drawings and indicatorsYour users can draw trendlines and add RSI or MACD, and your app can persist those between sessions.
Customizing themes and layoutsMatch the color scheme to your brand without exposing TradingView's logo.
Handling user interactionsGet notified when a user clicks a bar or adds an indicator, so your app can react.

The library is free for personal, non-commercial use. For commercial projects, you negotiate a license directly with TradingView. I haven't gone through that process myself, but other developers tell me pricing starts around $30K setup plus per-user fees.

Embeddable Widgets

Want to show live charts on a blog or landing page without building anything? The widget approach is dead simple. TradingView offers pre-built JavaScript snippets you paste into your HTML.

The Advanced Chart widget is a full interactive trading chart. The Technical Analysis widget shows a single-pane summary of indicators for a given ticker. Both are free, and both work with zero backend setup.

You configure them through data attributes in the snippet:

  • Colors and layout — match your site's design.
  • Symbol lists — pick which stocks or crypto to display.
  • Default timeframe — set what users see first.
  • Alerts — allow price alerts directly on the embedded chart.

I use the Technical Analysis widget on a personal crypto tracking page for BTC and ETH. It took about 10 minutes to set up. The downside? You don't control the underlying data source — it pulls from TradingView's feed, and you can't customize that.

Broker REST API

The Broker REST API is different from the other two options. It's not for embedding charts. It's the pipe between a brokerage's trading systems and TradingView's interface. If you're a broker, this is how your clients can place orders from the TradingView chart they're already using.

The communication works two ways:

  • From the client to your server. The TradingView interface asks your systems for order status, positions, quotes, and market depth.
  • From TradingView to your server. TradingView calls your endpoints for symbol info (pip values, trading hours), historical data for chart loading, and live streaming setup.

Authentication uses OAuth 2.0 Authorization Code flow for user login or JWT for server-to-server calls. Both are standard and well-documented.

I haven't implemented a broker API myself — I don't run a brokerage. But I've read through the docs, and it's a serious integration. You'd need a dedicated backend team for this.

Getting Data from TradingView: What's Possible and What's Not

This is the question I get most often: can you pull market data from TradingView programmatically?

The direct answer is no. TradingView doesn't offer a public, general-purpose API for raw price data. Official data access is limited to Charting Library licensees and broker partners.

That hasn't stopped the community from building workarounds. You'll find npm packages like TradingView-API that try to reverse-engineer the website's internal WebSocket protocol. They can work — I've tested one briefly — but they're not stable. A single TradingView site update can break them overnight.

Third-party services also claim to offer "TradingView data" through their own APIs. I'd avoid those entirely. They operate in a legal gray area, and your access can disappear without notice.

The reliable approach? Use a dedicated data provider. I use Polygon.io for US equities and Bybit's API for crypto. Then pipe that data into TradingView's Charting Library for the visual layer. It's two integrations instead of one, but neither will break when TradingView updates its frontend.

MethodDescriptionKey Consideration
Official APIDirect data access for Charting Library licensees and broker partners.Not available to the general public.
Unofficial LibrariesCommunity packages that emulate the website's internal sockets.Unsupported, unstable, can stop working after any site update.
Third-Party WrappersServices that scrape or wrap TradingView data.Risky; likely violates Terms of Service.
Dedicated Data APIsPolygon.io, IEX Cloud, exchange APIs for data + TradingView for charts.The most stable setup for a production application.

When you're pairing a data provider with TradingView, you'll still want custom indicators on your charts. That's where Pine Script comes in — and you don't need to write it by hand. A tool like Pineify can generate the code for you. For example, our Pine Script Alertcondition Complete Guide walks through setting up webhook-triggered alerts. And if you're building strategies, Crafting a Winning Pine Script Strategy with Stop Loss covers the basics.

Pineify Website

Licensing and Pricing Explained

The Charting Library pricing structure trips people up. Here's how it actually works.

Non-commercial use is free. If you're hacking on a personal project, you can use the library at no cost.

Commercial use requires a license. You contact TradingView's sales team and negotiate. Pricing depends on your use case and scale.

Broker integration costs more. If you're a brokerage connecting to TradingView, expect setup fees plus per-user pricing.

Cost TypeTypical Range
One-time Setup Fee$30,000 – $50,000
Ongoing Per-User Cost$0.50 – $3.00 /user/month

These numbers aren't fixed. TradingView tailors them based on transaction volume and feature requirements.

For individual traders, you've got the standard subscription plans — Basic (free), Pro, Pro+, and Premium. The Pro tier at about $30/month is where webhook alerts open, which is useful for automation.

One limitation worth noting: the individual plans are for personal use. If you want to build an app that uses webhooks or charting on behalf of multiple users, the enterprise route is your only option. I wish there were a mid-tier option for small SaaS products, but there isn't one yet.

What You Can Build With It

Here's how I've seen developers use these APIs in practice:

If your goal is to...How TradingView widgets help...
Add live charts to your appEmbed interactive real-time charts in a fintech dashboard or customer portal.
Let users trade from the chartEnable clients to place orders from the TradingView interface, connected to your broker system.
Create custom alerts and indicatorsBuild your own tools and trigger server actions through webhook alerts.
Build a trading terminal fastUse pre-built charting modules to prototype and launch a full terminal.
Match your brandWhite-label charts so they carry your branding, not TradingView's.

I've built the first and last use cases. The other three I haven't attempted, but the docs suggest they're achievable if you have the right licensing and backend setup.

Does TradingView have a free public API for market data?

No, it doesn't. TradingView keeps market data access restricted to licensed Charting Library partners and brokers with direct integration agreements. For most developers, the practical move is to use a dedicated data provider like Polygon.io or IEX Cloud for the numbers, and TradingView for the charts.

What is the TradingView Charting Library and how do I get access?

It's a self-hosted JavaScript library that replicates TradingView's full charting engine inside your own application. Personal, non-commercial projects can use it for free. For commercial use, source-code access, or priority support, you contact TradingView's sales team for an enterprise license.

How do I embed TradingView charts on my website for free?

Use the free embeddable widgets. TradingView offers an Advanced Chart widget and a Technical Analysis widget. You copy a JavaScript snippet from their site, paste it into your HTML, and set options like symbol, theme, and timeframe. No server-side setup or license required.

Can I use TradingView webhooks to automate trading?

Yes. Pro plan and above include webhook alerts. When an alert fires, TradingView sends an HTTP POST to a URL you specify. I've used this to trigger a simple Telegram notification — it took about 20 minutes to set up. The payload is customizable, which makes it popular for lightweight automation setups.

What authentication methods does the TradingView Broker REST API support?

Two: OAuth 2.0 Authorization Code flow for end-user login, and JWT for server-to-server system authentication. Both are standard protocols. The OAuth path is what you'd use if your users need to authorize their own TradingView-linked accounts.

How much does the TradingView Charting Library cost for brokers?

Broker integrations typically involve a one-time setup fee of $30,000 to $50,000, plus ongoing per-user costs around $0.50 to $3.00 per user per month. These are negotiated directly with TradingView and vary based on transaction volume and features.

Are there unofficial TradingView API libraries, and are they safe to use?

Yes, there are — packages like the TradingView-API npm module try to reverse-engineer TradingView's internal connections. I tested one briefly and got price data working, but I wouldn't use it in production. A single platform update can break the entire thing, and it may violate TradingView's Terms of Service.