bars

OHLCV bar history — cursor-paginated, real data, is_closed label

Changed on

Paginated OHLCV bar history from the canonical price_bars store.

Results are ordered DESC by bar_start (newest first). Paginate via next_cursor — pass it as ?cursor= on the next request. When next_cursor is null the result is exhausted. Empty range returns 200 with bars: [].

Daily (1d) depth by plan:

  • Free: last 30 days, gold (XAU) only
  • Physical: last 1 year, gold (XAU) only
  • Pro and Realtime Pro: full daily history (XAU/USD from 1996; other symbols start later, e.g. silver from 2007)

Intraday intervals (1m, 5m, 15m, 30m, 1h, 2h, 4h) require Pro or Realtime Pro (or Pro 2026); Plus 2026 gets 1h and 4h. Depth is 30 days (older ranges return 400 range_too_deep; use /v1/download), except Pro 2026, which reaches full depth.

Free and keyless callers get bars 15 minutes late.

get/v1/bars

Request

  • Base URL
    https://api.goldprice.dev
  • URL
    https://api.goldprice.dev/v1/bars
  • Auth
    • none
    • or HTTP bearer
    • or API key in header X-API-Key

Query parameters

symbolstring required

Symbol in slash or dash form. E.g. "XAU/USD", "XAU-USD-SPOT", "GLD".

intervalstring

Bar interval. One of: 1m, 5m, 15m, 30m, 1h, 2h, 4h, 1d.

fromstring required

ISO-8601 start (inclusive).

tostring required

ISO-8601 end (inclusive).

limitinteger

Max bars per page (1-10000). Default 100.

cursorstring nullable

Opaque keyset pagination cursor from a prior response's next_cursor. When set, returns bars older than the cursor within the from/to window.

Response

Successful Response

symbolstring required

The requested symbol (e.g. 'XAU/USD', 'GLD').

intervalstring required

The requested interval (e.g. '1d', '15m').

next_cursorstring nullable

Opaque cursor for the next page. Pass as ?cursor= on the next request. Null when the result is exhausted. Encoding: base64url of the bar_start_utc ISO-8601 string of the last bar in this page.

Changes

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      response property message list-of-types was widened by adding types null to media type application/json of response 400

    • breaking

      response property message list-of-types was widened by adding types null to media type application/json of response 401

    • breaking

      response property message list-of-types was widened by adding types null to media type application/json of response 403

    • breaking

      response property message list-of-types was widened by adding types null to media type application/json of response 404

    • breaking

      response property message list-of-types was widened by adding types null to media type application/json of response 429

    • breaking

      response property message list-of-types was widened by adding types null to media type application/json of response 503

    • warning

      removed the optional property from the response with the status

    • info

      the endpoint scheme security ApiKeyAuth was added to the API

    • info

      the endpoint scheme security BearerAuth was added to the API

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status