python-eodhistoricaldata icon indicating copy to clipboard operation
python-eodhistoricaldata copied to clipboard

Is it possible to perform searches?

Open matheusft opened this issue 4 years ago • 5 comments

Is the Search API implemented here? https://eodhistoricaldata.com/api/search/{query_string}

Search API for Stocks, ETFs, Mutual Funds and Indices

matheusft avatar Jun 22 '21 16:06 matheusft

Yes, you are right, the Search API is implemented here.

deios0 avatar Jun 22 '21 16:06 deios0

I'm sorry, I did not find the function in the documentation nor in the code. Can you point me in the right direction or provide a code sample, please?

I would like to perform this: https://eodhistoricaldata.com/api/search/GB0008706128?api_token={API_TOKEN}

matheusft avatar Jun 22 '21 17:06 matheusft

Hello Matheus, this API endpoint had been developed recently and we did not update Python code for this API feed, we will do it soon, and as a quick workaround I can recommend using import JSON, basically, there is only two lines of the code:

import urllib.request, json 
with urllib.request.urlopen("https://eodhistoricaldata.com/api/search/GB0008706128?api_token={API_TOKEN}") as url:
data = json.loads(url.read().decode())
print(data)

deios0 avatar Jun 24 '21 16:06 deios0

Hi, thanks for answering. No problem. I am already doing that. I was just looking for a more concise way to do it.

matheusft avatar Jun 24 '21 16:06 matheusft

Thank you for the response, we also will publish the updated code for our new APIs.

deios0 avatar Jun 24 '21 17:06 deios0