Quick answer
TradingView has no public API for placing trades or downloading its chart data. The supported automation path is a Pine Script alert that sends a webhook (HTTP POST to your URL) when it fires; your own server then calls a broker API such as Alpaca, OANDA or Binance. Webhooks require a paid TradingView plan. Separate Charting Library and broker-integration programs exist for companies.
TradingView API at a glance
- Pricing
- Webhooks need a paid plan
- Availability
- Worldwide
- Paper trading
- Not applicable (data only)
- Integration type
- No public API
- In AlgoGP
- Design and backtest in AlgoGP, connect the exported code
- Trading API
- None public
- Automation
- Pine Script alert → webhook POST → your server → broker API
- Requirement
- Paid plan for webhooks; 2FA on the account
- For companies
- Charting Library and broker-integration programs
Connecting TradingView alerts to a broker
- 1
Write the alert message
In the alert dialog, put JSON in the message, e.g.
{"symbol":"{{ticker}}","side":"buy","secret":"…"}. - 2
Set the webhook URL
Enable Webhook URL and point it at an HTTPS endpoint you control (ports 80/443 only).
- 3
Validate and forward
Your server checks the shared secret, sizes the order and calls the broker’s API.
- 4
Log everything
Webhooks can be delayed or retried; make order handling idempotent.
What about unofficial TradingView APIs?
Scrapers and reverse-engineered WebSocket clients exist, but they break without notice and can violate TradingView’s terms. For data, use a licensed market-data API instead.
Build a TradingView strategy with AlgoGP
AlgoGP does not connect to TradingView natively yet. TradingView has no supported public trading or data API.
- 1
Design and backtest in AlgoGP
Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.
- 2
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in TradingView
Implement the four adapter methods (
account,positions,submit_market_orderand a candle fetcher) with TradingView’s SDK, or keep a built-in platform for paper trading and add TradingView when you go live.
Built-in data sources for the same markets: Alpaca, Binance, Coinbase Exchange, Yahoo Finance.
TradingView API: frequently asked questions
Does TradingView have an API?
No public API for trading or data. Use alert webhooks for automation, or the Charting Library if you are a company embedding charts.
Can TradingView place trades automatically?
Only through integrated brokers in its trading panel or by webhooks to your own server that calls a broker API.
Do TradingView webhooks need a paid plan?
Yes, webhook alerts are a paid-plan feature and require two-factor authentication.
Can I download TradingView chart data via API?
No. Get the same instruments’ history from a data API such as Massive, Twelve Data or an exchange.
Automate the strategy you would run on TradingView
Describe your rules, backtest them on years of stock, crypto or forex data, and export Python for a broker that has a real API.
- No API key needed to start
- Built-in Alpaca, Tradier, OANDA, Binance and more
- Free plan, no card
Free plan, no card required.
TradingView alternatives
- Alpaca API Built into AlgoGPCommission-free API-first broker for US stocks, ETFs and crypto, with a free paper-trading account.
- OANDA API Built into AlgoGPRegulated forex and CFD broker whose v20 REST API serves both orders and candles, with a free demo account.
- Binance API Built into AlgoGPThe largest crypto exchange by volume, with a deep public market-data API and a free spot testnet.
- TradeStation API GuideUS broker with a v3 REST and streaming API for stocks, options and futures, OAuth 2.0 and a simulated account.
- NinjaTrader API GuideFutures trading platform with NinjaScript (C#) and an Automated Trading Interface, not a cloud REST trading API.
Independent guide. AlgoGP is not affiliated with TradingView. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.