How to query an API from HA

I want to be able to query an API to collect electricity pricing info. This is likely to include current price, forecast prices for the next few hours, etc.

There is a resource that has an API, but I am at a loss as to how to get the information from there into Home Assistant.
Basically, I dont know if it is a REST api, but even if it is, it seems to require an extra authentication step which the HA ‘REST’ platform doesn’t seem to support.

There are instructions here on how to use it. But it is mostly over my head.

https://developer.electricityinfo.co.nz/WITS/guides

Can someone please assist?

Maybe you can use this:

It looks like you need to request a token which then expires after 2 hours, that means the RESTful sensor isn’t going to be much use to you.

This looks like it would work as a custom component - see if anyone in the wider community has written one or at a minimum a Python script that accesses this info.

Thanks

That’s what I was worried about.

I will do some more research.

I have made a little bit of progress.

In the process of learning python, I have made something that can get an access token from the api, and then use this to query the api.

Is anyone here able and willing to give me some direction on getting this working with homeassistant in the simplest way possible?