If you want a Node-RED solution try this (you will need to modify the URL used)
[{"id":"3f62582d090894ec","type":"debug","z":"24bde98641010730","name":"debug 11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":320,"wires":[]},{"id":"d049f0c637498499","type":"http request","z":"24bde98641010730","name":"Agile API Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.octopus.energy/v1/products/AGILE-FLEX-22-11-25/electricity-tariffs/E-1R-AGILE-FLEX-22-11-25-J/standard-unit-rates/","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":330,"y":260,"wires":[["96ddd52228ca5970"]]},{"id":"96ddd52228ca5970","type":"json","z":"24bde98641010730","name":"Convert to Objects","property":"payload","action":"","pretty":false,"x":530,"y":260,"wires":[["1bec2a814c3bb42b"]]},{"id":"2eb46e6b364e2529","type":"inject","z":"24bde98641010730","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":150,"y":260,"wires":[["d049f0c637498499"]]},{"id":"1bec2a814c3bb42b","type":"function","z":"24bde98641010730","name":"Get Current Price from Object","func":"const currentTime = new Date();\n\n// Find the most recent rate that's still valid\nlet currentRate = null;\nmsg.payload.results.forEach(rate => {\n const validTo = new Date(rate.valid_to);\n const validFrom = new Date(rate.valid_from);\n\n if (validFrom <= currentTime && validTo > currentTime) {\n currentRate = rate;\n return;\n }\n});\n\nlet output = \"\";\nif (currentRate) {\n output = currentRate.value_inc_vat.toString();\n} else {\n output = \"No current rate available.\";\n}\n// Set the modified payload\nmsg.payload = output;\n\n// Set Global Variable - use global.get(\"agile_current_price\") \nglobal.set(\"agile_current_price\", msg.payload);\n\n// Return the modified message\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":260,"wires":[["3f62582d090894ec"]]}]
Copy and import to Node-RED.