You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to request only a part of the response dict?
With requests I can write requests.get(f'https://eodhistoricaldata.com/api/fundamentals/{ticker}.us?api_token={eod_api}&filter={eod_filter}') with eod_filter = 'General::Code,Name,Description' to get only a part of the response.
It would be nice to have this possibility with client.get_search_instrument() too.
The text was updated successfully, but these errors were encountered:
As far as I understand, do you want to filter the response fields of get_search_instrument by explicitly declaring the parameters? Like the get_fundamental_equity method (can you confirm if that is correct?)
If my understanding of your question is correct, I'm afraid it is not possible to include the filter. The documentation says that this method (and consequently the URL) only allows the following parameters: query_string, limit, bonds_only, exchange, type (This one is redundant with bonds_only, I do not recommend type). This characteristic is by default, and I can't do anything.
Despite that, If you still want to filter by some desired fields, the following code may help you:
import os
# load the key from the environment variables
from eod import EodHistoricalData
# import the key from the environment variables
api_key_eod = os.environ['API_EOD']
# Create the instance. You can always write directly the API key, but that's not secure.
client = EodHistoricalData(api_key_eod)
# I'm going to assume that you want companies related to blockchain
import pandas as pd
print( pd.DataFrame(client.get_search_instrument(query_string='blockchain'))[['Code', 'Name']] )
If the EOD API implements this optionality in the future, I will certainly include it in the get_search_instrument method.
Is it possible to request only a part of the response dict?
With requests I can write
requests.get(f'https://eodhistoricaldata.com/api/fundamentals/{ticker}.us?api_token={eod_api}&filter={eod_filter}')
witheod_filter = 'General::Code,Name,Description'
to get only a part of the response.It would be nice to have this possibility with
client.get_search_instrument()
too.The text was updated successfully, but these errors were encountered: