Decoding json files

Hi,
i'm trying to decode some information from an Octopus energy API. Board is
WEMOS D1.
this one

I can get the data back , but cannot decode the json file. This is all a new area to me !!

I'm using Arduinojson , and the on line assistant to porduce the code and the document size ( which it gives as 256).

My full code is attached and also the output ( Ive taken the IP and connection data out) is below. I've tried increasing the doc size ( to 512) but I still get the no memory error:
Any ideas ?

WiFi connected
IP address: 
XXXXXXXXXXXXXXXXXXX
reply was:
==========
{"count":51,"next":null,"previous":null,"results":[{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-02T01:00:00Z","valid_to":"2023-07-02T01:30:00Z","payment_method":null},{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-02T00:30:00Z","valid_to":"2023-07-02T01:00:00Z","payment_method":null},{"value_exc_vat":0.6,"value_inc_vat":0.63,"valid_from":"2023-07-02T00:00:00Z","valid_to":"2023-07-02T00:30:00Z","payment_method":null},{"value_exc_vat":-1.2,"value_inc_vat":-1.26,"valid_from":"2023-07-01T23:30:00Z","valid_to":"2023-07-02T00:00:00Z","payment_method":null},{"value_exc_vat":0.94,"value_inc_vat":0.987,"valid_from":"2023-07-01T23:00:00Z","valid_to":"2023-07-01T23:30:00Z","payment_method":null},{"value_exc_vat":-2.0,"value_inc_vat":-2.1,"valid_from":"2023-07-01T22:30:00Z","valid_to":"2023-07-01T23:00:00Z","payment_method":null},{"value_exc_vat":8.98,"value_inc_vat":9.429,"valid_from":"2023-07-01T22:00:00Z","valid_to":"2023-07-01T22:30:00Z","payment_method":null},{"value_exc_vat":13.26,"value_inc_vat":13.923,"valid_from":"2023-07-01T21:30:00Z","valid_to":"2023-07-01T22:00:00Z","payment_method":null},{"value_exc_vat":19.2,"value_inc_vat":20.16,"valid_from":"2023-07-01T21:00:00Z","valid_to":"2023-07-01T21:30:00Z","payment_method":null},{"value_exc_vat":15.68,"value_inc_vat":16.464,"valid_from":"2023-07-01T20:30:00Z","valid_to":"2023-07-01T21:00:00Z","payment_method":null},{"value_exc_vat":16.0,"value_inc_vat":16.8,"valid_from":"2023-07-01T20:00:00Z","valid_to":"2023-07-01T20:30:00Z","payment_method":null},{"value_exc_vat":15.52,"value_inc_vat":16.296,"valid_from":"2023-07-01T19:30:00Z","valid_to":"2023-07-01T20:00:00Z","payment_method":null},{"value_exc_vat":17.18,"value_inc_vat":18.039,"valid_from":"2023-07-01T19:00:00Z","valid_to":"2023-07-01T19:30:00Z","payment_method":null},{"value_exc_vat":15.3,"value_inc_vat":16.065,"valid_from":"2023-07-01T18:30:00Z","valid_to":"2023-07-01T19:00:00Z","payment_method":null},{"value_exc_vat":15.3,"value_inc_vat":16.065,"valid_from":"2023-07-01T18:00:00Z","valid_to":"2023-07-01T18:30:00Z","payment_method":null},{"value_exc_vat":25.8,"value_inc_vat":27.09,"valid_from":"2023-07-01T17:30:00Z","valid_to":"2023-07-01T18:00:00Z","payment_method":null},{"value_exc_vat":22.88,"value_inc_vat":24.024,"valid_from":"2023-07-01T17:00:00Z","valid_to":"2023-07-01T17:30:00Z","payment_method":null},{"value_exc_vat":21.56,"value_inc_vat":22.638,"valid_from":"2023-07-01T16:30:00Z","valid_to":"2023-07-01T17:00:00Z","payment_method":null},{"value_exc_vat":16.56,"value_inc_vat":17.388,"valid_from":"2023-07-01T16:00:00Z","valid_to":"2023-07-01T16:30:00Z","payment_method":null},{"value_exc_vat":15.8,"value_inc_vat":16.59,"valid_from":"2023-07-01T15:30:00Z","valid_to":"2023-07-01T16:00:00Z","payment_method":null},{"value_exc_vat":11.0,"value_inc_vat":11.55,"valid_from":"2023-07-01T15:00:00Z","valid_to":"2023-07-01T15:30:00Z","payment_method":null},{"value_exc_vat":0.5,"value_inc_vat":0.525,"valid_from":"2023-07-01T14:30:00Z","valid_to":"2023-07-01T15:00:00Z","payment_method":null},{"value_exc_vat":0.0,"value_inc_vat":0.0,"valid_from":"2023-07-01T14:00:00Z","valid_to":"2023-07-01T14:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T13:30:00Z","valid_to":"2023-07-01T14:00:00Z","payment_method":null},{"value_exc_vat":-0.32,"value_inc_vat":-0.336,"valid_from":"2023-07-01T13:00:00Z","valid_to":"2023-07-01T13:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T12:30:00Z","valid_to":"2023-07-01T13:00:00Z","payment_method":null},{"value_exc_vat":0.2,"value_inc_vat":0.21,"valid_from":"2023-07-01T12:00:00Z","valid_to":"2023-07-01T12:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T11:30:00Z","valid_to":"2023-07-01T12:00:00Z","payment_method":null},{"value_exc_vat":0.8,"value_inc_vat":0.84,"valid_from":"2023-07-01T11:00:00Z","valid_to":"2023-07-01T11:30:00Z","payment_method":null},{"value_exc_vat":-0.44,"value_inc_vat":-0.462,"valid_from":"2023-07-01T10:30:00Z","valid_to":"2023-07-01T11:00:00Z","payment_method":null},{"value_exc_vat":0.12,"value_inc_vat":0.126,"valid_from":"2023-07-01T10:00:00Z","valid_to":"2023-07-01T10:30:00Z","payment_method":null},{"value_exc_vat":-0.06,"value_inc_vat":-0.063,"valid_from":"2023-07-01T09:30:00Z","valid_to":"2023-07-01T10:00:00Z","payment_method":null},{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-01T09:00:00Z","valid_to":"2023-07-01T09:30:00Z","payment_method":null},{"value_exc_vat":6.4,"value_inc_vat":6.72,"valid_from":"2023-07-01T08:30:00Z","valid_to":"2023-07-01T09:00:00Z","payment_method":null},{"value_exc_vat":7.48,"value_inc_vat":7.854,"valid_from":"2023-07-01T08:00:00Z","valid_to":"2023-07-01T08:30:00Z","payment_method":null},{"value_exc_vat":10.44,"value_inc_vat":10.962,"valid_from":"2023-07-01T07:30:00Z","valid_to":"2023-07-01T08:00:00Z","payment_method":null},{"value_exc_vat":7.86,"value_inc_vat":8.253,"valid_from":"2023-07-01T07:00:00Z","valid_to":"2023-07-01T07:30:00Z","payment_method":null},{"value_exc_vat":11.56,"value_inc_vat":12.138,"valid_from":"2023-07-01T06:30:00Z","valid_to":"2023-07-01T07:00:00Z","payment_method":null},{"value_exc_vat":7.59,"value_inc_vat":7.9695,"valid_from":"2023-07-01T06:00:00Z","valid_to":"2023-07-01T06:30:00Z","payment_method":null},{"value_exc_vat":8.96,"value_inc_vat":9.408,"valid_from":"2023-07-01T05:30:00Z","valid_to":"2023-07-01T06:00:00Z","payment_method":null},{"value_exc_vat":2.4,"value_inc_vat":2.52,"valid_from":"2023-07-01T05:00:00Z","valid_to":"2023-07-01T05:30:00Z","payment_method":null},{"value_exc_vat":7.6,"value_inc_vat":7.98,"valid_from":"2023-07-01T04:30:00Z","valid_to":"2023-07-01T05:00:00Z","payment_method":null},{"value_exc_vat":6.0,"value_inc_vat":6.3,"valid_from":"2023-07-01T04:00:00Z","valid_to":"2023-07-01T04:30:00Z","payment_method":null},{"value_exc_vat":1.84,"value_inc_vat":1.932,"valid_from":"2023-07-01T03:30:00Z","valid_to":"2023-07-01T04:00:00Z","payment_method":null},{"value_exc_vat":4.56,"value_inc_vat":4.788,"valid_from":"2023-07-01T03:00:00Z","valid_to":"2023-07-01T03:30:00Z","payment_method":null},{"value_exc_vat":3.66,"value_inc_vat":3.843,"valid_from":"2023-07-01T02:30:00Z","valid_to":"2023-07-01T03:00:00Z","payment_method":null},{"value_exc_vat":5.0,"value_inc_vat":5.25,"valid_from":"2023-07-01T02:00:00Z","valid_to":"2023-07-01T02:30:00Z","payment_method":null},{"value_exc_vat":3.61,"value_inc_vat":3.7905,"valid_from":"2023-07-01T01:30:00Z","valid_to":"2023-07-01T02:00:00Z","payment_method":null},{"value_exc_vat":5.6,"value_inc_vat":5.88,"valid_from":"2023-07-01T01:00:00Z","valid_to":"2023-07-01T01:30:00Z","payment_method":null},{"value_exc_vat":9.0,"value_inc_vat":9.45,"valid_from":"2023-07-01T00:30:00Z","valid_to":"2023-07-01T01:00:00Z","payment_method":null},{"value_exc_vat":13.5,"value_inc_vat":14.175,"valid_from":"2023-07-01T00:00:00Z","valid_to":"2023-07-01T00:30:00Z","payment_method":null}]}
==========
closing connection
deserializeJson() failed: NoMemory

//HTTP_GET you tube download .
// this was tested and works 7/7/23 now trying to make sense of json message.

// using  board :LOLIN(WeMos)D1 R1 with Wemos D1 board.


/*******************************************************************
    A sample project for making a HTTP/HTTPS GET request on an ESP8266

    It will connect to the given request and print the body to
    serial monitor

    Parts:
    D1 Mini ESP8266 * - http://s.click.aliexpress.com/e/uzFUnIe

 *  * = Affilate

    If you find what I do usefuland would like to support me,
    please consider becoming a sponsor on Github
    https://github.com/sponsors/witnessmenow/


   Some  Written by Brian Lough
    YouTube: https://www.youtube.com/brianlough
    Tindie: https://www.tindie.com/stores/brianlough/
    Twitter: https://twitter.com/witnessmenow
 *******************************************************************/

// ----------------------------
// Standard Libraries
// ----------------------------

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

#include <strings.h>
#include <ArduinoJson.h>


char ssid[] = "XXXXXXXXXXXXX";         // network SSID (name)
char password[] = "XXXXXXXXXXXX"; // network key

//For  HTTPS requests
WiFiClientSecure client;

// Just the base of the URL you want to connect to
#define TEST_HOST "api.octopus.energy"

// OPTIONAL - The finferprint of the site you want to connect to.
#define TEST_HOST_FINGERPRINT "4F 01 5C 5F CC E5 31 35 83 91 D4 69 90 9A 52 97 00 FE 45 69"
// The finger print will change every few months.

void setup()
{

  Serial.begin(115200);

  // Connect to the WiFI
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
  Serial.println(F("GO!"));
  // Attempt to connect to Wifi network:
  Serial.print(F("Connecting Wifi: "));
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println(F("WiFi connected"));
  Serial.println(F("IP address: "));
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);

  //--------
 check the fingerprint
  client.setFingerprint(TEST_HOST_FINGERPRINT);

  makeHTTPRequest();
}

void makeHTTPRequest()
{

  // Opening connection to server (Using 443 as port HTTPS)
  if (!client.connect(TEST_HOST, 443))
  {
    Serial.println(F("Connection failed"));
    return;
  }

  // give the esp a breather
  yield();

  // Send HTTP request
  client.print(F("GET "));
  // This is the second half of a request (everything that comes after the base URL)
  //client.print(F(" https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-C/standard-unit-rates/?period_from=2023-07-01T00:00Z&period_to=2023-07-02T01:29Z&order_by=period")); // %2C == ,
  client.print(F(" https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-C/standard-unit-rates/?period_from=2023-07-01T00:00Z&period_to=2023-07-02T01:29Z"));
  // HTTP 1.0 is ideal as the response wont be chunked
  // But some API will return 1.1 regardless, so we need
  // to handle both.
  client.println(F(" HTTP/1.0"));

  //Headers
  client.print(F("Host: "));
  client.println(TEST_HOST);

  client.println(F("Cache-Control: no-cache"));

  if (client.println() == 0)
  {
    Serial.println(F("Failed to send request"));
    return;
  }
 
  // Skip HTTP headers
  char endOfHeaders[] = "\r\n\r\n";
  if (!client.find(endOfHeaders))
  {
    Serial.println(F("Invalid response"));
    return;
  }

 
  // While the client is still available read each
  // byte and print to the serial monitor
 Serial.println(F("reply was:"));
  Serial.println(F("=========="));
  String line;
  while (client.available())
    //**********************
  {
    line = client.readStringUntil('\n');  //Read Line by Line
    Serial.println(line); //Print response
  }

  Serial.println(F("=========="));
 Serial.println(F("closing connection"));

// Stream& input;    

StaticJsonDocument<256> doc;

DeserializationError error = deserializeJson(doc, line);

if (error) {
  Serial.print(F("deserializeJson() failed: "));
  Serial.println(error.f_str());
  return;
}

for (JsonObject item : doc.as<JsonArray>()) {

  float value_exc_vat = item["value_exc_vat"]; // 5, 6.2
  float value_inc_vat = item["value_inc_vat"]; // 5.25, 6.51
  const char* valid_from = item["valid_from"]; // "2020-05-06T21:30:00Z", "2020-05-06T21:00:00Z"
  const char* valid_to = item["valid_to"]; // "2020-05-06T22:00:00Z", "2020-05-06T21:30:00Z"

}



}

void loop()
{
 
}

your answer does not fit in one line. What you see in the console is the result of multiple iteration of

  while (client.available())
  {
    line = client.readStringUntil('\n');  //Read Line by Line
    Serial.println(line); //Print response
  }

so you don't have in line a global buffer holding the full JSON that would then be suitable for deserialization (it's big !), You have just the last line

{"count":51,"next":null,"previous":null,"results":[{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-02T01:00:00Z","valid_to":"2023-07-02T01:30:00Z","payment_method":null},{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-02T00:30:00Z","valid_to":"2023-07-02T01:00:00Z","payment_method":null},{"value_exc_vat":0.6,"value_inc_vat":0.63,"valid_from":"2023-07-02T00:00:00Z","valid_to":"2023-07-02T00:30:00Z","payment_method":null},{"value_exc_vat":-1.2,"value_inc_vat":-1.26,"valid_from":"2023-07-01T23:30:00Z","valid_to":"2023-07-02T00:00:00Z","payment_method":null},{"value_exc_vat":0.94,"value_inc_vat":0.987,"valid_from":"2023-07-01T23:00:00Z","valid_to":"2023-07-01T23:30:00Z","payment_method":null},{"value_exc_vat":-2.0,"value_inc_vat":-2.1,"valid_from":"2023-07-01T22:30:00Z","valid_to":"2023-07-01T23:00:00Z","payment_method":null},{"value_exc_vat":8.98,"value_inc_vat":9.429,"valid_from":"2023-07-01T22:00:00Z","valid_to":"2023-07-01T22:30:00Z","payment_method":null},{"value_exc_vat":13.26,"value_inc_vat":13.923,"valid_from":"2023-07-01T21:30:00Z","valid_to":"2023-07-01T22:00:00Z","payment_method":null},{"value_exc_vat":19.2,"value_inc_vat":20.16,"valid_from":"2023-07-01T21:00:00Z","valid_to":"2023-07-01T21:30:00Z","payment_method":null},{"value_exc_vat":15.68,"value_inc_vat":16.464,"valid_from":"2023-07-01T20:30:00Z","valid_to":"2023-07-01T21:00:00Z","payment_method":null},{"value_exc_vat":16.0,"value_inc_vat":16.8,"valid_from":"2023-07-01T20:00:00Z","valid_to":"2023-07-01T20:30:00Z","payment_method":null},{"value_exc_vat":15.52,"value_inc_vat":16.296,"valid_from":"2023-07-01T19:30:00Z","valid_to":"2023-07-01T20:00:00Z","payment_method":null},{"value_exc_vat":17.18,"value_inc_vat":18.039,"valid_from":"2023-07-01T19:00:00Z","valid_to":"2023-07-01T19:30:00Z","payment_method":null},{"value_exc_vat":15.3,"value_inc_vat":16.065,"valid_from":"2023-07-01T18:30:00Z","valid_to":"2023-07-01T19:00:00Z","payment_method":null},{"value_exc_vat":15.3,"value_inc_vat":16.065,"valid_from":"2023-07-01T18:00:00Z","valid_to":"2023-07-01T18:30:00Z","payment_method":null},{"value_exc_vat":25.8,"value_inc_vat":27.09,"valid_from":"2023-07-01T17:30:00Z","valid_to":"2023-07-01T18:00:00Z","payment_method":null},{"value_exc_vat":22.88,"value_inc_vat":24.024,"valid_from":"2023-07-01T17:00:00Z","valid_to":"2023-07-01T17:30:00Z","payment_method":null},{"value_exc_vat":21.56,"value_inc_vat":22.638,"valid_from":"2023-07-01T16:30:00Z","valid_to":"2023-07-01T17:00:00Z","payment_method":null},{"value_exc_vat":16.56,"value_inc_vat":17.388,"valid_from":"2023-07-01T16:00:00Z","valid_to":"2023-07-01T16:30:00Z","payment_method":null},{"value_exc_vat":15.8,"value_inc_vat":16.59,"valid_from":"2023-07-01T15:30:00Z","valid_to":"2023-07-01T16:00:00Z","payment_method":null},{"value_exc_vat":11.0,"value_inc_vat":11.55,"valid_from":"2023-07-01T15:00:00Z","valid_to":"2023-07-01T15:30:00Z","payment_method":null},{"value_exc_vat":0.5,"value_inc_vat":0.525,"valid_from":"2023-07-01T14:30:00Z","valid_to":"2023-07-01T15:00:00Z","payment_method":null},{"value_exc_vat":0.0,"value_inc_vat":0.0,"valid_from":"2023-07-01T14:00:00Z","valid_to":"2023-07-01T14:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T13:30:00Z","valid_to":"2023-07-01T14:00:00Z","payment_method":null},{"value_exc_vat":-0.32,"value_inc_vat":-0.336,"valid_from":"2023-07-01T13:00:00Z","valid_to":"2023-07-01T13:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T12:30:00Z","valid_to":"2023-07-01T13:00:00Z","payment_method":null},{"value_exc_vat":0.2,"value_inc_vat":0.21,"valid_from":"2023-07-01T12:00:00Z","valid_to":"2023-07-01T12:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T11:30:00Z","valid_to":"2023-07-01T12:00:00Z","payment_method":null},{"value_exc_vat":0.8,"value_inc_vat":0.84,"valid_from":"2023-07-01T11:00:00Z","valid_to":"2023-07-01T11:30:00Z","payment_method":null},{"value_exc_vat":-0.44,"value_inc_vat":-0.462,"valid_from":"2023-07-01T10:30:00Z","valid_to":"2023-07-01T11:00:00Z","payment_method":null},{"value_exc_vat":0.12,"value_inc_vat":0.126,"valid_from":"2023-07-01T10:00:00Z","valid_to":"2023-07-01T10:30:00Z","payment_method":null},{"value_exc_vat":-0.06,"value_inc_vat":-0.063,"valid_from":"2023-07-01T09:30:00Z","valid_to":"2023-07-01T10:00:00Z","payment_method":null},{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-01T09:00:00Z","valid_to":"2023-07-01T09:30:00Z","payment_method":null},{"value_exc_vat":6.4,"value_inc_vat":6.72,"valid_from":"2023-07-01T08:30:00Z","valid_to":"2023-07-01T09:00:00Z","payment_method":null},{"value_exc_vat":7.48,"value_inc_vat":7.854,"valid_from":"2023-07-01T08:00:00Z","valid_to":"2023-07-01T08:30:00Z","payment_method":null},{"value_exc_vat":10.44,"value_inc_vat":10.962,"valid_from":"2023-07-01T07:30:00Z","valid_to":"2023-07-01T08:00:00Z","payment_method":null},{"value_exc_vat":7.86,"value_inc_vat":8.253,"valid_from":"2023-07-01T07:00:00Z","valid_to":"2023-07-01T07:30:00Z","payment_method":null},{"value_exc_vat":11.56,"value_inc_vat":12.138,"valid_from":"2023-07-01T06:30:00Z","valid_to":"2023-07-01T07:00:00Z","payment_method":null},{"value_exc_vat":7.59,"value_inc_vat":7.9695,"valid_from":"2023-07-01T06:00:00Z","valid_to":"2023-07-01T06:30:00Z","payment_method":null},{"value_exc_vat":8.96,"value_inc_vat":9.408,"valid_from":"2023-07-01T05:30:00Z","valid_to":"2023-07-01T06:00:00Z","payment_method":null},{"value_exc_vat":2.4,"value_inc_vat":2.52,"valid_from":"2023-07-01T05:00:00Z","valid_to":"2023-07-01T05:30:00Z","payment_method":null},{"value_exc_vat":7.6,"value_inc_vat":7.98,"valid_from":"2023-07-01T04:30:00Z","valid_to":"2023-07-01T05:00:00Z","payment_method":null},{"value_exc_vat":6.0,"value_inc_vat":6.3,"valid_from":"2023-07-01T04:00:00Z","valid_to":"2023-07-01T04:30:00Z","payment_method":null},{"value_exc_vat":1.84,"value_inc_vat":1.932,"valid_from":"2023-07-01T03:30:00Z","valid_to":"2023-07-01T04:00:00Z","payment_method":null},{"value_exc_vat":4.56,"value_inc_vat":4.788,"valid_from":"2023-07-01T03:00:00Z","valid_to":"2023-07-01T03:30:00Z","payment_method":null},{"value_exc_vat":3.66,"value_inc_vat":3.843,"valid_from":"2023-07-01T02:30:00Z","valid_to":"2023-07-01T03:00:00Z","payment_method":null},{"value_exc_vat":5.0,"value_inc_vat":5.25,"valid_from":"2023-07-01T02:00:00Z","valid_to":"2023-07-01T02:30:00Z","payment_method":null},{"value_exc_vat":3.61,"value_inc_vat":3.7905,"valid_from":"2023-07-01T01:30:00Z","valid_to":"2023-07-01T02:00:00Z","payment_method":null},{"value_exc_vat":5.6,"value_inc_vat":5.88,"valid_from":"2023-07-01T01:00:00Z","valid_to":"2023-07-01T01:30:00Z","payment_method":null},{"value_exc_vat":9.0,"value_inc_vat":9.45,"valid_from":"2023-07-01T00:30:00Z","valid_to":"2023-07-01T01:00:00Z","payment_method":null},{"value_exc_vat":13.5,"value_inc_vat":14.175,"valid_from":"2023-07-01T00:00:00Z","valid_to":"2023-07-01T00:30:00Z","payment_method":null}]}

If you don't need all this data you might want to explore filters so that you don't have to store all the data before deserializing

try with

//HTTP_GET you tube download .
// this was tested and works 7/7/23 now trying to make sense of json message.

// using  board :LOLIN(WeMos)D1 R1 with Wemos D1 board.


/*******************************************************************
    A sample project for making a HTTP/HTTPS GET request on an ESP8266

    It will connect to the given request and print the body to
    serial monitor

    Parts:
    D1 Mini ESP8266 * - http://s.click.aliexpress.com/e/uzFUnIe

 *  * = Affilate

    If you find what I do usefuland would like to support me,
    please consider becoming a sponsor on Github
    https://github.com/sponsors/witnessmenow/


   Some  Written by Brian Lough
    YouTube: https://www.youtube.com/brianlough
    Tindie: https://www.tindie.com/stores/brianlough/
    Twitter: https://twitter.com/witnessmenow
 *******************************************************************/

// ----------------------------
// Standard Libraries
// ----------------------------

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

#include <strings.h>
#include <ArduinoJson.h>


char ssid[] = "XXXXXXXXXXXXX";         // network SSID (name)
char password[] = "XXXXXXXXXXXX"; // network key

//For  HTTPS requests
WiFiClientSecure client;

// Just the base of the URL you want to connect to
#define TEST_HOST "api.octopus.energy"

// OPTIONAL - The finferprint of the site you want to connect to.
#define TEST_HOST_FINGERPRINT "4F 01 5C 5F CC E5 31 35 83 91 D4 69 90 9A 52 97 00 FE 45 69"
// The finger print will change every few months.

void setup()
{

  Serial.begin(115200);

  // Connect to the WiFI
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
  Serial.println(F("GO!"));
  // Attempt to connect to Wifi network:
  Serial.print(F("Connecting Wifi: "));
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println(F("WiFi connected"));
  Serial.println(F("IP address: "));
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);

  //--------
  check the fingerprint
  client.setFingerprint(TEST_HOST_FINGERPRINT);

  makeHTTPRequest();
}

void makeHTTPRequest()
{

  // Opening connection to server (Using 443 as port HTTPS)
  if (!client.connect(TEST_HOST, 443))
  {
    Serial.println(F("Connection failed"));
    return;
  }

  // give the esp a breather
  yield();

  // Send HTTP request
  client.print(F("GET "));
  // This is the second half of a request (everything that comes after the base URL)
  //client.print(F(" https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-C/standard-unit-rates/?period_from=2023-07-01T00:00Z&period_to=2023-07-02T01:29Z&order_by=period")); // %2C == ,
  client.print(F(" https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-C/standard-unit-rates/?period_from=2023-07-01T00:00Z&period_to=2023-07-02T01:29Z"));
  // HTTP 1.0 is ideal as the response wont be chunked
  // But some API will return 1.1 regardless, so we need
  // to handle both.
  client.println(F(" HTTP/1.0"));

  //Headers
  client.print(F("Host: "));
  client.println(TEST_HOST);

  client.println(F("Cache-Control: no-cache"));

  if (client.println() == 0)
  {
    Serial.println(F("Failed to send request"));
    return;
  }

  // Skip HTTP headers
  char endOfHeaders[] = "\r\n\r\n";
  if (!client.find(endOfHeaders))
  {
    Serial.println(F("Invalid response"));
    return;
  }


  // While the client is still available read each
  // byte and print to the serial monitor

  String line ;
  line.reserve (8192);
  line = "";

  while (client.available()) {
    line += client.readStringUntil('\n');  //Read Line by Line
  }
  Serial.println(F("reply was:"));
  Serial.println(F("=========="));
  Serial.println(line); //Print response
  Serial.println(F("=========="));
  Serial.println(F("closing connection"));
  
  DynamicJsonDocument doc(12288);

  DeserializationError error = deserializeJson(doc, line);

  if (error) {
    Serial.print("deserializeJson() failed: ");
    Serial.println(error.c_str());
    return;
  }

  int count = doc["count"]; // 51
  // doc["next"] is null
  // doc["previous"] is null

  for (JsonObject result : doc["results"].as<JsonArray>()) {

    float result_value_exc_vat = result["value_exc_vat"]; // 4, 4, 0.6, -1.2, 0.94, -2, 8.98, 13.26, 19.2, ...
    float result_value_inc_vat = result["value_inc_vat"]; // 4.2, 4.2, 0.63, -1.26, 0.987, -2.1, 9.429, ...
    const char* result_valid_from = result["valid_from"]; // "2023-07-02T01:00:00Z", "2023-07-02T00:30:00Z", ...
    const char* result_valid_to = result["valid_to"]; // "2023-07-02T01:30:00Z", "2023-07-02T01:00:00Z", ...
    // result["payment_method"] is null
  }
}

void loop(){}

@J-M-L

Thanks for the info , as I said this is all new to me . I’ll give your code ago and report back .

I’ve seen about filters , but unfortunately I’ve seen the example on Octopus and need it all ( electricity prices every half hour )… guess I could loose the ex vat part :slight_smile:

OK - on an ESP you should have enough memory to get the data.

@J-M-L

still no go Im afraid:

Im unsure what causes the error, 'no memory'. Not enough on the 8266 (WEMOS D1) or not enough reserved space for the JSON bit (although you made that big).Tried halving these values no different. I have reduced the data field and reserved "line" size both dramatically and the error goes, so not enough space on the 8266 ?.

IDE ver: 1.8.19.

Wemos spec:
The ESP8266EX chip that the WeMos D1 board uses offers:

A 32 bit RISC CPU running at 80MHz
64Kb of instruction RAM and 96Kb of data RAM
4MB flash memory!
Wi-Fi
16 GPIO pins
I2C,SPI
I2S
1 ADC

Output:

........
WiFi connected
IP address: 
XXXXXXX
reply was:
==========
{"count":51,"next":null,"previous":null,"results":[{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-02T01:00:00Z","valid_to":"2023-07-02T01:30:00Z","payment_method":null},{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-02T00:30:00Z","valid_to":"2023-07-02T01:00:00Z","payment_method":null},{"value_exc_vat":0.6,"value_inc_vat":0.63,"valid_from":"2023-07-02T00:00:00Z","valid_to":"2023-07-02T00:30:00Z","payment_method":null},{"value_exc_vat":-1.2,"value_inc_vat":-1.26,"valid_from":"2023-07-01T23:30:00Z","valid_to":"2023-07-02T00:00:00Z","payment_method":null},{"value_exc_vat":0.94,"value_inc_vat":0.987,"valid_from":"2023-07-01T23:00:00Z","valid_to":"2023-07-01T23:30:00Z","payment_method":null},{"value_exc_vat":-2.0,"value_inc_vat":-2.1,"valid_from":"2023-07-01T22:30:00Z","valid_to":"2023-07-01T23:00:00Z","payment_method":null},{"value_exc_vat":8.98,"value_inc_vat":9.429,"valid_from":"2023-07-01T22:00:00Z","valid_to":"2023-07-01T22:30:00Z","payment_method":null},{"value_exc_vat":13.26,"value_inc_vat":13.923,"valid_from":"2023-07-01T21:30:00Z","valid_to":"2023-07-01T22:00:00Z","payment_method":null},{"value_exc_vat":19.2,"value_inc_vat":20.16,"valid_from":"2023-07-01T21:00:00Z","valid_to":"2023-07-01T21:30:00Z","payment_method":null},{"value_exc_vat":15.68,"value_inc_vat":16.464,"valid_from":"2023-07-01T20:30:00Z","valid_to":"2023-07-01T21:00:00Z","payment_method":null},{"value_exc_vat":16.0,"value_inc_vat":16.8,"valid_from":"2023-07-01T20:00:00Z","valid_to":"2023-07-01T20:30:00Z","payment_method":null},{"value_exc_vat":15.52,"value_inc_vat":16.296,"valid_from":"2023-07-01T19:30:00Z","valid_to":"2023-07-01T20:00:00Z","payment_method":null},{"value_exc_vat":17.18,"value_inc_vat":18.039,"valid_from":"2023-07-01T19:00:00Z","valid_to":"2023-07-01T19:30:00Z","payment_method":null},{"value_exc_vat":15.3,"value_inc_vat":16.065,"valid_from":"2023-07-01T18:30:00Z","valid_to":"2023-07-01T19:00:00Z","payment_method":null},{"value_exc_vat":15.3,"value_inc_vat":16.065,"valid_from":"2023-07-01T18:00:00Z","valid_to":"2023-07-01T18:30:00Z","payment_method":null},{"value_exc_vat":25.8,"value_inc_vat":27.09,"valid_from":"2023-07-01T17:30:00Z","valid_to":"2023-07-01T18:00:00Z","payment_method":null},{"value_exc_vat":22.88,"value_inc_vat":24.024,"valid_from":"2023-07-01T17:00:00Z","valid_to":"2023-07-01T17:30:00Z","payment_method":null},{"value_exc_vat":21.56,"value_inc_vat":22.638,"valid_from":"2023-07-01T16:30:00Z","valid_to":"2023-07-01T17:00:00Z","payment_method":null},{"value_exc_vat":16.56,"value_inc_vat":17.388,"valid_from":"2023-07-01T16:00:00Z","valid_to":"2023-07-01T16:30:00Z","payment_method":null},{"value_exc_vat":15.8,"value_inc_vat":16.59,"valid_from":"2023-07-01T15:30:00Z","valid_to":"2023-07-01T16:00:00Z","payment_method":null},{"value_exc_vat":11.0,"value_inc_vat":11.55,"valid_from":"2023-07-01T15:00:00Z","valid_to":"2023-07-01T15:30:00Z","payment_method":null},{"value_exc_vat":0.5,"value_inc_vat":0.525,"valid_from":"2023-07-01T14:30:00Z","valid_to":"2023-07-01T15:00:00Z","payment_method":null},{"value_exc_vat":0.0,"value_inc_vat":0.0,"valid_from":"2023-07-01T14:00:00Z","valid_to":"2023-07-01T14:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T13:30:00Z","valid_to":"2023-07-01T14:00:00Z","payment_method":null},{"value_exc_vat":-0.32,"value_inc_vat":-0.336,"valid_from":"2023-07-01T13:00:00Z","valid_to":"2023-07-01T13:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T12:30:00Z","valid_to":"2023-07-01T13:00:00Z","payment_method":null},{"value_exc_vat":0.2,"value_inc_vat":0.21,"valid_from":"2023-07-01T12:00:00Z","valid_to":"2023-07-01T12:30:00Z","payment_method":null},{"value_exc_vat":-1.0,"value_inc_vat":-1.05,"valid_from":"2023-07-01T11:30:00Z","valid_to":"2023-07-01T12:00:00Z","payment_method":null},{"value_exc_vat":0.8,"value_inc_vat":0.84,"valid_from":"2023-07-01T11:00:00Z","valid_to":"2023-07-01T11:30:00Z","payment_method":null},{"value_exc_vat":-0.44,"value_inc_vat":-0.462,"valid_from":"2023-07-01T10:30:00Z","valid_to":"2023-07-01T11:00:00Z","payment_method":null},{"value_exc_vat":0.12,"value_inc_vat":0.126,"valid_from":"2023-07-01T10:00:00Z","valid_to":"2023-07-01T10:30:00Z","payment_method":null},{"value_exc_vat":-0.06,"value_inc_vat":-0.063,"valid_from":"2023-07-01T09:30:00Z","valid_to":"2023-07-01T10:00:00Z","payment_method":null},{"value_exc_vat":4.0,"value_inc_vat":4.2,"valid_from":"2023-07-01T09:00:00Z","valid_to":"2023-07-01T09:30:00Z","payment_method":null},{"value_exc_vat":6.4,"value_inc_vat":6.72,"valid_from":"2023-07-01T08:30:00Z","valid_to":"2023-07-01T09:00:00Z","payment_method":null},{"value_exc_vat":7.48,"value_inc_vat":7.854,"valid_from":"2023-07-01T08:00:00Z","valid_to":"2023-07-01T08:30:00Z","payment_method":null},{"value_exc_vat":10.44,"value_inc_vat":10.962,"valid_from":"2023-07-01T07:30:00Z","valid_to":"2023-07-01T08:00:00Z","payment_method":null},{"value_exc_vat":7.86,"value_inc_vat":8.253,"valid_from":"2023-07-01T07:00:00Z","valid_to":"2023-07-01T07:30:00Z","payment_method":null},{"value_exc_vat":11.56,"value_inc_vat":12.138,"valid_from":"2023-07-01T06:30:00Z","valid_to":"2023-07-01T07:00:00Z","payment_method":null},{"value_exc_vat":7.59,"value_inc_vat":7.9695,"valid_from":"2023-07-01T06:00:00Z","valid_to":"2023-07-01T06:30:00Z","payment_method":null},{"value_exc_vat":8.96,"value_inc_vat":9.408,"valid_from":"2023-07-01T05:30:00Z","valid_to":"2023-07-01T06:00:00Z","payment_method":null},{"value_exc_vat":2.4,"value_inc_vat":2.52,"valid_from":"2023-07-01T05:00:00Z","valid_to":"2023-07-01T05:30:00Z","payment_method":null},{"value_exc_vat":7.6,"value_inc_vat":7.98,"valid_from":"2023-07-01T04:30:00Z","valid_to":"2023-07-01T05:00:00Z","payment_method":null},{"value_exc_vat":6.0,"value_inc_vat":6.3,"valid_from":"2023-07-01T04:00:00Z","valid_to":"2023-07-01T04:30:00Z","payment_method":null},{"value_exc_vat":1.84,"value_inc_vat":1.932,"valid_from":"2023-07-01T03:30:00Z","valid_to":"2023-07-01T04:00:00Z","payment_method":null},{"value_exc_vat":4.56,"value_inc_vat":4.788,"valid_from":"2023-07-01T03:00:00Z","valid_to":"2023-07-01T03:30:00Z","payment_method":null},{"value_exc_vat":3.66,"value_inc_vat":3.843,"valid_from":"2023-07-01T02:30:00Z","valid_to":"2023-07-01T03:00:00Z","payment_method":null},{"value_exc_vat":5.0,"value_inc_vat":5.25,"valid_from":"2023-07-01T02:00:00Z","valid_to":"2023-07-01T02:30:00Z","payment_method":null},{"value_exc_vat":3.61,"value_inc_vat":3.7905,"valid_from":"2023-07-01T01:30:00Z","valid_to":"2023-07-01T02:00:00Z","payment_method":null},{"value_exc_vat":5.6,"value_inc_vat":5.88,"valid_from":"2023-07-01T01:00:00Z","valid_to":"2023-07-01T01:30:00Z","payment_method":null},{"value_exc_vat":9.0,"value_inc_vat":9.45,"valid_from":"2023-07-01T00:30:00Z","valid_to":"2023-07-01T01:00:00Z","payment_method":null},{"value_exc_vat":13.5,"value_inc_vat":14.175,"valid_from":"2023-07-01T00:00:00Z","valid_to":"2023-07-01T00:30:00Z","payment_method":null}]}
==========
closing connection
deserializeJson() failed: NoMemory

compiler "Orange" messages:

C:\Arduino projects\octopus_enrgey_forum_response\octopus_enrgey_forum_response.ino: In function 'void makeHTTPRequest()':
C:\Arduino projects\octopus_enrgey_forum_response\octopus_enrgey_forum_response.ino:163:11: warning: unused variable 'result_value_exc_vat' [-Wunused-variable]
  163 |     float result_value_exc_vat = result["value_exc_vat"]; // 4, 4, 0.6, -1.2, 0.94, -2, 8.98, 13.26, 19.2, ...
      |           ^~~~~~~~~~~~~~~~~~~~
C:\Arduino projects\octopus_enrgey_forum_response\octopus_enrgey_forum_response.ino:164:11: warning: unused variable 'result_value_inc_vat' [-Wunused-variable]
  164 |     float result_value_inc_vat = result["value_inc_vat"]; // 4.2, 4.2, 0.63, -1.26, 0.987, -2.1, 9.429, ...
      |           ^~~~~~~~~~~~~~~~~~~~
C:\Arduino projects\octopus_enrgey_forum_response\octopus_enrgey_forum_response.ino:165:17: warning: unused variable 'result_valid_from' [-Wunused-variable]
  165 |     const char* result_valid_from = result["valid_from"]; // "2023-07-02T01:00:00Z", "2023-07-02T00:30:00Z", ...
      |                 ^~~~~~~~~~~~~~~~~
C:\Arduino projects\octopus_enrgey_forum_response\octopus_enrgey_forum_response.ino:166:17: warning: unused variable 'result_valid_to' [-Wunused-variable]
  166 |     const char* result_valid_to = result["valid_to"]; // "2023-07-02T01:30:00Z", "2023-07-02T01:00:00Z", ...
      |                 ^~~~~~~~~~~~~~~
C:\Arduino projects\octopus_enrgey_forum_response\octopus_enrgey_forum_response.ino:157:7: warning: unused variable 'count' [-Wunused-variable]
  157 |   int count = doc["count"]; // 51
      |       ^~~~~

and..

. Variables and constants in RAM (global, static), used 29000 / 80192 bytes (36%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ DATA     1548     initialized variables
╠══ RODATA   1676     constants       
╚══ BSS      25776    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 60083 / 65536 bytes (91%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ ICACHE   32768    reserved space for flash instruction cache
╚══ IRAM     27315    code in IRAM    
. Code in flash (default, ICACHE_FLASH_ATTR), used 351984 / 1048576 bytes (33%)
║   SEGMENT  BYTES    DESCRIPTION
╚══ IROM     351984   code in flash   

and...

esptool.py v3.0
Serial port COM8
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: XXXXXXXXXXXXXXXXXXXXXXX
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 386672 bytes to 286671...
Writing at 0x00000000... (5 %)
Writing at 0x00004000... (11 %)
Writing at 0x00008000... (16 %)
etc..etc..

From the code the "length()" of the string "line" is 6781 characters.. I tried reducing the amount of data accessed to give a string length of 781, but the same error results "NoMemory". Reducing the line.reserve to 8192 does stop the error.

I did not look in depth at your code. But above happens because you extract a value but don't use it after that.

Note
I have no idea how ArduinoJson works, but your line is over 7000 bytes long and a 'section' around 128 bytes.

ah I thought you were using an ESP32.

The D1 only has 64KB of SRAM so you need to be quite conservative indeed and the standard size of the stack is 4KB.

The JSON you receive is taking already 7K and because of stack space, it can't be allocated there, you need a global variable or using the heap.

You probably would want to store the incoming JSON as a char buffer (passing a char * to the deserialisation function) as it uses the zero-copy mode ➜ the JsonDocument stores pointer instead of copies of strings. That will prevent memory duplication and save space

try

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

#include <strings.h>
#include <ArduinoJson.h>


char ssid[] = "XXXXXXXXXXXXX";         // network SSID (name)
char password[] = "XXXXXXXXXXXX"; // network key

//For  HTTPS requests
WiFiClientSecure client;

const size_t maxJSONSize = 8192; // bytes
char jsonBuffer[maxJSONSize + 1]; // +1 for the trailing null


// Just the base of the URL you want to connect to
#define TEST_HOST "api.octopus.energy"

// OPTIONAL - The finferprint of the site you want to connect to.
#define TEST_HOST_FINGERPRINT "4F 01 5C 5F CC E5 31 35 83 91 D4 69 90 9A 52 97 00 FE 45 69"
// The finger print will change every few months.


void makeHTTPRequest() {

  // Opening connection to server (Using 443 as port HTTPS)
  if (!client.connect(TEST_HOST, 443)) {
    Serial.println(F("Connection failed"));
    return;
  }

  // Send HTTP request
  client.print(F("GET "));
  // This is the second half of a request (everything that comes after the base URL)
  //client.print(F(" https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-C/standard-unit-rates/?period_from=2023-07-01T00:00Z&period_to=2023-07-02T01:29Z&order_by=period")); // %2C == ,
  client.print(F("https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-C/standard-unit-rates/?period_from=2023-07-01T00:00Z&period_to=2023-07-02T01:29Z"));
  // HTTP 1.0 is ideal as the response wont be chunked
  // But some API will return 1.1 regardless, so we need
  // to handle both.
  client.println(F(" HTTP/1.0"));

  //Headers
  client.print(F("Host: "));
  client.println(TEST_HOST);

  client.println(F("Cache-Control: no-cache"));

  if (client.println() == 0)
  {
    Serial.println(F("Failed to send request"));
    return;
  }

  // Skip HTTP headers
  const char *endOfHeaders = "\r\n\r\n";
  if (!client.find(endOfHeaders))
  {
    Serial.println(F("Invalid response"));
    return;
  }


  // While the client is still available read each
  size_t jsonIndex = 0;
  while ((jsonIndex < maxJSONSize) && (client.available())) {
    jsonBuffer[jsonIndex++] = client.read();
  }
  jsonBuffer[jsonIndex] = '\0'; // terminate the c-string

  Serial.println(F("reply was:"));
  Serial.println(F("=========="));
  Serial.println(jsonBuffer); //Print response
  Serial.println(F("=========="));
  Serial.println(F("closing connection"));
  client.stop();


  DynamicJsonDocument doc(6144); // DynamicJsonDocument is a JsonDocument that allocates its memory pool in the heap

  DeserializationError error = deserializeJson(doc, jsonBuffer, jsonIndex);

  if (error) {
    Serial.print("deserializeJson() failed: ");
    Serial.println(error.c_str());
    return;
  }

  int count = doc["count"]; // 51
  Serial.print("count : "); Serial.println(count);

  for (JsonObject result : doc["results"].as<JsonArray>()) {

    float result_value_exc_vat = result["value_exc_vat"]; // 4, 4, 0.6, -1.2, 0.94, -2, 8.98, 13.26, 19.2, ...
    Serial.print("result_value_exc_vat : "); Serial.println(result_value_exc_vat);

    float result_value_inc_vat = result["value_inc_vat"]; // 4.2, 4.2, 0.63, -1.26, 0.987, -2.1, 9.429, ...
    Serial.print("result_value_inc_vat : "); Serial.println(result_value_inc_vat);

    const char* result_valid_from = result["valid_from"]; // "2023-07-02T01:00:00Z", "2023-07-02T00:30:00Z", ...
    Serial.print("result_value_exc_vat : "); Serial.println(result_valid_from ? result_valid_from : "nullptr");

    const char* result_valid_to = result["valid_to"]; // "2023 - 07 - 02T01: 30: 00Z", "2023 - 07 - 02T01: 00: 00Z", ...
    Serial.print("result_valid_to : "); Serial.println(result_valid_to ? result_valid_to : "nullptr" );

  }

}




void setup() {

  Serial.begin(115200);

  // Connect to the WiFI
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
  Serial.println(F("GO!"));
  // Attempt to connect to Wifi network:
  Serial.print(F("Connecting Wifi: "));
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println(F("WiFi connected"));
  Serial.println(F("IP address: "));
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);

  //--------
  client.setFingerprint(TEST_HOST_FINGERPRINT);

  makeHTTPRequest();
}


void loop() {}

I’ll report back - I am only trying to learn this stuff atm and have a UNO R4 Wi-Fi on order , hopefully that will be easier ( if the libraries work !!)

@J-M-L

It works !!

( well after I'd added "void loop()" Lol)

thank you very much for taking the time with me for this .

bit of the days output ( today) of electric prices :

esult_value_inc_vat : 15.06
result_value_exc_vat : 2023-07-20T04:30:00Z
result_valid_to : 2023-07-20T05:00:00Z
result_value_exc_vat : 14.00
result_value_inc_vat : 14.70
result_value_exc_vat : 2023-07-20T04:00:00Z
result_valid_to : 2023-07-20T04:30:00Z
result_value_exc_vat : 12.30
result_value_inc_vat : 12.91
result_value_exc_vat : 2023-07-20T03:30:00Z
result_valid_to : 2023-07-20T04:00:00Z
result_value_exc_vat : 13.06
result_value_inc_vat : 13.71
result_value_exc_vat : 2023-07-20T03:00:00Z
result_valid_to : 2023-07-20T03:30:00Z
result_value_exc_vat : 12.14
result_value_inc_vat : 12.75

oops :slight_smile:

glad it helped