Developer guide › Guides

Turn TickFeed candles into a small table

Fetch the last 24 hourly gold candles and print them as a table, marking the candle that's still forming.

The request

curl -H "X-API-Key: $TICKFEED_API_KEY" "https://api.tickfeed.pro/v1/candles/XAUUSD?timeframe=H1&limit=24"

Cost: up to 100 candles: 1 unit. One unit is $0.002 / £0.002 / €0.002 (in your account's currency), taken from your prepaid balance only when the request succeeds. Full prices.

A real response

Sample response to GET /v1/candles/XAUUSD?timeframe=H1&limit=24, captured from the live API on 02 November 2026 at 13:49 UTC. It's a real past response, not live data: prices have moved since.

{
  "symbol": "XAUUSD",
  "timeframe": "H1",
  "source": "live",
  "count": 24,
  "truncated": false,
  "next_start_time": null,
  "candles": [
    {
      "time": "2026-11-02T11:00:00Z",
      "open": 3898.48,
      "high": 3906.99,
      "low": 3898.48,
      "close": 3901.35,
      "tick_volume": 18724,
      "spread_points": 5,
      "complete": true
    },
    {
      "time": "2026-11-02T12:00:00Z",
      "open": 3901.37,
      "high": 3906.93,
      "low": 3898.62,
      "close": 3901.11,
      "tick_volume": 23638,
      "spread_points": 5,
      "complete": true
    },
    {
      "time": "2026-11-02T13:00:00Z",
      "open": 3901.12,
      "high": 3950.7,
      "low": 3896.3,
      "close": 3943.03,
      "tick_volume": 56414,
      "spread_points": 5,
      "complete": false
    }
  ],
  "notes": [
    "The last candle is still forming (complete=false); its values may change."
  ],
  "note": "(trimmed to the last 3 of 24 candles for this page)"
}

Candles are oldest first. time is when the bar opened, in UTC. The newest bar has "complete": false while its hour is still running, so its values can still change.

Print it

from tickfeed import TickFeed

tf = TickFeed()
bars = tf.candles("XAUUSD", "H1", limit=24)["candles"]
print(f"{'opened (UTC)':<17}{'open':>10}{'high':>10}{'low':>10}{'close':>10}")
for b in bars:
    mark = "" if b["complete"] else "  <- still forming"
    print(f"{b['time'][:16].replace('T', ' '):<17}{b['open']:>10}{b['high']:>10}{b['low']:>10}{b['close']:>10}{mark}")

Markets close at weekends, so a 24-bar window that crosses a weekend reaches back further in time. Gaps are never filled in: a missing hour means there was no trading.

More short guides