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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
23 0 1 1

Eikon Data Api Not Displaying Any Streaming Prices

Morning All,


A customer of mine is trying the code below but for some odd reason he is not getting any Streaming Prices and it worked before. Sadly I'm no Eikon Data API boffin so Lost ATM.


Example Of His Script below:


{

"cells": [

{

"cell_type": "code",

"execution_count": 1,

"metadata": {},

"outputs": [

{

"data": {

"text/plain": [

"<httplib2.Http at 0x24e92e9f670>"

]

},

"execution_count": 1,

"metadata": {},

"output_type": "execute_result"

}

],

"source": [

"import eikon as ek\n",

"import datetime\n",

"import yfinance as yf\n",

"import numpy as np\n",

"import pandas as pd\n",

"from eikon import Profile as profile\n",

"ek.set_app_key('<app_key>')\n",

"import httplib2\n",

" \n",

"# detect presense of proxy and use env varibles if they exist\n",

"pi = httplib2.proxy_info_from_environment()\n",

"if pi:\n",

" import socks\n",

" socks.setdefaultproxy(pi.proxy_type, pi.proxy_host, pi.proxy_port)\n",

" socks.wrapmodule(httplib2) \n",

" \n",

"# now all calls through httplib2 should use the proxy settings\n",

"httplib2.Http()\n"

]

},

{

"cell_type": "code",

"execution_count": 3,

"metadata": {},

"outputs": [],

"source": [

"def display_refreshed_fields(streaming_price, instrument_name, fields):\n",

" current_time = datetime.datetime.now().time()\n",

" print(current_time, \"- Refresh received for\", instrument_name, \":\", fields)"

]

},

{

"cell_type": "code",

"execution_count": 4,

"metadata": {},

"outputs": [],

"source": [

"def display_updated_fields(streaming_price, instrument_name, fields):\n",

" current_time = datetime.datetime.now().time()\n",

" print(current_time, \"- Update received for\", instrument_name, \":\", fields)"

]

},

{

"cell_type": "code",

"execution_count": 6,

"metadata": {},

"outputs": [],

"source": [

"def display_status(streaming_price, instrument_name, status):\n",

" current_time = datetime.datetime.now().time()\n",

" print(current_time, \"- Status received for\", instrument_name, \":\", status)"

]

},

{

"cell_type": "code",

"execution_count": 7,

"metadata": {},

"outputs": [],

"source": [

"\n",

"def display_complete_snapshot(streaming_prices):\n",

" current_time = datetime.datetime.now().time()\n",

" print(current_time, \"- StreamingPrice is complete. Full snapshot:\")\n",

" display(streaming_prices.get_snapshot())"

]

},

{

"cell_type": "code",

"execution_count": 8,

"metadata": {},

"outputs": [],

"source": [

"streaming_prices = ek.StreamingPrices(\n",

" instruments = ['EUR=','GBP=','JPY=', 'CAD='], \n",

" fields = ['SALTIM', 'CF_BID','CF_ASK','OPEN_PRC', 'CF_HIGH','CF_LOW', 'CF_CLOSE'],\n",

" on_refresh = lambda streaming_price, instrument_name, fields : \n",

" display_refreshed_fields(streaming_price, instrument_name, fields),\n",

" on_update = lambda streaming_price, instrument_name, fields : \n",

" display_updated_fields(streaming_price, instrument_name, fields),\n",

" on_status = lambda streaming_price, instrument_name, status : \n",

" display_status(streaming_price, instrument_name, status),\n",

" on_complete = lambda streaming_price : \n",

" display_complete_snapshot(streaming_price)\n",

")"

]

},

{

"cell_type": "code",

"execution_count": null,

"metadata": {},

"outputs": [],

"source": [

"streaming_prices.open()"

]

},

{

"cell_type": "code",

"execution_count": null,

"metadata": {},

"outputs": [],

"source": [

"streaming_prices.close()"

]

}

],

"metadata": {

"kernelspec": {

"display_name": "EIKON",

"language": "python",

"name": "eikon"

},

"language_info": {

"codemirror_mode": {

"name": "ipython",

"version": 3

},

"file_extension": ".py",

"mimetype": "text/x-python",

"name": "python",

"nbconvert_exporter": "python",

"pygments_lexer": "ipython3",

"version": "3.8.3"

}

},

"nbformat": 4,

"nbformat_minor": 4

}

Any suggestions to help would be greatly appreciated.


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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.

10 Answers

Upvotes
Accepted
23 0 1 1

@wasin.waeosri - Noted with thanks I am from that Team and after all the testing I did it might be one of 2 things, Server OS Causing issues or the Web proxy they use.


Thanks for the info

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.

Upvotes
11.5k 16 7 10

Hello @Eugene.Diedericks

I have tested the client's Jupyter Notebook code and Eikon Data API version 1.1.8. It works fine in my environment.

What is the version of Eikon Data API that the application is using? Can his Eikon/Workspace desktop application get streaming quote data (via Quote App, etc)?

Could you please ask the client to try the steps in this troubleshooting article?



result.png (72.5 KiB)
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.

@wasin.waeosri


Sorry for the delay in response: Thanks for the Input

The customer has not checked this as yet - What is the version of Eikon Data API that the application is using? Can his Eikon/Workspace desktop application get streaming quote data (via Quote App, etc)?


Have been going back and forth with the customer and found he is running on a Virtual Environment and Eikon is installed on Server 2016/2019 - My 1st issue

Python version 1.1.8


Then they have had issues with the proxy before and I think this line of code explains that as well but stand to be corrected: See attached

Have never had a request to Run Eikon Data API on Server but from a support perspective Server, OS is not supported.

error-code.png (233.5 KiB)
Upvotes
1 0 0 0

@wasin.waeosri - Customer followed the steps as per article:


The port is not the same in the two files


{"port":9000,"mode":"eikon4","pid":9360,"hasSecure":true,"startedTime":"Thu Jan 21 2021 10:37:00 GMT+0400 (Arabian Standard Time)","subApps":[{"path":"/heap"},{"path":"/ping"},{"path":"/sxs","data":{"hasSecure":true,"sxsApps":{}}},{"path":"/api"}]}SxS.20210118.113722000.p13000.txtATT37465.portInUse.txt


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.

Upvotes
11.5k 16 7 10

Hello @e.diedericks

Thank you for the information. Could you please clarify "he is running on a Virtual Environment and Eikon is installed on Server" message? Does the client Eikon and application are on the same machine?

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.

@wasin.waeosri _ I belive so he only has the Virtual Server to work with.

Hi @e.diedericks

I mean do Eikon run in the host OS and application run in the guest OS (VM)?

Upvotes
23 0 1 1

@wasin.waeosri - No Both / All are running on the same machine (Server OS)

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.

Upvotes
23 0 1 1

@wasin.waeosri I have some more information and tests he did and its strange, after a few events of the connection trying to connect as the Connection gets Forbidden (403) and it seems it's due to PySocks HTTP proxy Server that does not support PySocks. I have added some threads I am allowed to add to the My Input.txtcase:


my-input.txt (3.7 KiB)
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.

Hello @Eugene.Diedericks

Additionally, you may contact the Eikon technical support team to investigate this Forbidden 403 connection issue.

Upvotes
11.5k 16 7 10

Hello @Eugene.Diedericks

Thank you for the information. The 'Socket error: 403: Forbidden\n\n[*] Note: The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy)' error message looks suspicious to me. The HTTP 403 meaning access to the requested resource is forbidden for some reason.

Could you please ask the client the reason for this code?

# detect presense of proxy and use env varibles if they exist
pi = httplib2.proxy_info_from_environment()
if pi:
 import socks
 socks.setdefaultproxy(pi.proxy_type, pi.proxy_host, pi.proxy_port)
 socks.wrapmodule(httplib2) 
 
# now all calls through httplib2 should use the proxy settings
httplib2.Http()

Additionally, could you please give us more detail on the following points?

  • Does the problem occur if the client runs Eikon Desktop and Python application on the Host OS (maybe another machine?)
  • Eikon Desktop version
  • 'pip list' result
  • Could the client clean Eikon cache then restart Eikon and retry to run the Python script?

Please also activate the trace log in the application script

  • add environment variable: HTTPX_LOG_LEVEL=trace
  • add ek.set_log_level(1) in the Python script
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.

Upvotes
23 0 1 1

@wasin.waeosri thank you so much for all the input I have drafted my report and sent all the requests to the customer to try. If he is not able to do the few steps for cache and Logs I will assist the user with this.


In regards to Eikon version - the workstation is running 4.0.52055


Will provide all the other info shortly, thanks again


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.

Upvotes
23 0 1 1

@wasin.waeosri We just had a remote session with the Customer:


  1. The only machines they have to work with are Windows Server OS sadly but Eikon works perfectly on the machine, real-time charts and quote all work great.
  2. I saw there was an Eikon Version Update that I did for customer to version 4.0.53 but no change of note.
  3. Eikon Data API Proxy is Ready and working each time and Juniper session restarted and checked - Connected
  4. We did a small Dummy script and seems the error starts with the 1st section of any code. The data snapshot request does not even run but I am glad I only see 2 errors now and not the large range of errors we did before:
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

    <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">html,body{height:100%;padding:0;margin:0;}.oc{display:table;width:100%;height:100%;}.ic{display:table-cell;vertical-align:middle;height:100%;}div.msg{display:block;border:1px solid #30c;padding:0;width:500px;font-family:helvetica,sans-serif;margin:10px auto;}h1{font-weight:bold;color:#fff;font-size:14px;margin:0;padding:2px;text-align:center;background: #30c;}p{font-size:12px;margin:15px auto;width:75%;font-family:helvetica,sans-serif;text-align:left;}</style><title>403 Forbidden: incorrect proxy service was requested</title></head><body><div class="oc"><div class="ic"><div class="msg"><h1>403 Forbidden: incorrect proxy service was requested</h1><p><p>The webserver reported that an error occurred while trying to access the website. Please click <u><a href="javascript:history.back()">here</a></u> to return to the previous page.</p>

    <p>

    URL: http://127.0.0.1:9060/api/v1/data&lt;br />

    <br/>User name:

    <br/>Group name:

    </p></p></div></div></div></body></html>


    2021-01-22 12:17:13,137 P[17916] [MainThread 11828] HTTP request failed: EikonError-Client Error: <!-- IE friendly error message walkround.

    if the error message from the server is less than

    512 bytes IE v5+ will use its own error message instead of the one returned by the server. -->

  6. Did some digging on Stack Over Flow and the 2 errors we see now might be related to the

    • The HTTP Response body’s byte length must be shorter than a threshold value - I have increased this but no luck.
  7. Added his Local proxy to the Eikon Config Manager as well and all apps still work fine on and off the proxy.

- Populated the Log Level on Eikon and waiting for the Logs to come through and will add to this post.


Thanks again,

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.

Upvotes
23 0 1 1

@wasin.waeosri - Hope you well, just wanted to check in if you saw my previous post alert?


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.

Hello @Eugene.Diedericks

This connection issue requires an investigation from the Eikon Technical Support team. I strongly suggest you contact the Eikon Technical Support team to help the client check this issue.

Click below to post an Idea Post Idea