- Visit SimpleFX.
- Go to the menu (hamburger button) and select Settings.
- Alternatively, you can directly visit: Settings.
- Select API.
- Alternatively, visit: API Client.
- Click Create API Key.
- Fill in the API Key creation fields:
- Name: Choose any name you prefer.
- Trade Permissions: Select checkboxes with permissions you need.
- IP Address Whitelist: Add your public IP address or leave this field empty if you want your key to be accessible from anywhere.
- Click Create.
- Copy and save your API key secret, as you will not be able to view it again.
- Go back to the API Key Manager; your key should appear in either the confirmed or pending list.
- Copy API key ID for the newly created key.
- Confirm your API key using two-factor authentication (2FA) or, if 2FA is not configured, via the email confirmation link.
Visit the SimpleFX interactive API to test API functionality.
- Navigate to Authentication - POST /api/v3/auth/key, expand it, and click Try it out.
- You will see the following in the Edit value field:
{ "clientId": "string", "clientSecret": "string" }
- Replace
"string"
with your API key ID and API key secret:{ "clientId": "989c4d4441***********4c1401a9fe8", "clientSecret": "bb****d6-a**8-4**e-a**c-4e********97" }
- Click Execute.
- This will send a request to the SimpleFX server.
- You can view the response either in the developer tools (press F12) under the Network tab or in the response area below.
- If the API key and secret are valid, the response code will be 200, and you will receive an ACCESS TOKEN.
- Copy the token (
data.token
) to your clipboard.
- At the top of the interactive API page, click the Authorize button.
- In the Value field, enter your ACCESS TOKEN, and click Authorize.
- You are now authorized to use other endpoints in the interactive API.
- Navigate to Accounts - GET /api/v3/accounts.
- Expand Try it out and click Execute.
- You will receive a response with a list of your trading accounts.
The API Key alone cannot be used to authorize requests. You must first obtain an ACCESS TOKEN. Here's a breakdown of the process:
- Body: A JSON format containing your API key ID and secret.
- Header: Ensure the
Content-Type: application/json
header is included so the server understands your request correctly.
Once you obtain the access token, it will be embedded in the browser client and included in further requests. For example, in the /api/v3/accounts
endpoint, your token will be added as an HTTP header: Authorization: Bearer <ACCESS_TOKEN>
.
Swagger’s interactive API lets you test server interactions, view messages sent and received, and analyze the entire communication process. Learn more about Swagger here. You can also use Swagger Codegen to automatically generate API libraries in popular programming languages.
Quotes and prices cannot be retrieved via a REST HTTP API because they change within milliseconds. Instead, SimpleFX uses WebSocket for streaming quotes.
The WebSocket connection is established at:
wss://web-quotes-core.simplefx.com/websocket/quotes
Once connected, the serwer will emit /quotes/subscribed
event with a list of last prices.
This method subscribes to real-time price updates for a list of symbols.
Request:
{
"p": "/subscribe/addList",
"i": 1,
"d": ["BTCUSD", "LTCUSD", "ETHUSD"]
}
- p: Request type.
- i: Request ID (incremented for each request).
- d: List of symbols to subscribe to.
Response: Upon successful subscription, the WebSocket will send a confirmation:
{
"p": "/subscribe/addList",
"i": 1
}
- p: Request type.
- i: The request ID matching the original subscription request.
To unsubscribe from a list of symbols or all symbols:
Request (Unsubscribe from specific symbols):
{
"p": "/subscribe/removeList",
"i": 2,
"d": ["BTCUSD", "ETHUSD"]
}
- p: Request type.
- i: Request ID.
- d: List of symbols to unsubscribe from.
Response:
{
"p": "/subscribe/removeList",
"i": 2
}
- p: Request type.
- i: The request ID matching the original unsubscribe request.
Request (Unsubscribe from all symbols):
{
"p": "/subscribe/removeAll",
"i": 3
}
- p: Request type.
- i: Request ID.
Response:
{
"p": "/subscribe/removeAll",
"i": 3
}
- p: Request type.
- i: The request ID matching the original unsubscribe request.
This request retrieves the last known prices for a set of symbols.
Request:
{
"p": "/lastprices/list",
"i": 4,
"d": ["BTCUSD", "LTCUSD", "ETHUSD"]
}
- p: Request type.
- i: Request ID.
- d: List of symbols to fetch the last prices for.
Response:
{
"p": "/lastprices/list",
"i": 4,
"d": [
{"s": "BTCUSD", "b": 3930.37, "a": 3979.59, "t": 1643223911},
{"s": "LTCUSD", "b": 30.32, "a": 31.81, "t": 1643223911},
{"s": "ETHUSD", "b": 112.38, "a": 115.99, "t": 1643223911}
]
}
- p: Request type.
- i: Request ID matching the original request.
- d: List of symbols (
s
) with their bid price (b
), ask price (a
), and Unix timestamp (t
).
Once subscribed, real-time quotes for the subscribed symbols are received automatically via the WebSocket.
Event - Incoming Quote Update:
{
"p": "/quotes/subscribed",
"d": [
{"s": "BTCUSD", "b": 3930.37, "a": 3979.59, "t": 1643223911},
{"s": "LTCUSD", "b": 30.32, "a": 31.81, "t": 1643223911},
{"s": "ETHUSD", "b": 112.38, "a": 115.99, "t": 1643223911}
]
}
- p: Event type.
- d: List of symbols (
s
) with their bid price (b
), ask price (a
), and Unix timestamp (t
).
The SimpleFX SignalR API for streaming quotes has been deprecated and will be removed in the future. The current implementation uses SignalR 2.x (not SignalR Core). There is no plan to migrate the SignalR API to SignalR Core. Please plan accordingly.
Quotes and prices cannot be retrieved via a standard HTTP API because they change within milliseconds. Instead, SimpleFX uses SignalR for streaming quotes. You can connect to the quotes stream at this endpoint: https://webquotes-v3.simplefx.com/signalr/. The descriptor file is available here.
Request:
{
"H": "quotessubscribehub",
"M": "getLastPrices",
"A": [["BTCUSD", "LTCUSD", "ETHUSD", "TLRY.US", "GWPH.US"]],
"I": 0
}
Parameters:
- hub:
quotessubscribehub
- method:
getLastPrices
- arguments:
- 0: List of instruments to request prices for (
["BTCUSD", "LTCUSD", "ETHUSD", "TLRY.US", "GWPH.US"]
).
- 0: List of instruments to request prices for (
Response:
{
"R": {
"data": [
{ "s": "BTCUSD", "b": 3930.37, "a": 3979.59, "t": 1543223911 },
{ "s": "LTCUSD", "b": 30.3267, "a": 31.8091, "t": 1543223911 },
{ "s": "ETHUSD", "b": 112.38, "a": 115.998, "t": 1543223911 },
{ "s": "TLRY.US", "b": 115.39, "a": 116.1, "t": 1542995999 },
{ "s": "GWPH.US", "b": 123.57, "a": 124.1, "t": 1542995999 }
],
"code": 200,
"message": "OK",
"webRequestId": null
},
"I": "0"
}
Fields:
- s: Symbol of the instrument.
- b: Bid price.
- a: Ask (offer) price.
- t: Unix timestamp of the last price update.
Request:
{
"H": "quotessubscribehub",
"M": "subscribeList",
"A": [["BTCUSD", "LTCUSD", "ETHUSD", "TLRY.US", "GWPH.US"]],
"I": 5
}
Parameters:
- hub:
quotessubscribehub
- method:
subscribeList
- arguments:
- 0: List of instruments (
["BTCUSD", "LTCUSD", "ETHUSD", "TLRY.US", "GWPH.US"]
).
- 0: List of instruments (
Response (Subscription Confirmation):
{"R":{"code":200,"message":"OK","webRequestId":null},"I":"5"}
Incoming Quote Events:
{
"C": "d-7964E528-B,0|_7,1|_8,1",
"M": [
{
"H": "QuotesSubscribeHub",
"M": "ReceiveQuotes",
"A": [
[
{ "s": "LTCUSD", "b": 30.3265, "a": 31.8097, "t": 1543223912 },
{ "s": "BTCUSD", "b": 3930.35, "a": 3979.67, "t": 1543223912 },
{ "s": "ETHUSD", "b": 112.379, "a": 116, "t": 1543223912 }
]
]
}
]
}