API for developers TradingView alerts

TradingView alerts API

TradingView webhook API: make a feed, put its address in your alert, link it to MT4/MT5 or binary accounts, then read every alert and its order.

TradingView alerts

# 1. a feed: its webhook address and the alert message to paste in TradingView
curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" -d '{"name":"My strategy"}' https://tpcopier.com/api/v1/tv/feeds

# 2. link it to an account (A): a cloud MT4/MT5 account, or a broker account
curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" -d '{"kind":"tv","source_id":FEED_ID,"target_account_id":A}' https://tpcopier.com/api/v1/bridge/links

# 3. the alerts that came in
curl -H "Authorization: Bearer $TPC_KEY" https://tpcopier.com/api/v1/tv/alerts

Further reading: TradingView's own page about webhooks.

Endpoints in this guide

Base address https://tpcopier.com. Send your key with every request - Authorization: Bearer tpc_... - up to 120 requests a minute. Open an endpoint for its fields, its answers and an example.

bridgeSignal sources, accounts and the links between them
GET/api/v1/bridge/links/{lid}/historyLink History

One link's results and trades, from the moment it was made.

Parameters

lid *pathinteger
limitqueryinteger

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/bridge/links/{lid}/history"
POST/api/v1/bridge/linksAdd Link

Request body

{
  "kind": "",
  "source_id": 0,
  "target_account_id": 0,
  "stake_mode": "",
  "stake_value": 0
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"kind": "", "source_id": 0, "target_account_id": 0, "stake_mode": "", "stake_value": 0}' \
     "https://tpcopier.com/api/v1/bridge/links"
PATCH/api/v1/bridge/links/{lid}Patch Link

Parameters

lid *pathinteger

Request body

{
  "enabled": false,
  "stake_mode": "",
  "stake_value": 0
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X PATCH -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"enabled": false, "stake_mode": "", "stake_value": 0}' \
     "https://tpcopier.com/api/v1/bridge/links/{lid}"
DELETE/api/v1/bridge/links/{lid}Delete Link

Parameters

lid *pathinteger

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X DELETE -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/bridge/links/{lid}"
metatraderMT4/MT5 accounts, TradingView feeds and alerts
GET/api/v1/tv/feedsTv Feeds

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/tv/feeds"
POST/api/v1/tv/feedsTv Feed Create

Request body

{
  "name": "",
  "key_name": "",
  "active": false,
  "expiry": 0
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"name": "", "key_name": "", "active": false, "expiry": 0}' \
     "https://tpcopier.com/api/v1/tv/feeds"
PATCH/api/v1/tv/feeds/{fid}Tv Feed Patch

Parameters

fid *pathinteger

Request body

{
  "name": "",
  "key_name": "",
  "active": false,
  "expiry": 0
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X PATCH -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"name": "", "key_name": "", "active": false, "expiry": 0}' \
     "https://tpcopier.com/api/v1/tv/feeds/{fid}"
DELETE/api/v1/tv/feeds/{fid}Tv Feed Delete

Parameters

fid *pathinteger

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X DELETE -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/tv/feeds/{fid}"
POST/api/v1/tv/feeds/{fid}/rotateTv Feed Rotate

A new address; the old one stops working at once (update it in TradingView).

Parameters

fid *pathinteger

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/tv/feeds/{fid}/rotate"
GET/api/v1/tv/alertsTv Alerts

Parameters

feed_idqueryinteger
limitqueryinteger

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/tv/alerts"