Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by Bob Dylan · Sep 03, 2019 at 10:58 AM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikonapireikon-data-api-rproxy

R eikonapir - Proxy

I have tried running the package/command through R studio But I keep runing into the same error

> install_github("ahmedmohamedali/eikonapir") > library(eikonapir) > data_frame = get_data(list("IBM", "GOOG.O", "MSFT.O"), list("TR.PriceClose", "TR.Volume", "TR.PriceLow"))

with the response

No encoding supplied: defaulting to UTF-8. Error in print.default("HTTP Error, code= ", response$status_code, sep = "") : invalid 'digits' argument

There is a proxy in my firm. In order to install package from GitHub, for example, I use

file.edit('~/.Renviron')
http_proxy ='http://username:password@serveradress:8080'
https_proxy ='http://username:password@serveradress:8080'

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.

14 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov.1 · Sep 06, 2019 at 07:22 PM

It looks like the proxy settings in your .Renviron file are the culprit. With these proxy settings httr library used by eikonapir package to send HTTP requests to Eikon API Proxy forwards HTTP requests addressed to localhost to the remote proxy. The remote proxy returns these requests back to your machine, but now the request comes from the remote proxy rather than from the local machine and Eikon API Proxy rejects the request.
You need to find a way to bypass the proxy for requests sent to localhost. I'm afraid I cannot give you simple instructions, as there are too many variables here. It looks like you're using Mac. You may be able to configure proxy server in the Network settings rather than in .Renviron file. In this case in the same window you can configure bypassing proxy for localhost. You may simply comment out proxy settings in .Renviron file when retrieving data from Eikon and uncomment them when you need to download packages or retrieve other data from the Internet. There may be other ways to bypass the proxy for local addresses.

Comment
Bob Dylan

People who like this

1 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.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Sep 03, 2019 at 11:24 AM
I don't see why these three lines of code would result in this error. Is it the last line that produces the error? Or is it the install_github function? Or is it some other part of your code?
This said I do have a couple of comments on these 3 lines:
  1. You only need to install eikonapir library once. There's no need to call install_github function every time you retrieve data from Eikon.
  2. After loading eikonapir library using library(eikonapir) function and before retrieving data from Eikon using get_data you need to call set_app_id with the app key created with App Key Generator app in Eikon application.
Comment
Bob Dylan

People who like this

1 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.

avatar image
Answer by Bob Dylan · Sep 03, 2019 at 11:28 AM

many thanks for the promot reply. For 1 , no , not install the eikonapi everytime. for 2 its

data_frame = get_data(list("IBM", "GOOG.O", "MSFT.O"), list("TR.PriceClose", "TR.Volume", "TR.PriceLow")) generating error and I suspect it's linked with port or proxy. I tried the code in a PC without company policy and it worked.

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.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Sep 03, 2019 at 11:56 AM

Before we start checking connectivity on the local port, please verify you call set_app_id method with a valid app key. get_data method cannot possibly return data unless you set correct app key. See the following previous thread on this forum.
https://community.developers.refinitiv.com/questions/28988/eikon-api-errors-in-previously-working-scripts.html

Comment
Bob Dylan

People who like this

1 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.

avatar image
Answer by Bob Dylan · Sep 05, 2019 at 10:19 AM

many thanks for this prompt post. I use app key generator to generate a new key and the situation remains.

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.

avatar image
Answer by Bob Dylan · Sep 05, 2019 at 10:25 AM

reading all the relevant post , I also tried "http://localhost:9000/api/v1/data" in my browser and it returns "Internal Server Error"

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.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Sep 05, 2019 at 12:40 PM

Internal Server Error in response to HTTP GET request from the browser indicates that Eikon API Proxy is up and listening on port 9000. Could you try the following call and post the result?


               

get_data('TRI.N', 'TR.PriceClose', debug=TRUE, raw_output=TRUE)

Comment
Bob Dylan

People who like this

1 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.

avatar image
Answer by Bob Dylan · Sep 05, 2019 at 12:47 PM

hi Alex thanks for the quick response again . I got the following answer

No encoding supplied: defaulting to UTF-8.
[1] "Request *************************************"
{"Entity":{"E":["DataGrid"],"W":{"instruments":[["TRI.N"]],"fields":[{"name":["TR.PriceClose"]}]}}} 
[1] "Response *************************************"
[1] "<HEAD><TITLE>Request on loopback from external IP</TITLE></HEAD>\n<BODY BGCOLOR=\"white\" FGCOLOR=\"black\"><H1>Request on loopback from external IP</H1><HR>\n<FONT FACE=\"Helvetica,Arial\"><B>\nDescription: Your request is prohibited because the request is on loopback from external IP.</B></FONT>\n<HR>\n<!-- default \"Request on loopback from external IP\" response (400) -->\n</BODY>\n                                                                                                                                                                                                                                                                                                   "
[1] "Response status *************************************"
[1] 400
Error in print.default("HTTP Error, code= ", response$status_code, sep = "") : 
  invalid 'digits' argument
Comment

People who like this

0 Show 1 · 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.

avatar image
Bob Dylan · Sep 05, 2019 at 12:54 PM 0
Share

There is a proxy in my firm. In order to install package from GitHub, for example, I use

file.edit('~/.Renviron')
http_proxy ='http://username:password@serveradress:8080'
https_proxy ='http://username:password@serveradress:8080'

to pass the firewall

avatar image
REFINITIV
Answer by Alex Putkov.1 · Sep 05, 2019 at 01:24 PM

Interesting... Eikonapir package sends HTTP POST to localhost:9000/api/v1/data. This response means the HTTP POST received by Eikon API Proxy came from an external IP address. In other words the IP address of where the request came from is different from the IP address of the machine where Eikon API Proxy is running. I'm wondering what could possibly be causing this behavior, given that Eikonapir library sends the request to the localhost. Are you running in some sort of virtualized environment? Is this Windows or Mac? These are rather wild shots, but I'm afraid I don't see a simple and straightforward explanation for the behavior you experience. Have you modified the source code of Eikonapir package to send the requests to an external machine? Can you try "ping localhost" command (in Terminal on Mac) or "ping -4 localhost" (in Command Prompt on Windows) to see if localhost alias is mapped to the loopback IPv4 address (127.0.0.1).

Comment
Bob Dylan

People who like this

1 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.

avatar image
Answer by Bob Dylan · Sep 06, 2019 at 04:43 AM

Hi @Alex Putkov thanks a lot for this answer, very informative. I 'm running eikon on windows and have not changed the source code.

I have virtualized applications but I don't think Eikon is virtualized it is rather a local installation.

this is the ping result :

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

could this external ip issue caused by having a corporate proxy?

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.

avatar image
Answer by Bob Dylan · Sep 06, 2019 at 05:30 AM

i tried

http://localhost:9000/ping?all

with following answer

{"port":9000,"mode":"eikon4","pid":4064,"hasSecure":true,"startedTime":"Thu Sep 05 2019 16:14:10 GMT+0200 (Romance Daylight Time)","subApps":[{"path":"/heap"},{"path":"/ping"},{"path":"/sxs","data":{"hasSecure":true,"sxsApps":{}}},{"path":"/api"}]}
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.

avatar image
Answer by Bob Dylan · Sep 09, 2019 at 04:23 AM

Thanks for @Alex Putkov 's detailed explaination and investigation. Commenting out Proxy , it works perfect.

here is the current workout thanks to @Alex Putkov:

Will comment out proxy setting in

file.edit('~/.Renviron')

e when using eikon and put back proxy setting each time when data retrieval is finished. A restart of Rstudio is required.

Probably there is a way to automate this process, but I 'm already extremely happy for the above. thanks

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.

avatar image
Answer by Bob Dylan · Nov 30, 2020 at 12:53 PM

hi @Alex Putkov.

I have encountered today again a problem with a different error. it works perfect until this week


[1] "Request *************************************"

{"Entity":{"E":["DataGrid"],"W":{"instruments":[["IBM"],["GOOG.O"],["MSFT.O"]],"fields":[{"name":["TR.PriceClose"]},{"name":["TR.Volume"]},{"name":["TR.PriceLow"]}]}}}

[1] "Response *************************************"

[1] "{\"code\":500,\"message\":\"connect ETIMEDOUT 159.220.1.19:443\",\"statusMessage\":\"Internal Server Error\"}"

[1] "Response status *************************************"

[1] 500


http://localhost:9000/ping?all gives me

{"port":9000,"mode":"eikon4","pid":8908,"hasSecure":true,"startedTime":"Mon Nov 30 2020 13:20:23 GMT+0100 (Romance Standard Time)","subApps":[{"path":"/heap"},{"path":"/ping"},{"path":"/sxs","data":{"hasSecure":true,"sxsApps":{}}},{"path":"/api"},{"path":"/sxs/v1/services/messenger"}]}


and I also tried "http://localhost:9000/api/v1/data" in my browser and it returns "Internal Server Error"

what could be the issue?

many thanks for your precious help

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.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Nov 30, 2020 at 04:43 PM

The error "{\"code\":500,\"message\":\"connect ETIMEDOUT 159.220.1.19:443\",\"statusMessage\":\"Internal Server Error\"}" indicates that the HTTP request sent to Eikon platform backend timed out. This could happen for any number of reasons. If the issue is intermittent and happens fairly rarely, the simple workaround is to resubmit the request when this specific error is encountered. It would be quite similar to typing a URL in an Internet browser to navigate to a Web page and not getting a response, then entering the URL again or refreshing the browser and getting the page displayed.
If the issue persists, then you need to report it to Refinitiv Helpdesk for investigation. Refinitiv Helpdesk can be reached by using Contact Us capability in your Eikon application or by visiting MyRefinitiv.

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

announcement: updated version of eikonapir R package

how to use eikonapi fetching Bond data in R?

R compatibility with eikon api

R package available for Eikon?

R eikonapir: returns data.frame with NA only

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • 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
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges