Efficiently querying multiple tickers in one query

In the function refinitiv.data.get_history I can query data for multiple RIC's at the same time, however, under the hood, there is a for loop that requests the data for each ticker separately, eating up 1 API call per RIC instead of per query in my API call limit (grabbing the last 1min bar for 100 futures RIC's eats up 100 api calls per minute).


In refinitiv.data.content._historical_data_provider.py, line 98 (refinitiv-data version 1.5.0):

def get_data(self, *args, **kwargs) -> Response:
universe: List[str] = kwargs.pop("universe", [])
entire_data_provider = get_entire_data_provider(kwargs.get("__content_type__"))

with ThreadPoolExecutor(thread_name_prefix="HistoricalRequestThread") as ex:
futures = []
        for inst_name in universe:
fut = ex.submit(
entire_data_provider.get_data,
partial(super().get_data, *args),
universe=inst_name,
**kwargs,
)
futures.append(fut)


Is there a way to avoid the loop in bold?


An alternative solution would be to stream the futures 1min bars, if implemented (see my other question here)

Best Answer

Answers