Some areas in Europe do offer spot pricing (~hourly interval IIRC) for electricity, even for consumers. I don't have such a contract, so I'm not sure how good the pricing APIs are for autoscaling your consumption.
Several utilities in the states offer hourly rates. Most use human behavior inputs (sms messages) to drive the changes but others actually deliver the spot prices via smart meters.
A less smart version already exists. In the UK, some domestic energy is supplied at different costs at different times of day. This is optional and typically used for heating, but means that night time energy is cheap compared to daytime energy.