Skip to main content
Gary
Rank 1
Rank 1
March 9, 2017
Solved

Can we get access to the OVO energy online account API to download our smart meter usage data?

  • March 9, 2017
  • 227 replies
  • 36573 views

Hi Ovo,

I wondered whether the API that powers your live and historical usage page in the account menu is something you could look into opening up a bit so we can freely access our raw data and also perhaps it may stimulate some interesting community projects?

For instance (more sport related), Strava and Fitbit.

Best answer by g-de

Updated on 14/08/25 by Abby_OVO

 

Tim_OVO: “We love seeing the innovative ways our customers are using tech to help monitor and manage their energy usage. It’s inspiring us to think about ways to do energy differently. We know some customers have been using some of the application programming interface (APIs) behind our public facing services. While we’re OK with that, we do need to make you aware of a couple of things.

 

These APIs are designed to be used by OVO teams only, and aren't public facing. There are some downsides to using APIs that aren't for the public, and we wanted to let you know what these are. Behind the scenes, OVO uses APIs to share and update information between systems that power your bills and your online account. This is done in partnership with Kaluza, the tech company that’s part of the OVO family. They’ve built the billing platform designed to put our customers in the driving seat of their energy usage. 

 

These internal APIs are intended for use by Kaluza and its clients, who are energy retailers like OVO, rather than customers. Because of this, there’s no support for them being used anywhere else, which means they may be discontinued with no notice when we update our products and services. 

 

OVO Energy and Kaluza need to be able to monitor these APIs, and may block access if there's any problems in the future.

 

We know some customers may have put time and effort into developing solutions that use these API. So, now that you know the risks, we want to hear from you on how you’re using the APIs and the problems you’re solving with your DIY approach. 

 

Is there anything you’d like to see from OVO to help you monitor and manage your energy better? Leave a comment below to tell us.”

 

can you help me understand if the links above allow users to access raw data as if from an API?

I can certainly give it a go.

 

Firstly, big thanks to Timmo and other contributors for developing the library. All thanks go to them and links to buy them a coffee for their effort can be found on PyPi or GitHub:

https://pypi.org/project/ovoenergy/
https://github.com/timmo001/ovoenergy

 

I assume the way the library was developed this was to reverse engineer the My OVO website. That is, browse the website as normal and and monitor the traffic to see what OVO URLs and APIs it uses. Assuming this is the case, one of these URLs (get account IDs) already seems to be different but the library is still working for the moment. The APIs being used are not officially supported outside of the website, so first, a warning that any changes to the My OVO website may break the library.

 

For anyone using Python, you should be able to include the ovoenergy library and look at https://github.com/timmo001/ovoenergy/blob/master/ovoenergy/cli.py for how to use it.

 

For replicating this in other languages, the process seems to be as follows:

  1. Login by sending a POST request to https://my.ovoenergy.com/api/v2/auth/login with the following JSON in the body:
    {
    "username": "...",
    "password": "...",
    "rememberMe": true
    }

    From the response, save the cookies to use in all future requests.

  2. Next, send a GET request to https://smartpaym.ovoenergy.com/api/customer-and-account-ids . Be sure to save the items in the “accountIds” property (usually only one item).
  3. Finally, make a GET request to https://smartpaym.ovoenergy.com/api/energy-usage/daily/{accountId}?date={yyyy-MM} where {accountId} is the value from the previous request and {yyyy-MM} is the month in the format 2020-08.

You can also get monthly or half-hourly usage using the following URLs similar to step 3:

As mentioned above, if this is wanted for Home Assistant, the integration was added in version 0.114 (https://www.home-assistant.io/integrations/ovo_energy/).


Unfortunately the data only goes up to the end of the previous day as OVO no longer provide real-time data:

 

227 replies

Firedog
Super User
Super User
April 22, 2024

 

… release 1.0.2 ...
 

… working fine here. Thanks!

Noel | I have no official status; I'm just a volunteer who comes here to help other customers. My gear: Aclara SGM 1416-B Electricity-only E7 meter; Chameleon IHD3-PPMID-AAA | It may look as if I know what I’m talking about, but don’t let that fool you. |
knight
Newcomer
Newcomer
April 23, 2024

It's a WPF application written in C# so I am pretty sure it won't be an easy port to node.js, also I don't know node.js

The full source code is on GitHub, so you can go "fill your boots" there …

It also directly accesses the file system, which is prohibited in all browsers.

I’ll have a look, thanks.

File system access is not an issue for Node.js and can be worked around even for a browser.


Update: Took me about 25 minutes with Node-RED to get a successful login, most of which was decoding your C# code (which I don’t write!). This is the login flow: 

Node-RED Ovo API Login Flow

Should easily now be able to get the rest of the data, I can already see that I can get my monthly data even though I don’t have a Smart Meter.

Nice work Ovo, easy enough to use the API. Excellent work Mike.

Julian Knight, IT Architect, Node-RED contributor
knight
Newcomer
Newcomer
April 23, 2024

Update 2: I split the flow in 2 - the main reason is that I don’t have to keep logging in and querying the account data when testing. I have made the last part of the flow a JavaScript function node that will let me better reformat the data into something easier to show.

 

So next step is to finish that formatting and then produce a web page to show the data.

This is, of course, fully cross-platform and you can run it on anything from a Raspberry Pi to Azure or AWS and everything in between whether desktop or server.

Once I’ve got it to a better place, I will be posting to the Node-RED forum. I will add a link to that here.

Julian Knight, IT Architect, Node-RED contributor
knight
Newcomer
Newcomer
April 23, 2024

Here is the link to the post in the Node-RED forum which also contains the flow for anyone to use.

https://discourse.nodered.org/t/ovo-energy-api-get-your-energy-data-from-ovo/87440

Julian Knight, IT Architect, Node-RED contributor
Newcomer
July 24, 2024

I’ve been blocked by Cloudflare using the official home assistant plugin. Let me be clear, this integration is the sole reason I’m still with OVO. Either this gets fixed or I go elsewhere

Bradley_OVO
Community Manager
Community Leader
July 25, 2024

It’s a shame to hear you feel that way @pauldsmyth - It’d be a shame to lose you as an OVO customer due to something like this. 

 

I wonder if @Blastoise186 @Firedog and co may be able to offer any support or suggestions, using their vast and technical knowledge. Like Tim, my personal knowledge on this subject is basic.

 

I’ve just been catching up via this thread and can only redirect you again to the Best Answer by @Tim_OVO that explains the limitations and issues around how API is currently used by OVO and its sister companies. Support will be minimal as we don’t promote this particular process/service.

I'm not lazy, I'm just in energy saving mode!
Blastoise186
Super User
Super User
July 25, 2024

Tracing indicates the Issue exists in the Home Assistant integration ovoenergy. As this is community developed, https://github.com/timmo001/ovoenergy is the place to ask for help.

Please go there to see if this can be fixed - OVO can’t touch that particular code.

Full response can be found at the thread below:

 

Securing energy by zapping security bugs... For that is The Blastoise Way! Remember, I'm just like you - AI Powered Evil Geniuses aren't Staff!
Newcomer
July 25, 2024

I've already commented on the GitHub issue related to this and await a response but the GitHub repo has no control over the OVOs Cloudflare account which provides no methodology to get unblocked. 

The reason that the HA extension isn't working is because of Cloudflare blocking IPs. Work is required at both ends. The extension needs to reduce it's polling frequency but your Cloudflare distribution needs to be configured to recognise these API requests and provide a methodology to get unblocked 

Blastoise186
Super User
Super User
July 25, 2024

As I mentioned previously, there is no possible way for Cloudflare to tell the difference between attack traffic that’s flooding a customers systems, and a legitimate tool that’s merely encountered a bug and gotten stuck in a loop while trying to authenticate.

I’m a trained computer hacker so I should know this stuff. Specifically, I’m a qualified Penetration Tester, or PenTester for short - otherwise known as a White Hat. You are quite safe though - unlike Black Hats, I never touch stuff without permission of the owner. As such, I’m expected to know how things like Cloudflare work.

You will get automatically unbanned eventually - but only once you stop your HA instance sending traffic to OVO until the broken HA Integration gets fixed. I already reduced the polling rate to 3600 seconds = 1 hour across ALL Home Assistant instances using the ovoenergy integration and Timmo knows that I did so - and why. This is far more compliant with OVO’s rules than the 300 seconds = 5 minutes it was on previously. The broken code however, lies somewhere my own code contribution does not control.

Turning the shield into a cheese grater only benefits Black Hats - and I 100% promise you that you really don’t want those guys getting anywhere near OVO’s systems. But that’s what you’re asking OVO to do. Having it be all or nothing is a necessary evil - you’ll just have to accept that. It has to be set to either block EVERYTHING that breaches the rate limits, or block NOTHING that breaches the rate limits - after all that’s what Anti-DDoS is for and it’s kinda the entire point of Cloudflare’s existence in the first place.

By providing a way to programmatically get unbanned and making that endpoint publicly accessible with zero limits, you’re just asking for trouble as hackers could just constantly unban themselves so you may as well just give them the keys to the kingdom upfront and let them do whatever they want.

Timmo needs to fix his code to slow down the authentication and make it abandon further attempts if it’s the wrong login info - OVO cannot help with that.

Securing energy by zapping security bugs... For that is The Blastoise Way! Remember, I'm just like you - AI Powered Evil Geniuses aren't Staff!
Newcomer
July 25, 2024

Yes, I know all of this because I’m  Senior DevOps Engineer who manages microservice architecture including CloudFlare. I’ve already acknowledged that the extension owner needs to make changes to the plugin to reduce polling frequency to prevent it looking like an attack. 

“By providing a way to programmatically get unbanned and making that endpoint publicly accessible with zero limits, you’re just asking for trouble as hackers could just constantly unban themselves so you may as well just give them the keys to the kingdom upfront and let them do whatever they want.”

Where did I ask for this? I’ve already agreed with the principle of protecting the API. The Cloudflare page itself recommends emailing the website owner. If I go and hack the plugin myself I need to be able to test it. I’m still banned 24 hours after disabling the plugin, which is what I did IMMEDIATELY I saw that that was the cause of the failure. 

As for the timing, 3600 seconds is more than adequate for this purpose. 

I appreciate your response though.