Link real-time data to unity

How can I link or connect or read real time data from a website or database? Basically I have this model where I show it using the unity app, but at the same time, that model have some kind of reading, like the reading of water level and so on, so I’m trying to link those reading(real time data) into the unity app, so even when the reading is changed, the data in the unity app will also change according to the reading.

Are you talking about showing the time on some text?

using UnityEngine;
using System;
using UnityEngine.UI;

public class timer : MonoBehaviour
{
    public Text clockText;
    
    void Update()
    {
		string hour = DateTime.Now.Hour.ToString();
		string minute = DateTime.Now.Minute.ToString();
		string second = DateTime.Now.Second.ToString();
	
		clockText.text = hour + ":" + minute + ":" + second;
	}
}

It’s no different to doing it in any C# application using System.Net. Below is a generic example ripped off stackoverflow.

How you parse & use the returned data string is up to you, and is usually the time consuming part.

string urlAddress = "http://google.com";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

if (response.StatusCode == HttpStatusCode.OK)
{
  Stream receiveStream = response.GetResponseStream();
  StreamReader readStream = null;

  if (String.IsNullOrWhiteSpace(response.CharacterSet))
     readStream = new StreamReader(receiveStream);
  else
     readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));

  string data = readStream.ReadToEnd();

  response.Close();
  readStream.Close();
}