Using timezonedb API to call time.

Hello,

I would like to develop a clock which gets the time from timezonedb using their API.

The plan is to display the time in the Serial Monitor.

I am using a adafruit eps32, with arduino IDE.

So far I have managed to connect to the Wifi, and check signal strength. All this is working correctly at the moment.

The problem I am having is I have never used API's and this is something I would like to learn more about and use in projects.

I would really appreciate some advice/help with how to implement the timezonedb API to get the time.

https://timezonedb.com/api

Thank you! :)

#include <WiFi.h>
#include <SPI.h>
#include <time.h>


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

int status = WL_IDLE_STATUS;



void setup() {

Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);


while (WiFi.status() != WL_CONNECTED) {

  Serial.print("Connecting to WiFi network: ");
  Serial.println(ssid);

    status = WiFi.begin(ssid, password);

    delay(500);


}

  Serial.print("Connected to WiFi network: ");
  Serial.println(ssid);
  
  Serial.print("Your IP: ");
  Serial.println(WiFi.localIP());

}

void loop() {                                                        // the loop function runs over and over again forever
  
digitalWrite(LED_BUILTIN, HIGH);                        // turn the LED on (HIGH is the voltage level)
delay(100);                                                       // wait for 0.1 second
digitalWrite(LED_BUILTIN, LOW);                       // turn the LED off by making the voltage LOW
delay(100);                                                      // wait for 0.1 second
digitalWrite(LED_BUILTIN, HIGH);                     // turn the LED on (HIGH is the voltage level)
delay(100);                                                    // wait for 0.1 second
digitalWrite(LED_BUILTIN, LOW);                    // turn the LED off by making the voltage LOW
delay(1000);                                                // wait for 0.1 second
       

// Checks network status
//
  if (WiFi.status() == WL_CONNECTED) {               // Checks network status
      Serial.print("WiFi Status: ");
      Serial.print("Connected to ");
      Serial.println(ssid);

  
    //WL_NO_SHIELD        = 255
    //WL_IDLE_STATUS      = 0
    //WL_NO_SSID_AVAIL    = 1
    //WL_SCAN_COMPLETED   = 2
    //WL_CONNECTED        = 3
    //WL_CONNECT_FAILED   = 4
    //WL_CONNECTION_LOST  = 5
    //WL_DISCONNECTED     = 6


//WiFi Singal Strength

long rssi = WiFi.RSSI();

unsigned long before = micros();
unsigned long after = micros();

Serial.print("Signal strength: ");
Serial.print(rssi);
Serial.println("dBm");

Serial.print("Took: ");
Serial.print(after - before);
Serial.println(" micro/seconds");

delay(1000);




}

} // The End