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
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛