Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

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.

#technologywebsockets
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
26.3k 61 17 14

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.


1705394986191.png (61.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.