Forex
Forex rate data stream.
Connect
- websocat
- wscat
websocat wss://api.datamaxiplus.com/ws/v1/forex -H 'X-DTMX-APIKEY: $YOUR_API_KEY'
wscat -c wss://api.datamaxiplus.com/ws/v1/forex -H 'X-DTMX-APIKEY: $YOUR_API_KEY'
Subscribe
method
specifies the type of request.params
list represents forex symbols (e.g. "USD-KRW") that user wants to subscribe. You can request the list of supported forex symbols with /api/v1/forex/symbols endpoint.id
uniquely identifies the subscription request.
- schema
- example
{
"method": "SUBSCRIBE",
"params": [
string
],
"id": int32
}
{
"method": "SUBSCRIBE",
"params": [
"USD-KRW"
],
"id": 1
}
If the subscription was successful, the server responds with the message in the following format.
result
corresponds to a list of successfully subscribed symbols.id
corresponds to the subscription request ID.
- schema
- example
{
"result": [
string
],
"id": int32
}
{
"result": [
"USD-KRW"
],
"id": 1
}
Response
- The
s
represents forex symbol. - The
d
represents the date and the time. - The
r
represent forex rate.
- schema
- example
{
"s": string
"d": int
"r": float
}
{
"s": "USD-KRW",
"d": 1722913391794,
"r": 1371.54
}