How to get the time-weighted average price of a given instrument over the last 30 minutes?

How to get the time-weighted average price of a given instrument over the last 30 minutes?

Hi. So far there is one endpoint calculating the weighted average price. But the user cannot specify the time frame. https://binance-docs.github.io/apidocs/spot/en/#current-average-price
A workaround is to collect the ticker data for 30 mins and calculate it. https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams