If you're in the UK, then Octopus Agile tariff gives you a variable price and an API with IFTTT integration so that you can switch devices on and off depending upon the current price: https://octopus.energy/agile/
That's really cool, for all the spam/ads I have seen about Octopus I've never seen this before, and this is the first time I'm interested. (Ordinarily I'm only interested in price, viewing it as a straightforward commodity, and Octopus has never been appealing on that ground.)