GETTING STARTEDIntroductionOverview of the xauapi data APIGETTING STARTEDQuickstartCreate a key and make your first requestGETTING STARTEDAuthenticationBearer tokens, key rotation and revocationGETTING STARTEDMCP integrationConnect AI tools to gold market dataCONCEPTSBroker feedsBrokers and source identityCONCEPTSFreshness & coverageTimestamps, sampling and stale dataAPI REFERENCELatest quoteGET /v1/quote · Bid, Ask and spreadAPI REFERENCECandlesGET /v1/candles · M1, M5 and M15 OHLCAPI REFERENCEFeed statusGET /v1/status · Connection and freshnessRESOURCESErrors401, 429 and 503 response handlingRESOURCESUsage & limitsAnnual allowance, rate limits and billing

11 topics. Select a result to open it.

api reference

Candles

GET /v1/candles · M1, M5 and M15 OHLC

API reference · Code and response examples

Request

GET/v1/candlesBearer token

Base URL: https://api.xauapi.com. Use an active private API key.

Request example
curl 'https://api.xauapi.com/v1/candles?feed=justmarkets&interval=M5' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Query parameters

feed is optional and accepts justmarkets.

interval accepts M1, M5 or M15 and defaults to M5.

Example response

Illustrative values. Production responses include actual broker timestamps and freshness.

200 · application/json
{
  "feed": "justmarkets",
  "symbol": "XAUUSD",
  "interval": "M5",
  "price_basis": "bid",
  "received_at": 1791448200100,
  "stale": false,
  "candles": [
    {
      "timestamp": "2026-10-08T08:25:00.000Z",
      "open": 4099.5,
      "high": 4101,
      "low": 4099,
      "close": 4100,
      "complete": true
    }
  ]
}

Response fields

FieldMeaning
intervalM1, M5 or M15. Defaults to M5.
price_basisbid: broker OHLC prices are based on bid quotes.
received_at / staleSnapshot receipt time in Unix milliseconds. Stale after thirty seconds without an updated snapshot.
candlesRetained broker history in chronological order. No date-range filtering or pagination.
completeWhether the candle interval has ended. The current candle can still change.

Behavior & errors

Inspect freshness even when the HTTP response is 200. Missing feed data returns 503. Authenticated requests admitted by the quota gate count toward your annual allowance.

Error handling →