For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
3 1 1 3

Currency conversion rate using DSS Rest API (Direct Http)

  1. We want to get live(Real time) conversion rate for various currencies is it possible to get the conversion rate from DSS API just by passing the ISO currency code ( something like for example using "Currency Code" and "Base Currency Code" to get USD to JPY and JPY to USD conversion rate) or the identifier(IdentifierType, Identifier) is the mandatory input param that needs to be added to the instrument list to get the conversion rate for each currency.
  2. If identifier is the mandatory input param which identifier we need to use to get the latest live conversion rate for specific currency For example: To get USD to JPY currency conversion which one of the following identifier we should use(there are more than 40 identifiers to choose from) JPY=, JPY=E, JPY=A.Similarly which one to use for JPY to USD conversion JPYUSD=R, JPYUSD=X
  3. While sending request for some of the currencies conversions(like JPY,INR To USD) the MidPrice response doesn't reflect the exact conversion rate. For example: Below request returns the Mid Price value for JPY to USD conversion as 0.8833 where as the exact conversion rate is 0.008833(as per xe.com).(Looks like mismatch in decimal place .Is there any field we can use to get the exact decimal place? ).Price Decimals field doesn't give exact decimal place.Similar case with INR.
 
Request :
curl -X POST -H "Authorization: Token <our_auth_token_goes_here>" -H "Prefer: respond-async; wait= 60" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 9eb68938-629a-74ca-f010-5417821ad443" -d '{
    "ExtractionRequest": {
        "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest",
        "ContentFieldNames": [
            "Currency Code",
            "Base Currency Code",
            "Mid Price",
            "Price Decimals",
            "Trade Date",
            "Trade Time",
            "Last Update Time",
            "Instrument Snap Time",
            "Security Description"
        ],
        "IdentifierList": {
            "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
            "InstrumentIdentifiers": [
                {
                    "Identifier": "JPYUSD=R",
                    "IdentifierType": "Ric",
                    "UserDefinedIdentifier" : "JPY To USD Conversion"
                },
                 {
                    "Identifier": "INRUSD=R",
                    "IdentifierType": "Ric",
                    "UserDefinedIdentifier" : "JPY To USD Conversion"
                }
            ]
        },
        "Condition": {
            "ScalableCurrency" : "true"
        }
    }
}
' "https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractWithNotes"
Response :
{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Ric",
            "Identifier": "JPYUSD=R",
            "UserDefinedIdentifier": "JPY To USD Conversion",
            "Currency Code": "USD",
            "Base Currency Code": "JPY",
            "Mid Price": 0.8833,
            "Price Decimals": 4,
            "Trade Date": "2017-02-10",
            "Trade Time": "21:59",
            "Last Update Time": "02/10/2017 15:00:01",
            "Instrument Snap Time": "02/10/2017 16:02:47",
            "Security Description": "Japanese Yen/US Dollar FX Cross Rate"
        },
        {
            "IdentifierType": "Ric",
            "Identifier": "INRUSD=R",
            "UserDefinedIdentifier": "JPY To USD Conversion",
            "Currency Code": "USD",
            "Base Currency Code": "INR",
            "Mid Price": 1.4958,
            "Price Decimals": 4,
            "Trade Date": "2017-02-10",
            "Trade Time": "20:42",
            "Last Update Time": "02/10/2017 15:00:01",
            "Instrument Snap Time": "02/10/2017 16:02:47",
            "Security Description": "Indian Rupee/US Dollar FX Cross Rate"
        }
    ],
    "Notes": [
        "Extraction Services Version 10.8.36127 (95fc12628942), Built Jan 13 2017 03:26:24\r\nProcessing started at 02/10/2017 16:02:47.\r\nUser ID: 9010934\r\nExtraction ID: 247060640\r\nSchedule: _OnD_0x0599e569542b2f96 (ID = 0x0599e569e37b2f96)\r\nInput List (2 items): _OnD_0x0599e569542b2f96 (ID = 0599e569a80b2f96) Created: 02/10/2017 16:02:45 Last Modified: 02/10/2017 16:02:45\r\nSchedule Time: 02/10/2017 16:02:46\r\nReport Template (15 fields): _OnD_0x0599e569542b2f96 (ID = 0x0599e56983eb2f96) Created: 02/10/2017 16:02:45 Last Modified: 02/10/2017 16:02:45\r\nNo prices needed currency scaling.\r\nReal-time data was snapped at 02/10/2017 16:02:47, it was scheduled to snap at 02/10/2017 16:02:46.\r\nNo embargo required for this report.\r\nProcessing completed successfully at 02/10/2017 16:02:47, taking 0.320 Secs.\r\nExtraction finished at 02/10/2017 23:02:47 UTC, with servers: x09i02, QSHA02 (0.1 secs), QSHC08 (0.0 secs)\r\nUsage Summary for User 9010934, Client 105455, Template Type Intraday Pricing\r\nBase Usage\r\n        Instrument                          Instrument                   Terms          Price\r\n  Count Type                                Subtype                      Source         Source\r\n------- ----------------------------------- ---------------------------- -------------- ----------------------------------------\r\n      2 Money Market                                                     N/A            N/A\r\n-------\r\n      2 Total instruments charged.\r\n      0 Instruments with no reported data.\r\n=======\r\n      2 Instruments in the input list.\r\nNo TRPS complex usage to report -- 2 Instruments in the input list had no reported data.\r\n"
    ]
}
dss-rest-apidatascope-selectdsshistoricalforex
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
11.3k 25 8 13

To retrieve real-time data via the IntradayPricing extraction, you need to use a RIC(i.e. JPY=) as an identifier.

The question#2 and #3 are directly related to content query. I have researched and found the following information. The "=E" suffix is Real-time price quoted by an European contributor, while the "=A" suffix is Real-time price quoted by an Asian contributor. This means that If you do not want rate in specific region, you should use the composite RIC (i.e. JPY=).

Regarding the cross rate, the "=R" suffix means that the rate calculated by TR, while, the "=X" suffix means the rate is 10 minutes snapshot, so you should use the RIC with "=R" suffix. (i.e. JPYUSD=R)

For the mid price, your understand is correct. There is the "Cross Scaling Factor" field providing scaling factor applied to raw data. You can use this field to calculate the actual value. For example, if the "Cross Scaling Factor" of the JPYUSD=R is 100 and Mid Price is 0.873. The actual raw data of Mid Price should be 0.873 / 100 = 0.00873.

Hope this helps.

  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
  "Contents": [
    {
      "IdentifierType": "Ric",
      "Identifier": "JPYUSD=R",
      "Currency Code": "USD",
      "Base Currency Code": "JPY",
      "Mid Price": 0.873,
      "Cross Scaling Factor": "100",
      "Price Decimals": 4,
      "Trade Date": "2017-02-15",
      "Trade Time": "08:40",
      "Last Update Time": "02/15/2017 15:40:09",
      "Instrument Snap Time": "02/15/2017 15:40:10",
      "Security Description": "Japanese Yen/US Dollar FX Cross Rate"
    }
icon clock
10 |1500

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

Click below to post an Idea Post Idea