I poked about a bit on my provider. At 1st glance, it appears that they do use OAuth2 for login, and an API of sorts to retrieve green-button data. At least for my provider, the API itself seems to be a mess, but assuming the OAuth process can be navigated, I am able to retrieve the GreenButton data from the API using only a Bearer token.
Our provider seems to use
<subdomain>.opower.com to access account/usage info. I found this: https://github.com/bvlaicu/coned for ConEdison (not my provider) that also seems to use similar looking APIs at
opower.com, so it may also be possible to generalize fetching the data to some extent. However, looking over that project, they weren’t able to manage the login without selenium (or in their case pyppeteer).
As for the Authentication, I didn’t play with it too much yet, but it looks like it uses:
The summary is that login still seems to be the the challenging bit, and it is likely to be provider specific (even if your provider uses the opower.com api), meaning a general-purpose solution doesn’t look reasonable coming at it this way, but at least for my power company, I have hope I can do away with the screen-scraping stuff.
I don’t think providing GreenButton data means that providers necessarily have a standard API for access, though I’d love to be proven wrong.
I should also note that the API that my browser uses to download GreenButton data looks nothing like the API shown at http://greenbuttonalliance.github.io/. I did find this link though (Green Button - Connect My Data (CMD)) that shows that there is a ‘GreenButton Download My Data’ and ‘GreenButton Connect My Data’. The GB API seems to be for the latter, and my provider only provides the former. I’d be curious if other users with GreenButton access have ‘Download My Data’ or ‘Connect My Data’ access