Python API runs indefinitely without a response

Hello, I am having problems with the function ek.get_data(). When I do a request no error message or data is returned and the code keeps running indefinitely without a response. Could someone help me with this issue?
Thanks
Best Answer
-
I don't see the log level command before set_app_key call. Did you invoke it?
ek.set_log_level(logging.DEBUG)
Can you also please follow all the steps in this troubleshooting article to see if it gets any better.
I also wanted to mention, that these forums are development support only. We do not have any visibility into the servers/operations support. If it comes to that, you will have to open a support ticket at my.refinitiv.com.
0
Answers
-
Hello @rone.almeida
Could you please share your snippet code and the versions of Python/Eikon Data API?
0 -
This is my code:
datas, err = ek.get_data(['.BVSP'],
['TR.PriceClose.date','TR.PriceClose'],
{'SDate': '2021-04-29', 'EDate':'2021-04-30', 'FRQ': 'D'})
Last week, this code was running normally. Python version is 3.9.5 and Eikon version is 4.0.53072.
0 -
Hello @rone.almeida,
There is nothing wrong with your API query. Can you try restarting your computer and Eikon and try again. You can also enable logging on the system to capture the raw requests and responses from Eikon. Use something like this, and it should pinpoint the problem area:
import logging.config
import eikon as ek
ek.set_log_level(logging.DEBUG)
ek.set_app_key('**app key**')
datas, err = ek.get_data(['.BVSP'], ['TR.PriceClose.date','TR.PriceClose'], {'SDate': '2021-04-29', 'EDate':'2021-04-30', 'FRQ': 'D'})The output should be something like:
20..2] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...
20..2] Request to http://127.0.0.1:9060/api/status headers = {'x-tr-applicationid': '***'} params = None
20..2] Checking port 9060 response : 200 - {"statusCode":"ST_PROXY_READY","version":"2.8.0"}
20..2] Port 9060 was retrieved from .portInUse file
20..2] Try to handshake on url http://127.0.0.1:9060/api/handshake...
20..2] Request to http://127.0.0.1:9060/api/handshake headers = {'Content-Type': 'application/json', 'x-tr-applicationid': '***'} params = None
20..2] Response : 200 - {"access_token":"****","expires_in":1209600,"token_type":"bearer"}
20..2] Application ID: ***
20..2] Init a Desktop session with new app_key
20..2] Port 9060 on local proxy was detected
20..2] Request:{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['.BVSP'], 'fields': [{'name': 'TR.PriceClose.date'}, {'name': 'TR.PriceClose'}], 'parameters': {'SDate': '2021-04-29', 'EDate': '2021-04-30', 'FRQ': 'D'}}]}}}
20..2] Request to http://127.0.0.1:9060/api/v1/data headers = {'Content-Type': 'application/json', 'x-tr-applicationid': '***', 'Authorization': 'Bearer ****'} params = None
20..2] HTTP Response code: 200
20..2] HTTP Response: {"responses":[{"columnHeadersCount":1,"data":[[".BVSP","2021-04-29T00:00:00Z",120065.75],[".BVSP","2021-04-30T00:00:00Z",118893.84]],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Date","field":"TR.PRICECLOSE.DATE"},{"displayName":"Price Close","field":"TR.PRICECLOSE"}]],"rowHeadersCount":1,"totalColumnsCount":3,"totalRowsCount":3}]}0 -
I restarted my computer and Eikon and still it isn´t getting any response. Even the ek.set_app_key() is not working (Picture attached). Could you guys check your server?
0 -
I tried to run this code:
screener_exp = 'SCREEN(U(IN(Equity(active or inactive,public))),IN(TR.ExchangeCountryCode,"BR"), CURN=USD)'
companies_data, err = ek.get_data(instruments=[screener_exp], fields=['TR.InstrumentType','TR.CommonName','TR.PriceClose.date'])
And I got this output:
0 -
I can run it properly.
What is the version of Python you are using?
Please run the 'pip list" command to verify the versions of Python Libraries used by the machine.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛