Guide
PlatformStocksCryptoForexFutures No key needed

TradingView API guide

“TradingView API” is one of the most searched trading-API phrases, and the answer surprises people: there is no public trading or data API. Automation works through alerts and webhooks.

Last verified · Also known as TradingView API, TradingView webhooks, Pine Script

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. 1

    Write the alert message

    In the alert dialog, put JSON in the message, e.g. {"symbol":"{{ticker}}","side":"buy","secret":"…"}.

  2. 2

    Set the webhook URL

    Enable Webhook URL and point it at an HTTPS endpoint you control (ports 80/443 only).

  3. 3

    Validate and forward

    Your server checks the shared secret, sizes the order and calls the broker’s API.

  4. 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. 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. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in TradingView

    Implement the four adapter methods (account, positions, submit_market_order and 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

Independent guide. AlgoGP is not affiliated with TradingView. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.