Websocket api. How to get average rates for FX rates

I want to get average fx rate for a currency using websocket API for every 30min.

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @srinivasa.p

    You can send the request message for the currency RIC with the following JSON message:

    {
        "ID":2,
        "Key":{
            "Name":"THB="
        }
    }

    Or

    {
        "ID":2,
        "Key":{
            "Name":"THB=",
            "Service": "<Your Service Name>"
        }
    }

    Please find more detail about how to request data with the WebSocket API from the following resources:

    The currency RICs are mostly in the "<Currency>=" format like the following:

    • THB= --> US Dollar/Thai Bath FX Spot rate
    • JPY= --> US Dollar/Japanese Yen FX Spot rate
    • etc

    You can find the currency RIC that you want from the RIC-Search tool page as follows.

    1705394986191.png


    About the "for every 30min", you may modify your application source code to sends a request message as a "snapshot" request every 30 minutes.

    {
      "ID":2,
      "Key":{
        "Name":"THB=",
        "Service":"ELEKTRON_DD"
      },
      "Streaming":false
    }

    You can find the WebSocket API examples from the https://github.com/Refinitiv/websocket-api GitHub repository.