How do I get the price of BTC at midnight using coinbase
I have been searching and have not found a good solution. I’m trying to get coinbase’s btc-usd price at midnight. The closest I have gotten successfully is calling by date but I cant get any closer than the day this way https://api.coinbase.com/v2/prices/BTC-USD/spot?date=2024-05-07
I have attached my best attempt but that gives me a different number every time it is called.