Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Datastream /
avatar image
Question by daniel.fenn · Jun 15, 2020 at 12:54 PM · datastreamdsws.apikeyerror

KeyError: 'DataResponse' when running ds.get_data(tickers='VOD', fields='P', kind=0)

I'm getting this error message running the simple example from the "Datastream Web Service Getting Started with Python Guide". This was running fine a few days ago. Any suggestions, please?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Jun 16, 2020 at 05:25 AM

@daniel.fenn

It may receive an invalid response from the server.

To verify the retrieved response, please run this code when the problem occurred.

import requests
post_msg =    {
        "DataRequest": {
            "DataTypes": [
                {
                    "Properties": None,
                    "Value": "P"
                }
            ],
            "Date": {
                "End": "",
                "Frequency": "",
                "Kind": 0,
                "Start": ""
            },
            "Instrument": {
                "Properties": None,
                "Value": "VOD"
            },
            "Tag": None
        },
        "Properties": {
            "Key": "Source",
            "Value": None
        },
        "TokenValue": ds.tokenResp['TokenValue']
    }

res = requests.post("https://product.datastream.com/DSWSClient/V1/DSService.svc/rest/GetData", json=post_msg)
print(res.status_code)
print(res.headers)
print(res.text)

The output looks like:


200
{'Content-Type': 'application/json; charset=utf-8', 'Server': 'Microsoft-IIS/10.0', 'X-Powered-By': 'ASP.NET', 'Date': 'Tue, 16 Jun 2020 05:22:20 GMT', 'Content-Length': '266'}
{"DataResponse":{"AdditionalResponses":null,"DataTypeNames":null,"DataTypeValues":[{"DataType":"P","SymbolValues":[{"Currency":"£ ","Symbol":"VOD","Type":5,"Value":124.46}]}],"Dates":["\/Date(1592179200000+0000)\/"],"SymbolNames":null,"Tag":null},"Properties":null}

From the output, there is a "DataResponse" key in the response.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
8 People are following this question.

Related Questions

DatastreamDSWS2R - not data returned for certain tickers

Where to get historical data for Eikon fields not supporting SDate?

How to get month end data in timeseries request in R

Retrieving volume traded for debt instrument

How to desactivate Datastream auto calculation in VBA ?

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges