I’m building something using the octopus agile tarriff API and i hvae it so the code downloads a structure from the API with the price per kWh of electricity. However the energy costs are in a structure with fields and when i try to index the value_inc_vat column i only get the first result. How do i retrive the entire column?
<code>clc
current_date = string(datetime('today','Format','uuuu-MM-dd'))
yesterdays_date = string(datetime('yesterday','Format','uuuu-MM-dd'))
api_url = append('https://api.octopus.energy/v1/products/AGILE-24-04-03/electricity-tariffs/E-1R-AGILE-24-04-03-C/standard-unit-rates/?period_from=', yesterdays_date ,'T22:00Z&period_to=' , current_date ,'T23:59Z');
api_call = webread(api_url)
costs = api_call.results
value_inc_vat = api_call.results.value_inc_vat
</code>
<code>clc
current_date = string(datetime('today','Format','uuuu-MM-dd'))
yesterdays_date = string(datetime('yesterday','Format','uuuu-MM-dd'))
api_url = append('https://api.octopus.energy/v1/products/AGILE-24-04-03/electricity-tariffs/E-1R-AGILE-24-04-03-C/standard-unit-rates/?period_from=', yesterdays_date ,'T22:00Z&period_to=' , current_date ,'T23:59Z');
api_call = webread(api_url)
costs = api_call.results
value_inc_vat = api_call.results.value_inc_vat
</code>
clc
current_date = string(datetime('today','Format','uuuu-MM-dd'))
yesterdays_date = string(datetime('yesterday','Format','uuuu-MM-dd'))
api_url = append('https://api.octopus.energy/v1/products/AGILE-24-04-03/electricity-tariffs/E-1R-AGILE-24-04-03-C/standard-unit-rates/?period_from=', yesterdays_date ,'T22:00Z&period_to=' , current_date ,'T23:59Z');
api_call = webread(api_url)
costs = api_call.results
value_inc_vat = api_call.results.value_inc_vat