Covid 19 Live Tracker with ESP32

Hey guys! I would like to implement the following: an ESP 32 should retrieve data from the RKI about the current Corona case numbers and similar data (see code) ... the problem is that the data in JSON format is apparently stored in the code (i.e. in the variables) means that I can't change it unless I replace the JSON document with a new one. But I would like the data to be automatically compared and updated with those from the RKI once a day, but I don't know how and have not found anything in this regard. So I would be very happy if someone could help me or even show me an alternative method. :hugs:

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>

const char* ssid = "";
const char* password =  "";



void setup() {

  Serial.begin(115200);
  delay(4000);
  Serial.println("");
  Serial.print("Verbinde mit Netzwerk: ");
  Serial.println(ssid);

  delay(1000);
  
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(250);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("Erfolgreich verbunden");

}

void loop() {

//-------------------------------------------------------------------------------------------------JSON ABFRAGE/AUSGABE Landkreis VR-------------------------------------------------------------------------------------------------
  if ((WiFi.status() == WL_CONNECTED)) { //Abrufen der Daten erfolgt nur wenn der ESP mit dem Wlan verbunden ist

    HTTPClient http;

    http.begin("https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=OBJECTID%3E0&objectIds=348&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=cases%2C+deaths%2C+BL%2C+county%2C+last_update%2C+cases7_per_100k%2C+cases7_bl_per_100k%2C+cases7_bl%2C+death7_bl%2C+cases7_lk%2C+death7_lk%2C+cases7_per_100k_txt&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=");
    int httpCode = http.GET();



    if (httpCode > 0) { 

      const size_t capacity = JSON_ARRAY_SIZE(1) + JSON_ARRAY_SIZE(12) + JSON_OBJECT_SIZE(1) + 2*JSON_OBJECT_SIZE(2) + 8*JSON_OBJECT_SIZE(6) + 5*JSON_OBJECT_SIZE(7) + JSON_OBJECT_SIZE(12) + 2260;
      DynamicJsonBuffer jsonBuffer(capacity);

      const char* json = "{\"objectIdFieldName\":\"OBJECTID\",\"uniqueIdField\":{\"name\":\"OBJECTID\",\"isSystemMaintained\":true},\"globalIdFieldName\":\"\",\"geometryType\":\"esriGeometryPolygon\",\"spatialReference\":{\"wkid\":25832,\"latestWkid\":25832},\"fields\":[{\"name\":\"cases\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Fälle\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"deaths\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Todesfälle\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"BL\",\"type\":\"esriFieldTypeString\",\"alias\":\"Bundesland\",\"sqlType\":\"sqlTypeOther\",\"length\":256,\"domain\":null,\"defaultValue\":null},{\"name\":\"county\",\"type\":\"esriFieldTypeString\",\"alias\":\"Landkreis\",\"sqlType\":\"sqlTypeOther\",\"length\":256,\"domain\":null,\"defaultValue\":null},{\"name\":\"last_update\",\"type\":\"esriFieldTypeString\",\"alias\":\"Aktualisierung\",\"sqlType\":\"sqlTypeOther\",\"length\":256,\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_per_100k\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Fälle letzte 7 Tage/100.000 EW\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_bl_per_100k\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Bundeslandweite Fälle der letzten 7 Tage/100.000 EW\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_bl\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Fälle der letzten 7 Tage pro Bundesland\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"death7_bl\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Todesfälle der letzten 7 Tage pro Bundesland\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_lk\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Fälle der letzten 7 Tage pro Landkreis\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"death7_lk\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Todesfälle der letzten 7 Tage pro Landkreis\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_per_100k_txt\",\"type\":\"esriFieldTypeString\",\"alias\":\"Fälle der letzten 7 Tage/100000 EW (Text)\",\"sqlType\":\"sqlTypeOther\",\"length\":256,\"domain\":null,\"defaultValue\":null}],\"features\":[{\"attributes\":{\"cases\":3747,\"deaths\":75,\"BL\":\"Mecklenburg-Vorpommern\",\"county\":\"LK Vorpommern-Rügen\",\"last_update\":\"10.05.2021, 00:00 Uhr\",\"cases7_per_100k\":40.9431157711102,\"cases7_bl_per_100k\":87.1815727257238,\"cases7_bl\":1402,\"death7_bl\":3,\"cases7_lk\":92,\"death7_lk\":1,\"cases7_per_100k_txt\":\"40,9\"}}]}";

      JsonObject& root = jsonBuffer.parseObject(json);

      const char* objectIdFieldName = root["objectIdFieldName"]; // "OBJECTID"

      const char* uniqueIdField_name = root["uniqueIdField"]["name"]; // "OBJECTID"
      bool uniqueIdField_isSystemMaintained = root["uniqueIdField"]["isSystemMaintained"]; // true

      const char* globalIdFieldName = root["globalIdFieldName"]; // ""
      const char* geometryType = root["geometryType"]; // "esriGeometryPolygon"

      int spatialReference_wkid = root["spatialReference"]["wkid"]; // 25832
      int spatialReference_latestWkid = root["spatialReference"]["latestWkid"]; // 25832

      JsonArray& fields = root["fields"];

      JsonObject& fields_0 = fields[0];
      const char* fields_0_name = fields_0["name"]; // "cases"
      const char* fields_0_type = fields_0["type"]; // "esriFieldTypeInteger"
      const char* fields_0_alias = fields_0["alias"]; // "Fälle"
      const char* fields_0_sqlType = fields_0["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_1 = fields[1];
      const char* fields_1_name = fields_1["name"]; // "deaths"
      const char* fields_1_type = fields_1["type"]; // "esriFieldTypeInteger"
      const char* fields_1_alias = fields_1["alias"]; // "Todesfälle"
      const char* fields_1_sqlType = fields_1["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_2 = fields[2];
      const char* fields_2_name = fields_2["name"]; // "BL"
      const char* fields_2_type = fields_2["type"]; // "esriFieldTypeString"
      const char* fields_2_alias = fields_2["alias"]; // "Bundesland"
      const char* fields_2_sqlType = fields_2["sqlType"]; // "sqlTypeOther"
      int fields_2_length = fields_2["length"]; // 256

      JsonObject& fields_3 = fields[3];
      const char* fields_3_name = fields_3["name"]; // "county"
      const char* fields_3_type = fields_3["type"]; // "esriFieldTypeString"
      const char* fields_3_alias = fields_3["alias"]; // "Landkreis"
      const char* fields_3_sqlType = fields_3["sqlType"]; // "sqlTypeOther"
      int fields_3_length = fields_3["length"]; // 256

      JsonObject& fields_4 = fields[4];
      const char* fields_4_name = fields_4["name"]; // "last_update"
      const char* fields_4_type = fields_4["type"]; // "esriFieldTypeString"
      const char* fields_4_alias = fields_4["alias"]; // "Aktualisierung"
      const char* fields_4_sqlType = fields_4["sqlType"]; // "sqlTypeOther"
      int fields_4_length = fields_4["length"]; // 256

      JsonObject& fields_5 = fields[5];
      const char* fields_5_name = fields_5["name"]; // "cases7_per_100k"
      const char* fields_5_type = fields_5["type"]; // "esriFieldTypeDouble"
      const char* fields_5_alias = fields_5["alias"]; // "Fälle letzte 7 Tage/100.000 EW"
      const char* fields_5_sqlType = fields_5["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_6 = fields[6];
      const char* fields_6_name = fields_6["name"]; // "cases7_bl_per_100k"
      const char* fields_6_type = fields_6["type"]; // "esriFieldTypeDouble"
      const char* fields_6_alias = fields_6["alias"]; // "Bundeslandweite Fälle der letzten 7 Tage/100.000 EW"
      const char* fields_6_sqlType = fields_6["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_7 = fields[7];
      const char* fields_7_name = fields_7["name"]; // "cases7_bl"
      const char* fields_7_type = fields_7["type"]; // "esriFieldTypeInteger"
      const char* fields_7_alias = fields_7["alias"]; // "Fälle der letzten 7 Tage pro Bundesland"
      const char* fields_7_sqlType = fields_7["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_8 = fields[8];
      const char* fields_8_name = fields_8["name"]; // "death7_bl"
      const char* fields_8_type = fields_8["type"]; // "esriFieldTypeInteger"
      const char* fields_8_alias = fields_8["alias"]; // "Todesfälle der letzten 7 Tage pro Bundesland"
      const char* fields_8_sqlType = fields_8["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_9 = fields[9];
      const char* fields_9_name = fields_9["name"]; // "cases7_lk"
      const char* fields_9_type = fields_9["type"]; // "esriFieldTypeInteger"
      const char* fields_9_alias = fields_9["alias"]; // "Fälle der letzten 7 Tage pro Landkreis"
      const char* fields_9_sqlType = fields_9["sqlType"]; // "sqlTypeOther"

      JsonObject& fields_10 = fields[10];
      const char* fields_10_name = fields_10["name"]; // "death7_lk"
      const char* fields_10_type = fields_10["type"]; // "esriFieldTypeInteger"
      const char* fields_10_alias = fields_10["alias"]; // "Todesfälle der letzten 7 Tage pro Landkreis"
      const char* fields_10_sqlType = fields_10["sqlType"]; // "sqlTypeOther"
      
      JsonObject& fields_11 = fields[11];
      const char* fields_11_name = fields_11["name"]; // "cases7_per_100k_txt"
      const char* fields_11_type = fields_11["type"]; // "esriFieldTypeString"
      const char* fields_11_alias = fields_11["alias"]; // "Fälle der letzten 7 Tage/100000 EW (Text)"
      const char* fields_11_sqlType = fields_11["sqlType"]; // "sqlTypeOther"
      int fields_11_length = fields_11["length"]; // 256

      JsonObject& features_0_attributes = root["features"][0]["attributes"];
      int features_0_attributes_cases = features_0_attributes["cases"]; // Fälle Landkreis Vorpommern-Rügen Gesamt
      int features_0_attributes_deaths = features_0_attributes["deaths"]; // Todesfälle Landkreis Vorpommern-Rügen Gesamt
      const char* features_0_attributes_BL = features_0_attributes["BL"]; // Bundesland
      const char* features_0_attributes_county = features_0_attributes["county"]; // Landkreis
      const char* features_0_attributes_last_update = features_0_attributes["last_update"]; // Uhrzeit und Datum der letzten Aktualisierung
      float features_0_attributes_cases7_per_100k = features_0_attributes["cases7_per_100k"]; // Inzidenz Landkreis exakt
      float features_0_attributes_cases7_bl_per_100k = features_0_attributes["cases7_bl_per_100k"]; // Inzidenz Bundesland exakt
      int features_0_attributes_cases7_bl = features_0_attributes["cases7_bl"]; // Fälle Bundesland letzte 7 Tage
      int features_0_attributes_death7_bl = features_0_attributes["death7_bl"]; // Todesfälle Bundesland letzte 7 Tage
      int features_0_attributes_cases7_lk = features_0_attributes["cases7_lk"]; // Fälle Landkreis Vorpommern-Rügen letzte 7 Tage
      int features_0_attributes_death7_lk = features_0_attributes["death7_lk"]; // Todesfälle Landkreis Vorpommern-Rügen letzte 7 Tage
      const char* features_0_attributes_cases7_per_100k_txt = features_0_attributes["cases7_per_100k_txt"]; // Inzidenz Landkreis Vorpommern-Rügen

      Serial.println("");
      Serial.print("Zeitpunkt der letzten Aktualisierung der Datensätze: ");
      Serial.println(features_0_attributes_last_update);
      Serial.println("");
      Serial.println("");
      
      Serial.println("-------------------------------------------------------Datensatz Landkreis Beginn-------------------------------------------------------");

      Serial.print("Fälle ");
        Serial.print(features_0_attributes_county);
        Serial.print(" gesamt: ");
        Serial.println(features_0_attributes_cases);
      Serial.print("Todesfälle ");
        Serial.print(features_0_attributes_county);
        Serial.print(" gesamt: ");
        Serial.println(features_0_attributes_deaths);
      Serial.print("Inzidenz ");
        Serial.print(features_0_attributes_county);
        Serial.print(": ");
        Serial.println(features_0_attributes_cases7_per_100k_txt);

      Serial.println("-------------------------------------------------------Datensatz Landkreis Ende-------------------------------------------------------");

      Serial.println("");
      Serial.println("");
      
    }

    else {
      Serial.println("Error on HTTP request Landkreis");
    }

    http.end();
  }
//-------------------------------------------------------------------------------------------------ENDE JSON ABFRAGE/AUSGABE Landkreis VR-------------------------------------------------------------------------------------------------
  
//-------------------------------------------------------------------------------------------------JSON ABFRAGE/AUSGABE Bundesland MV-------------------------------------------------------------------------------------------------
  if ((WiFi.status() == WL_CONNECTED)) { //Check the current connection status

    HTTPClient http;

    http.begin("https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/Coronaf%C3%A4lle_in_den_Bundesl%C3%A4ndern/FeatureServer/0/query?where=OBJECTID%3E0&objectIds=13&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=Fallzahl%2C+Death%2C+cases7_bl_per_100k_txt%2C+LAN_ew_GEN&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=");
    int httpCode = http.GET();                                        //Make the request

    if (httpCode > 0) {

      const size_t capacity = JSON_ARRAY_SIZE(1) + JSON_ARRAY_SIZE(4) + JSON_OBJECT_SIZE(1) + 2*JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(4) + 2*JSON_OBJECT_SIZE(6) + 3*JSON_OBJECT_SIZE(7) + 890;
      DynamicJsonBuffer jsonBuffer(capacity);
      
      const char* json = "{\"objectIdFieldName\":\"OBJECTID_1\",\"uniqueIdField\":{\"name\":\"OBJECTID_1\",\"isSystemMaintained\":true},\"globalIdFieldName\":\"GlobalID\",\"geometryType\":\"esriGeometryPolygon\",\"spatialReference\":{\"wkid\":102100,\"latestWkid\":3857},\"fields\":[{\"name\":\"Fallzahl\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Anzahl Fälle\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"Death\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Anzahl Todesfälle\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_bl_per_100k_txt\",\"type\":\"esriFieldTypeString\",\"alias\":\"Fälle der letzten 7 Tage/100000 EW (Text)\",\"sqlType\":\"sqlTypeOther\",\"length\":256,\"domain\":null,\"defaultValue\":null},{\"name\":\"LAN_ew_GEN\",\"type\":\"esriFieldTypeString\",\"alias\":\"GEN\",\"sqlType\":\"sqlTypeOther\",\"length\":60,\"domain\":null,\"defaultValue\":null}],\"features\":[{\"attributes\":{\"Fallzahl\":42015,\"Death\":1044,\"cases7_bl_per_100k_txt\":\"87,2\",\"LAN_ew_GEN\":\"Mecklenburg-Vorpommern\"}}]}";
      
      JsonObject& root = jsonBuffer.parseObject(json);
      
      const char* objectIdFieldName = root["objectIdFieldName"]; // "OBJECTID_1"
      
      const char* uniqueIdField_name = root["uniqueIdField"]["name"]; // "OBJECTID_1"
      bool uniqueIdField_isSystemMaintained = root["uniqueIdField"]["isSystemMaintained"]; // true
      
      const char* globalIdFieldName = root["globalIdFieldName"]; // "GlobalID"
      const char* geometryType = root["geometryType"]; // "esriGeometryPolygon"
      
      long spatialReference_wkid = root["spatialReference"]["wkid"]; // 102100
      int spatialReference_latestWkid = root["spatialReference"]["latestWkid"]; // 3857
      
      JsonArray& fields = root["fields"];
      
      JsonObject& fields_0 = fields[0];
      const char* fields_0_name = fields_0["name"]; // "Fallzahl"
      const char* fields_0_type = fields_0["type"]; // "esriFieldTypeInteger"
      const char* fields_0_alias = fields_0["alias"]; // "Anzahl Fälle"
      const char* fields_0_sqlType = fields_0["sqlType"]; // "sqlTypeOther"
      
      JsonObject& fields_1 = fields[1];
      const char* fields_1_name = fields_1["name"]; // "Death"
      const char* fields_1_type = fields_1["type"]; // "esriFieldTypeInteger"
      const char* fields_1_alias = fields_1["alias"]; // "Anzahl Todesfälle"
      const char* fields_1_sqlType = fields_1["sqlType"]; // "sqlTypeOther"
      
      JsonObject& fields_2 = fields[2];
      const char* fields_2_name = fields_2["name"]; // "cases7_bl_per_100k_txt"
      const char* fields_2_type = fields_2["type"]; // "esriFieldTypeString"
      const char* fields_2_alias = fields_2["alias"]; // "Fälle der letzten 7 Tage/100000 EW (Text)"
      const char* fields_2_sqlType = fields_2["sqlType"]; // "sqlTypeOther"
      int fields_2_length = fields_2["length"]; // 256
      
      JsonObject& fields_3 = fields[3];
      const char* fields_3_name = fields_3["name"]; // "LAN_ew_GEN"
      const char* fields_3_type = fields_3["type"]; // "esriFieldTypeString"
      const char* fields_3_alias = fields_3["alias"]; // "GEN"
      const char* fields_3_sqlType = fields_3["sqlType"]; // "sqlTypeOther"
      int fields_3_length = fields_3["length"]; // 60
      
      JsonObject& features_0_attributes = root["features"][0]["attributes"];
      long features_0_attributes_Fallzahl = features_0_attributes["Fallzahl"]; // Fälle MV gesamt
      int features_0_attributes_Death = features_0_attributes["Death"]; // Todesfälle MV gesamt
      const char* features_0_attributes_cases7_mv_per_100k_txt = features_0_attributes["cases7_bl_per_100k_txt"]; // Inzidenz MV
      const char* features_0_attributes_LAN_ew_GEN = features_0_attributes["LAN_ew_GEN"]; // Bundesland

      Serial.println("-------------------------------------------------------Datensatz Bundesland Beginn-------------------------------------------------------");
      
      Serial.print("Fälle ");
        Serial.print(features_0_attributes_LAN_ew_GEN);
        Serial.print(" gesamt: ");
        Serial.println(features_0_attributes_Fallzahl);
      Serial.print("Todesfälle ");
        Serial.print(features_0_attributes_LAN_ew_GEN);
        Serial.print(" gesamt: ");
        Serial.println(features_0_attributes_Death);
      Serial.print("Inzidenz ");
        Serial.print(features_0_attributes_LAN_ew_GEN);
        Serial.print(": ");
        Serial.println(features_0_attributes_cases7_mv_per_100k_txt);

      Serial.println("-------------------------------------------------------Datensatz Bundesland Ende-------------------------------------------------------");

      Serial.println("");
      Serial.println("");
 
    }

    else {
      Serial.println("Error on HTTP request Bundesland");
    }

    http.end();
  }
//-------------------------------------------------------------------------------------------------ENDE JSON ABFRAGE/AUSGABE Bundesland MV-------------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------Beginn JSON ABFRAGE/AUSGABE Bundesrepublik Deutschland-------------------------------------------------------------------------------------------------
if ((WiFi.status() == WL_CONNECTED)) { //Check the current connection status

    HTTPClient http;

    http.begin("https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/Coronaf%C3%A4lle_in_den_Bundesl%C3%A4ndern/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=Fallzahl%2C+Death%2C+cases7_bl_per_100k_txt&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=");
    int httpCode = http.GET();                                        

    if (httpCode > 0) { 

      const size_t capacity = JSON_ARRAY_SIZE(4) + JSON_ARRAY_SIZE(16) + 16*JSON_OBJECT_SIZE(1) + 2*JSON_OBJECT_SIZE(2) + 16*JSON_OBJECT_SIZE(4) + 3*JSON_OBJECT_SIZE(6) + 2*JSON_OBJECT_SIZE(7) + 2240;
      DynamicJsonBuffer jsonBuffer(capacity);
      
      const char* json = "{\"objectIdFieldName\":\"OBJECTID_1\",\"uniqueIdField\":{\"name\":\"OBJECTID_1\",\"isSystemMaintained\":true},\"globalIdFieldName\":\"GlobalID\",\"geometryType\":\"esriGeometryPolygon\",\"spatialReference\":{\"wkid\":102100,\"latestWkid\":3857},\"fields\":[{\"name\":\"Fallzahl\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Anzahl Fälle\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"Death\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Anzahl Todesfälle\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_bl_per_100k_txt\",\"type\":\"esriFieldTypeString\",\"alias\":\"Fälle der letzten 7 Tage/100000 EW (Text)\",\"sqlType\":\"sqlTypeOther\",\"length\":256,\"domain\":null,\"defaultValue\":null},{\"name\":\"cases7_bl\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Fälle der letzten 7 Tage\",\"sqlType\":\"sqlTypeOther\",\"domain\":null,\"defaultValue\":null}],\"features\":[{\"attributes\":{\"Fallzahl\":60624,\"Death\":1529,\"cases7_bl_per_100k_txt\":\"50,8\",\"cases7_bl\":1476}},{\"attributes\":{\"Fallzahl\":73980,\"Death\":1519,\"cases7_bl_per_100k_txt\":\"74,8\",\"cases7_bl\":1381}},{\"attributes\":{\"Fallzahl\":247422,\"Death\":5410,\"cases7_bl_per_100k_txt\":\"84,6\",\"cases7_bl\":6760}},{\"attributes\":{\"Fallzahl\":26143,\"Death\":463,\"cases7_bl_per_100k_txt\":\"99,2\",\"cases7_bl\":676}},{\"attributes\":{\"Fallzahl\":769889,\"Death\":15943,\"cases7_bl_per_100k_txt\":\"128,8\",\"cases7_bl\":23117}},{\"attributes\":{\"Fallzahl\":273352,\"Death\":7055,\"cases7_bl_per_100k_txt\":\"120,9\",\"cases7_bl\":7602}},{\"attributes\":{\"Fallzahl\":145732,\"Death\":3614,\"cases7_bl_per_100k_txt\":\"99,8\",\"cases7_bl\":4084}},{\"attributes\":{\"Fallzahl\":466881,\"Death\":9537,\"cases7_bl_per_100k_txt\":\"145,2\",\"cases7_bl\":16117}},{\"attributes\":{\"Fallzahl\":615338,\"Death\":14417,\"cases7_bl_per_100k_txt\":\"119,5\",\"cases7_bl\":15684}},{\"attributes\":{\"Fallzahl\":38790,\"Death\":967,\"cases7_bl_per_100k_txt\":\"109,7\",\"cases7_bl\":1083}},{\"attributes\":{\"Fallzahl\":172726,\"Death\":3301,\"cases7_bl_per_100k_txt\":\"100,8\",\"cases7_bl\":3698}},{\"attributes\":{\"Fallzahl\":105072,\"Death\":3633,\"cases7_bl_per_100k_txt\":\"88,1\",\"cases7_bl\":2222}},{\"attributes\":{\"Fallzahl\":42015,\"Death\":1044,\"cases7_bl_per_100k_txt\":\"87,2\",\"cases7_bl\":1402}},{\"attributes\":{\"Fallzahl\":273097,\"Death\":9273,\"cases7_bl_per_100k_txt\":\"176,4\",\"cases7_bl\":7181}},{\"attributes\":{\"Fallzahl\":94548,\"Death\":3164,\"cases7_bl_per_100k_txt\":\"125,9\",\"cases7_bl\":2763}},{\"attributes\":{\"Fallzahl\":121642,\"Death\":3960,\"cases7_bl_per_100k_txt\":\"177,2\",\"cases7_bl\":3781}}]}";
      
      JsonObject& root = jsonBuffer.parseObject(json);
      
      const char* objectIdFieldName = root["objectIdFieldName"]; // "OBJECTID_1"
      
      const char* uniqueIdField_name = root["uniqueIdField"]["name"]; // "OBJECTID_1"
      bool uniqueIdField_isSystemMaintained = root["uniqueIdField"]["isSystemMaintained"]; // true
      
      const char* globalIdFieldName = root["globalIdFieldName"]; // "GlobalID"
      const char* geometryType = root["geometryType"]; // "esriGeometryPolygon"
      
      long spatialReference_wkid = root["spatialReference"]["wkid"]; // 102100
      int spatialReference_latestWkid = root["spatialReference"]["latestWkid"]; // 3857
      
      JsonArray& fields = root["fields"];
      
      JsonObject& fields_0 = fields[0];
      const char* fields_0_name = fields_0["name"]; // "Fallzahl"
      const char* fields_0_type = fields_0["type"]; // "esriFieldTypeInteger"
      const char* fields_0_alias = fields_0["alias"]; // "Anzahl Fälle"
      const char* fields_0_sqlType = fields_0["sqlType"]; // "sqlTypeOther"
      
      JsonObject& fields_1 = fields[1];
      const char* fields_1_name = fields_1["name"]; // "Death"
      const char* fields_1_type = fields_1["type"]; // "esriFieldTypeInteger"
      const char* fields_1_alias = fields_1["alias"]; // "Anzahl Todesfälle"
      const char* fields_1_sqlType = fields_1["sqlType"]; // "sqlTypeOther"
      
      JsonObject& fields_2 = fields[2];
      const char* fields_2_name = fields_2["name"]; // "cases7_bl_per_100k_txt"
      const char* fields_2_type = fields_2["type"]; // "esriFieldTypeString"
      const char* fields_2_alias = fields_2["alias"]; // "Fälle der letzten 7 Tage/100000 EW (Text)"
      const char* fields_2_sqlType = fields_2["sqlType"]; // "sqlTypeOther"
      int fields_2_length = fields_2["length"]; // 256
      
      JsonObject& fields_3 = fields[3];
      const char* fields_3_name = fields_3["name"]; // "cases7_bl"
      const char* fields_3_type = fields_3["type"]; // "esriFieldTypeInteger"
      const char* fields_3_alias = fields_3["alias"]; // "Fälle der letzten 7 Tage"
      const char* fields_3_sqlType = fields_3["sqlType"]; // "sqlTypeOther"
      
      JsonArray& features = root["features"];
      
      JsonObject& features_0_attributes = features[0]["attributes"];
      long features_0_attributes_Fallzahl = features_0_attributes["Fallzahl"]; // 60624
      int features_0_attributes_Death = features_0_attributes["Death"]; // 1529
      const char* features_0_attributes_cases7_bl_per_100k_txt = features_0_attributes["cases7_bl_per_100k_txt"]; // "50,8"
      int features_0_attributes_cases7_bl = features_0_attributes["cases7_bl"]; // 1476
      
      JsonObject& features_1_attributes = features[1]["attributes"];
      long features_1_attributes_Fallzahl = features_1_attributes["Fallzahl"]; // 73980
      int features_1_attributes_Death = features_1_attributes["Death"]; // 1519
      const char* features_1_attributes_cases7_bl_per_100k_txt = features_1_attributes["cases7_bl_per_100k_txt"]; // "74,8"
      int features_1_attributes_cases7_bl = features_1_attributes["cases7_bl"]; // 1381
      
      JsonObject& features_2_attributes = features[2]["attributes"];
      long features_2_attributes_Fallzahl = features_2_attributes["Fallzahl"]; // 247422
      int features_2_attributes_Death = features_2_attributes["Death"]; // 5410
      const char* features_2_attributes_cases7_bl_per_100k_txt = features_2_attributes["cases7_bl_per_100k_txt"]; // "84,6"
      int features_2_attributes_cases7_bl = features_2_attributes["cases7_bl"]; // 6760
      
      JsonObject& features_3_attributes = features[3]["attributes"];
      int features_3_attributes_Fallzahl = features_3_attributes["Fallzahl"]; // 26143
      int features_3_attributes_Death = features_3_attributes["Death"]; // 463
      const char* features_3_attributes_cases7_bl_per_100k_txt = features_3_attributes["cases7_bl_per_100k_txt"]; // "99,2"
      int features_3_attributes_cases7_bl = features_3_attributes["cases7_bl"]; // 676
      
      JsonObject& features_4_attributes = features[4]["attributes"];
      long features_4_attributes_Fallzahl = features_4_attributes["Fallzahl"]; // 769889
      int features_4_attributes_Death = features_4_attributes["Death"]; // 15943
      const char* features_4_attributes_cases7_bl_per_100k_txt = features_4_attributes["cases7_bl_per_100k_txt"]; // "128,8"
      int features_4_attributes_cases7_bl = features_4_attributes["cases7_bl"]; // 23117
      
      JsonObject& features_5_attributes = features[5]["attributes"];
      long features_5_attributes_Fallzahl = features_5_attributes["Fallzahl"]; // 273352
      int features_5_attributes_Death = features_5_attributes["Death"]; // 7055
      const char* features_5_attributes_cases7_bl_per_100k_txt = features_5_attributes["cases7_bl_per_100k_txt"]; // "120,9"
      int features_5_attributes_cases7_bl = features_5_attributes["cases7_bl"]; // 7602
      
      JsonObject& features_6_attributes = features[6]["attributes"];
      long features_6_attributes_Fallzahl = features_6_attributes["Fallzahl"]; // 145732
      int features_6_attributes_Death = features_6_attributes["Death"]; // 3614
      const char* features_6_attributes_cases7_bl_per_100k_txt = features_6_attributes["cases7_bl_per_100k_txt"]; // "99,8"
      int features_6_attributes_cases7_bl = features_6_attributes["cases7_bl"]; // 4084
      
      JsonObject& features_7_attributes = features[7]["attributes"];
      long features_7_attributes_Fallzahl = features_7_attributes["Fallzahl"]; // 466881
      int features_7_attributes_Death = features_7_attributes["Death"]; // 9537
      const char* features_7_attributes_cases7_bl_per_100k_txt = features_7_attributes["cases7_bl_per_100k_txt"]; // "145,2"
      int features_7_attributes_cases7_bl = features_7_attributes["cases7_bl"]; // 16117
      
      JsonObject& features_8_attributes = features[8]["attributes"];
      long features_8_attributes_Fallzahl = features_8_attributes["Fallzahl"]; // 615338
      int features_8_attributes_Death = features_8_attributes["Death"]; // 14417
      const char* features_8_attributes_cases7_bl_per_100k_txt = features_8_attributes["cases7_bl_per_100k_txt"]; // "119,5"
      int features_8_attributes_cases7_bl = features_8_attributes["cases7_bl"]; // 15684
      
      JsonObject& features_9_attributes = features[9]["attributes"];
      long features_9_attributes_Fallzahl = features_9_attributes["Fallzahl"]; // 38790
      int features_9_attributes_Death = features_9_attributes["Death"]; // 967
      const char* features_9_attributes_cases7_bl_per_100k_txt = features_9_attributes["cases7_bl_per_100k_txt"]; // "109,7"
      int features_9_attributes_cases7_bl = features_9_attributes["cases7_bl"]; // 1083
      
      JsonObject& features_10_attributes = features[10]["attributes"];
      long features_10_attributes_Fallzahl = features_10_attributes["Fallzahl"]; // 172726
      int features_10_attributes_Death = features_10_attributes["Death"]; // 3301
      const char* features_10_attributes_cases7_bl_per_100k_txt = features_10_attributes["cases7_bl_per_100k_txt"]; // "100,8"
      int features_10_attributes_cases7_bl = features_10_attributes["cases7_bl"]; // 3698
      
      JsonObject& features_11_attributes = features[11]["attributes"];
      long features_11_attributes_Fallzahl = features_11_attributes["Fallzahl"]; // 105072
      int features_11_attributes_Death = features_11_attributes["Death"]; // 3633
      const char* features_11_attributes_cases7_bl_per_100k_txt = features_11_attributes["cases7_bl_per_100k_txt"]; // "88,1"
      int features_11_attributes_cases7_bl = features_11_attributes["cases7_bl"]; // 2222
      
      JsonObject& features_12_attributes = features[12]["attributes"];
      long features_12_attributes_Fallzahl = features_12_attributes["Fallzahl"]; // 42015
      int features_12_attributes_Death = features_12_attributes["Death"]; // 1044
      const char* features_12_attributes_cases7_bl_per_100k_txt = features_12_attributes["cases7_bl_per_100k_txt"]; // "87,2"
      int features_12_attributes_cases7_bl = features_12_attributes["cases7_bl"]; // 1402
      
      JsonObject& features_13_attributes = features[13]["attributes"];
      long features_13_attributes_Fallzahl = features_13_attributes["Fallzahl"]; // 273097
      int features_13_attributes_Death = features_13_attributes["Death"]; // 9273
      const char* features_13_attributes_cases7_bl_per_100k_txt = features_13_attributes["cases7_bl_per_100k_txt"]; // "176,4"
      int features_13_attributes_cases7_bl = features_13_attributes["cases7_bl"]; // 7181
      
      JsonObject& features_14_attributes = features[14]["attributes"];
      long features_14_attributes_Fallzahl = features_14_attributes["Fallzahl"]; // 94548
      int features_14_attributes_Death = features_14_attributes["Death"]; // 3164
      const char* features_14_attributes_cases7_bl_per_100k_txt = features_14_attributes["cases7_bl_per_100k_txt"]; // "125,9"
      int features_14_attributes_cases7_bl = features_14_attributes["cases7_bl"]; // 2763
      
      JsonObject& features_15_attributes = features[15]["attributes"];
      long features_15_attributes_Fallzahl = features_15_attributes["Fallzahl"]; // 121642
      int features_15_attributes_Death = features_15_attributes["Death"]; // 3960
      const char* features_15_attributes_cases7_bl_per_100k_txt = features_15_attributes["cases7_bl_per_100k_txt"]; // "177,2"
      int features_15_attributes_cases7_bl = features_15_attributes["cases7_bl"]; // 3781

      Serial.println("-------------------------------------------------------Datensatz Bundesrepublik Deutschland Beginn-------------------------------------------------------");

      Serial.print("Fälle in der Bundesrepublik Deutschland gesamt: ");
        Serial.println(features_0_attributes_Fallzahl + features_1_attributes_Fallzahl + features_2_attributes_Fallzahl + features_3_attributes_Fallzahl + features_4_attributes_Fallzahl + features_5_attributes_Fallzahl + features_6_attributes_Fallzahl + features_7_attributes_Fallzahl + features_8_attributes_Fallzahl + features_9_attributes_Fallzahl + features_10_attributes_Fallzahl + features_11_attributes_Fallzahl + features_12_attributes_Fallzahl + features_13_attributes_Fallzahl + features_14_attributes_Fallzahl + features_15_attributes_Fallzahl);
      Serial.print("Todesfälle in der Bundesrepublik Deutschland gesamt: ");
        Serial.println(features_0_attributes_Death + features_1_attributes_Death + features_2_attributes_Death + features_3_attributes_Death + features_4_attributes_Death + features_5_attributes_Death + features_6_attributes_Death + features_7_attributes_Death + features_8_attributes_Death + features_9_attributes_Death + features_10_attributes_Death + features_11_attributes_Death + features_12_attributes_Death + features_13_attributes_Death + features_14_attributes_Death + features_15_attributes_Death);
      Serial.print("Inzidenz: ");
        Serial.println(((features_0_attributes_cases7_bl + features_1_attributes_cases7_bl + features_2_attributes_cases7_bl + features_3_attributes_cases7_bl + features_4_attributes_cases7_bl + features_5_attributes_cases7_bl + features_6_attributes_cases7_bl + features_7_attributes_cases7_bl + features_8_attributes_cases7_bl + features_9_attributes_cases7_bl + features_10_attributes_cases7_bl + features_11_attributes_cases7_bl + features_12_attributes_cases7_bl + features_13_attributes_cases7_bl + features_14_attributes_cases7_bl + features_15_attributes_cases7_bl)/83146095.71788413)*100000);

      Serial.println("-------------------------------------------------------Datensatz Bundesrepublik Deutschland Beginn-------------------------------------------------------");

      Serial.println("");
      Serial.println("");
      
      
    }

    else {
      Serial.println("Error on HTTP request Bundesrepublik Deutschland");
    }

    http.end();
}
//-------------------------------------------------------------------------------------------------ENDE JSON ABFRAGE/AUSGABE Bundesrepublik Deutschland-------------------------------------------------------------------------------------------------
  delay(3600000);

}

HTTPS via HTTP? Does that really work?

You can use also HTTPS it's just a certificate!

Its amazing work and very helpful for everyone but you can also use https because its also just a certificate.