Does TradingView Have an API? MCP, Charts and Broker Integration
Yes. TradingView offers several developer interfaces, and it now documents an official MCP server with market-data tools. These interfaces solve different problems: displaying charts, accessing account-authorized data, connecting a broker, or delivering an alert. Choosing the correct interface is more useful than asking whether one universal "TradingView API" exists.
Match the interface to the job
| Goal | Relevant interface | Boundary to check |
|---|---|---|
| Use TradingView data and tools in an AI client | Official MCP server | Account eligibility, authentication and tool limits |
| Display TradingView-hosted market information | Embeddable widgets | Supported markets, display rights and customization |
| Build charts using your own licensed data | Lightweight Charts or Advanced Charts | Library license, implementation and datafeed |
| Add trading to your own broker application | Trading Platform library | Broker backend and library agreement |
| Let clients trade through TradingView's website | Broker Integration API | Partnership, endpoints and integration testing |
| Notify an external service when an alert fires | Webhook alert | Delivery, receiver validation and downstream actions |
A chart rendering API does not itself provide exchange data, and an alert POST is not an order confirmation.
Official MCP: data access for authenticated accounts
TradingView's MCP documentation currently labels the service Beta and includes it in Essential and higher plans, excluding trials. It uses OAuth 2.1 with a TradingView account and a Streamable HTTP endpoint at https://mcp.tradingview.com/mcp.
Its documented get_ohlcv tool returns historical bars, with a maximum requested count of 5,000. The catalog also includes symbol search, screening, financial information, news, watchlists and alert operations. Some tools can modify account state; it is not an entirely read-only connection.
This changes the answer to "Can I access TradingView data programmatically?" It does not establish unrestricted bulk redistribution rights, unlimited history or a general-purpose REST endpoint authenticated by an API key. Check the current tool schema and account permissions for the intended workflow. This page reviews the documentation; it does not report an authenticated MCP integration test.
Widgets: hosted display with supplied data
Widgets embed TradingView-hosted content. They are useful when a site needs a chart, ticker or technical summary without building a datafeed. Their data FAQ explains that widgets use TradingView's available data and cannot accept your custom feed. A paid TradingView account does not upgrade every visitor's embedded-widget data.
Configure a widget using its current constructor and supported options. Do not assume it can run your Pine script, execute a strategy or expose a general alert-creation API. The widget FAQ says custom Pine scripts and strategies cannot be added to widgets. Branding changes also need the applicable arrangement; matching colors does not give permission to remove attribution.
For a first integration, choose the exact symbol and market, set an explicit container height, and verify mobile sizing and data-delay labels. Confirm the widget's available data before presenting it as a realtime quote source.
Libraries: your application supplies the data
TradingView distinguishes three charting libraries in its official comparison:
- Lightweight Charts is open source under Apache 2.0 and can be used for personal projects, subject to its license and attribution requirements.
- Advanced Charts is a proprietary library available through an application process for eligible company projects. It is offered free with TradingView branding under the applicable conditions.
- Trading Platform adds trading functionality and has its own licensing arrangement.
The official FAQ says Advanced Charts and Trading Platform are not supplied for personal hobbies, studies or testing; they are for companies' public web projects or applications. That is the reverse of the claim that personal use is automatically free while every commercial installation costs tens of thousands of dollars. Obtain terms for the actual product and use case rather than relying on an invented price range.
For Advanced Charts, implement the Datafeed API to supply symbols, historical bars and updates. Data delivery and redistribution rights must come from the provider you use. A chart-library license does not silently include a raw TradingView market-data feed.
Pine Script does not run in Advanced Charts
The Advanced Charts FAQ explicitly excludes Pine Script from Advanced Charts and Trading Platform. Custom indicators use JavaScript. The libraries also differ from tradingview.com in features that rely on server-side services.
Consequently, a Pineify-generated Pine indicator cannot simply be pasted into your embedded Advanced Charts application. It is intended for a Pine-compatible TradingView workflow. Porting a calculation into a JavaScript custom indicator is separate work requiring matching data, initialization and update behavior.
Pineify can assist with Pine Script authoring. For alert logic on TradingView itself, see the Pine Script alertcondition guide. Keep that workflow separate from a website chart-library integration.
Broker integration: the broker implements the backend
The Broker Integration API connects a broker's systems to TradingView's web interface. It describes endpoints and behavior the broker must implement for account information, trading and market-data integration. It is not a retail account's universal API key for downloading TradingView data or routing through any broker.
The current authentication documentation describes Password Bearer and OAuth2 Code flow, with bearer tokens on subsequent requests. It recommends OAuth2 Code flow and explains refresh handling. Describing the entire integration as only "OAuth or JWT" loses these implementation requirements; a token's format is not a substitute for an authentication flow.
For a broker project, confirm the supported account model, instrument mapping, order states, permissions and required tests before implementation. A trading interface that renders correctly is not proof that rejected orders, reconnects or expired sessions behave correctly.
Webhooks: event delivery to your service
A webhook sends an HTTP POST when a TradingView alert triggers. TradingView's configuration guide specifies requirements including two-factor authentication, supported ports and receiver response time. Check the current plan's alert entitlement separately from a chart-library license.
A useful receiver first records and validates the event. If it then submits an order through another service, track that order's acknowledgement and final state separately. Reconcile repeated or delayed events and mismatched symbols before enabling execution. Receiving a POST proves receipt of the alert, not that a broker filled an order.
Avoid putting account passwords or trading credentials in the alert payload. Inspect delivery status using the platform's alert logs and your own receiver logs. Use test events before attaching financial side effects.
Frequently asked questions
Does TradingView provide an official way to retrieve OHLCV data?
Its current official MCP Beta documents a get_ohlcv tool for eligible authenticated accounts. This is distinct from a general-purpose public REST market-data API and remains subject to tool, account and usage limits.
Does Advanced Charts include TradingView market data?
No. The application supplies its own datafeed. Widgets include hosted data, while the official MCP server is a separate authenticated interface.
Can I use Pine Script inside an embedded chart library?
Advanced Charts and Trading Platform do not support Pine Script. Their custom-indicator implementation uses JavaScript. A TradingView website script is a different deployment target.
What does a commercial integration cost?
The answer depends on the product and agreement. Advanced Charts can be free for eligible company projects under its conditions; Trading Platform and broker integration have separate arrangements. No fixed setup or per-user quote is established here.

