question

Upvotes
Accepted
22 1 3 7

Can you troubleshoot my Python API connection error 502?

This is my code (running it locally):

import pandas as pd
import numpy as np

import pandas as pd
import numpy as np
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
import refinitiv.dataplatform.eikon as ek

import requests

ek.set_app_key('key')

df, err = ek.get_data(['PEUP.PA','EUR=', 'JPY='], [ 'BID','ASK'])
df

This is the error massage:

error-massage.png


Thank you very much in advance!

python#productapipython api
error-massage.png (80.9 KiB)
icon clock
10 |1500

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

Hello @levente.letenyei

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS


Upvotes
Accepted
79.4k 253 52 74

@levente.letenyei

It should be from your proxy server.

1687341675172.png

When connecting to the localhost (127.0.0.1), it shouldn't use a proxy. You may need to contact your IT support team to verify the proxy settings.


1687341675172.png (107.1 KiB)
icon clock
10 |1500

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

@Jirapongse


Thank you very much for the help and guidance! I was able to solve it with the following lines of code:

import os
os.environ['NO_PROXY'] = 'localhost'
os.environ['NO_PROXY'] = '127.0.0.1'


Upvotes
14.3k 30 5 10

Hi @levente.letenyei ,

Please try to follow the article Eikon Data API and Refinitiv Data Library - Troubleshooting on each step to find out what may be the root cause.

icon clock
10 |1500

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

Hi @raksina.samasiri,

I have controlled all the instructions for troubleshooting."ST_PROXY_READY" looks good, but I still receive an error massage. Maybe some other approach for solution?


Thank you in advance

Upvotes
79.4k 253 52 74

@levente.letenyei

You can try to use the Eikon Data API Python package instead.

pip install eikon

The Eikon Data API Python provides useful logs.

import eikon as ek
ek.set_log_level(1)
ek.set_app_key('<APP KEY>')


icon clock
10 |1500

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

Hi @Jirapongse !

Thank you for your answer. Unfortunately I still receive an error massage.

error-massage-code.png

@levente.letenyei

Can you try to access http://127.0.0.1/api/status via a web browser?

1687340575999.png


1687340575999.png (17.8 KiB)

Hi @Jirapongse ,

same output as you!


std-proxy.png

std-proxy.png (9.0 KiB)

@levente.letenyei

Can you copy this HTML to a HTML file and then open it in a web browswer?

1687341165532.png

I would like to know what this page is.

1687341165532.png (153.3 KiB)
1687341471445.png (25.0 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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