TVH HTTP API Reference Overview
The TradingView Hub HTTP API is intentionally small. The public surface is a single webhook that receives a TradeCommand JSON payload and places a trade — designed to be called from environments without a heavy SDK: a TradingView alert, a Pine script, a shell script, or anything else that can POST JSON.
- Webhook — POST a
TradeCommandJSON payload to place a trade. Used by TradingView, custom scripts, Telegram bots, anything that can POST JSON. - Stateless and per-request: authenticate with your TVH User Token in the request body.
Base URLs
TVH runs two production base URLs:
| Base URL | Used for |
|---|---|
https://alerts.tv-hub.org | All exchanges except Binance. |
https://binance.tv-hub.org | Binance Spot and Binance Futures. Same routes (/ and /api/ExecuteTradeSignalClassic). |
Use the Binance host whenever the trade targets a Binance pair; use the default host for everything else.
There is no separate sandbox or staging URL. To test without risking funds, add an exchange Demo / Testnet account in TVH — the platform routes those keys to the exchange's test environment automatically. See Demo Accounts for setup.
Content type and encoding
Every endpoint accepts both application/json and text/plain bodies. TradingView's webhook sometimes form-encodes the body and appends a stray =; TVH tolerates that automatically, so the same JSON payload works whether it comes from TradingView, curl, a browser, or a Telegram bot.
Responses are always application/json, even on errors. The body of a successful webhook response is intentionally short — the trade execution itself happens asynchronously after the webhook returns.
Auth model
Webhook calls authenticate with a single field in the JSON body:
| Endpoint | Auth | Where |
|---|---|---|
Webhooks (/, /api/ExecuteTradeSignalClassic) | token field in JSON body — your TVH User Token (a GUID) | Body |
Authenticate every webhook call with your TVH User Token in the request body, and treat the token like a password.
Cross-references
- Full
TradeCommandschema: Trade Command → Parameter Reference - Pine Script integration: Pine Script → Alerts Setup Basics
- Error codes and common failures: Error Codes