Market hours for a symbol or instrument, from the account's broker
Last updated:
Request
Synthetic example for the production API. Replace YOUR_API_KEY and the ids. Do not send it against a live account until you mean to.
curl -X GET "https://api.fxapis.com/v1/accounts/ACCOUNT_ID/sessions" \
-H "Authorization: Bearer YOUR_API_KEY"When the account's broker lets orders be placed in a symbol — or in this account's symbol for an instrument — as the broker configured it (MetaTrader's SymbolInfoSessionTrade), with whether it is open now and when that next changes.
trade and quote are given in the broker's server time and in UTC; utcOffsetSeconds is the broker's clock as measured when the sessions were read. Read when the account comes online and refreshed daily, so it answers while the account is offline.
Holidays a broker does not load into its schedule are not here: on such a day an order is still refused with ORDER_REJECTED (Market closed).
Authorization
apiKey Authorization: Bearer fx_live_<id>_<secret>.
A key is shown once, at creation. We cannot show it again or recover it for you.
Keys carry a label (live or test) in the key itself, so each configuration is easy to tell
apart. Both reach real brokers: test with a broker demo account.
Scopes are per key. A key without accounts:write can read accounts and nothing else.
In: header
Path Parameters
uuidQuery Parameters
A broker symbol, exactly as the broker spells it.
Or an instrument, e.g. XAUUSD: this account's symbol for it is used.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://api.fxapis.com/v1/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/sessions"{ "data": { "symbol": "XAUUSD", "instrument": "XAUUSD", "server": "string", "utcOffsetSeconds": 10800, "sessionsSyncedAt": "2019-08-24T14:15:22Z", "openNow": true, "nextOpen": null, "nextClose": null, "trade": { "server": [ { "day": "sunday", "open": "00:01", "close": "23:58" } ], "utc": [ { "day": "sunday", "open": "00:01", "close": "23:58" } ] }, "quote": { "server": [ { "day": "sunday", "open": "00:01", "close": "23:58" } ], "utc": [ { "day": "sunday", "open": "00:01", "close": "23:58" } ] } }}List the symbols an account's broker offers GET
Every symbol the account's broker offers it, with its contract specification, as read from the broker when the account was last online — so it answers while the account is offline. Refreshed each time the account comes online and the list is a day old. `syncedAt` says when. Returns 409 `SYMBOLS_NOT_SYNCED` for an account that has never been online.
Read an account's symbols from its broker now POST
Reads the broker's symbol list again and remaps the instruments, for when the broker has added symbols. Needs the account online (`ready`); returns 409 `ACCOUNT_NOT_READY` otherwise. It happens on its own once a day while the account is online, so most integrations never call this.