API reference

Chart image

GET/tickers/{symbol}/chart.pngKey required

PNG of one current setup

Returns a PNG of one current setup: candles, both lines, trigger, stop and target. setup_id must come from the patterns route for the same ticker; a setup that is no longer current answers 404 setup_not_found, so re-read the patterns when that happens. The image is rendered once per setup per session and then served from storage; the response is cacheable for an hour. The ticker must be tracked.

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

NameInTypeRequiredDescription
symbolpathstringyesExchange symbol, upper case (BRK.B, not BRK-B). Lower case is accepted and upper-cased.
setup_idquerystringyesA setup_id from the patterns route for the same symbol (the demo patterns route for demo charts). Setups change nightly; an id that is no longer current answers 404 setup_not_found.
X-TradingPal-ClientheaderstringnoOptional 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

curl "https://api.tradingpal.io/api/v1/tickers/NVDA/chart.png?setup_id=NVDA:D:falling_wedge:1" \
  -H "Authorization: Bearer $TRADINGPAL_API_KEY" \
  -o setup.png

Response

PNG image of the setup: candles, both lines, trigger, stop and target. The body is the image bytes with Content-Type: image/png; there is no JSON envelope.

Errors

Errors are JSON with the Error shape; the fix field says what to do.

StatusCodeMeaningFix
401missing_api_keyThe 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.
401invalid_api_keyThe 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.
403forbiddenThe 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.
403ticker_not_trackedThe ticker is not on the account’s tracked list, and pattern, history and chart calls work only on tracked tickers.Add it with PUT /tickers (or the set_tracked_tickers MCP tool), then retry. The fix field says how many slots are free.
429rate_limitedThe 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.
400bad_requestA 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.
404setup_not_foundNo current setup on that ticker has the setup_id you passed to chart.png.Call the patterns route again and use a setup_id from tonight’s answer; ids change when a pattern is redrawn.
404chart_unavailableThe setup exists but cannot be drawn, usually because its price history is not stored.Present the setup from its JSON instead; the lines are two dated endpoints you can draw yourself.