API reference
Replace tracked tickers
/tickersKey requiredReplace the tracked tickers (all-or-nothing)
Replaces the whole tracked set with the symbols in the body, all or nothing: every symbol must be a ticker TradingPal knows and the list must fit the cap, otherwise nothing changes and the error names the offending symbols. Read GET /tickers first and include the tickers to keep. Symbols are upper-cased and duplicates dropped. This also rewrites the user's Main watchlist on the site.
Authentication
Needs a key: send Authorization: Bearer tp_live_… (see Authentication). Counted against the key's limits of 60 requests a minute and 10,000 a day.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-TradingPal-Client | header | string | no | Optional name of the agent or script making the call. It is recorded in the account's usage log so the user can see which client made which calls; the User-Agent is recorded when it is absent. |
Request body
The full new tracked list.
| Field | Type | Description |
|---|---|---|
symbols | array of string | The complete new list of exchange symbols, upper case (BRK.B). Every symbol must be a ticker TradingPal knows and the list must fit the cap; duplicates are dropped. |
{
"symbols": [
"NVDA",
"AAPL"
]
}Request
curl -X PUT "https://api.tradingpal.io/api/v1/tickers" \
-H "Authorization: Bearer $TRADINGPAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"symbols":["NVDA","AAPL"]}'Response
JSON. The fields this route adds are below; every response also carries the envelope fields (api_version, as_of_session, data_version, source, disclaimer).
| Field | Type | Description |
|---|---|---|
tickers | array of object | The tracked tickers, in the order the user keeps them. |
tickers[].symbol | string | Exchange symbol, upper case. |
tickers[].covered | boolean | True when the active nightly manifest covers the symbol, so the pattern and history routes can answer for it. False means it is tracked but the nightly has no data for it. |
count | integer | Number of tracked tickers. |
cap | integer | Maximum number of tickers the account may track. |
Example response
{
"api_version": "v1",
"tickers": [
{
"symbol": "NVDA",
"covered": true
}
],
"count": 1,
"cap": 50
}Errors
Errors are JSON with the Error shape; the fix field says what to do.
| Status | Code | Meaning | Fix |
|---|---|---|---|
| 401 | missing_api_key | The request had no Authorization: Bearer tp_live_… header and the route needs one. | Send the header on every keyed call. Only the demo, families and universe routes answer without it. |
| 401 | invalid_api_key | The key is not one we know, or it has been revoked. | Create a new key on the Keys page and replace it wherever the old one was stored. |
| 403 | forbidden | The account behind the key is not on a plan with API access. | During the beta, keys work on Premium accounts. Upgrade the account, then retry with the same key. |
| 429 | rate_limited | The key passed 60 requests in a minute or 10,000 in a day, or a keyless caller passed 30 a minute from one IP. | Wait details.retry_after_seconds, then retry. Cache the nightly answers; they do not change until the next session. |
| 400 | bad_request | A query parameter is malformed: limit is not an integer, or outcome is not all, resolved or open. | The message names the parameter. Correct it and retry. |
| 400 | invalid_symbol | A symbol in a PUT /tickers body is not a valid ticker symbol (letters, digits and a dot, as in BRK.B). | Use the exchange symbol in upper case. details lists the rejected values. |
| 400 | unknown_symbol | A symbol in a PUT /tickers body is well formed but not a ticker TradingPal knows. | Check the spelling against GET /universe. details lists the unknown values. |
| 400 | ticker_cap_exceeded | The PUT /tickers body has more symbols than the account’s cap. Nothing was changed. | Send at most cap symbols (GET /tickers returns the cap). The beta cap is 50. |