API reference
Demo chart
GET
/demo/{symbol}/chart.pngNo key neededPNG of one demo setup
Returns the PNG of one current setup on a demo symbol, as the keyed chart route would. setup_id comes from the demo patterns route; symbols outside the demo set answer 404 not_a_demo_symbol. No key is needed; keyless calls are limited per IP. The demo MCP tool returns the first setup's chart inline instead of taking a setup_id.
Authentication
No key needed. Without one the call is limited to 30 requests a minute per IP; with a key it counts against the key's limits instead.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
symbol | path | string | yes | Exchange symbol, upper case (BRK.B, not BRK-B). Lower case is accepted and upper-cased. |
setup_id | query | string | yes | A 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. |
Request
curl "https://api.tradingpal.io/api/v1/demo/NVDA/chart.png?setup_id=NVDA:D:falling_wedge:1" \
-o setup.pngResponse
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.
| Status | Code | Meaning | Fix |
|---|---|---|---|
| 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. |
| 404 | setup_not_found | No 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. |
| 404 | chart_unavailable | The 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. |
| 404 | not_a_demo_symbol | The keyless demo answers only for its fixed set of large caps. | GET /demo lists the demo symbols. For any other ticker, use a key and track it. |