Hey, I’m a noob, currently doing an assignment.
I don’t understand most terms.
I’m trying to create a simple weather API function
There seems to be no issues with the code, but I get errors, and the api doesn’t seem to show the URL when adding it as a component in the EventSystem section.

The errors are:
Assets\Scripts\WeatherApi.cs(57,38): error CS1061: ‘string’ does not contain a definition for ‘Parse’ and no accessible extension method ‘Parse’ accepting a first argument of type ‘string’ could be found (are you missing a using directive or an assembly reference?)
and
Assets\Scripts\WeatherApi.cs(39,31): error CS1061: ‘string’ does not contain a definition for ‘text’ and no accessible extension method ‘text’ accepting a first argument of type ‘string’ could be found (are you missing a using directive or an assembly reference?)
I’m quite lost.
I’ve tried reinstalling Unity. Something is missing but I’m no veteran. The script, so far, in the API is below:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using SimpleJSON;
using UnityEngine.UI;
public class WeatherAPI : MonoBehaviour
{
// store API location into a string
public string url = "https://fcc-weather-api.glitch.me/api/current?lat=35&lon=139";
public string currentLocation;
public float currentTemp;
public float currentLowTemp;
public float currentMaxTemp;
// Display Inputs
public Text displayLocation;
public Text displayTemp;
public Text displayLowTemp;
public Text displayHighTemp;
// set up URL request to locate url
// access JSON code
// initialisation of API
IEnumerator Start()
{
// set up www request
WWW request = new WWW(url);
yield return request;
if (request.error == null || request.error == "")
{
// successful call
// parse the JSON code
Debug.Log("Response:" + request.text);
string weather = JsonUtility.ToJson(request.text);
Debug.Log(weather.text);
SetWeather(request.text);
}
else
{
// if the call to API has failed
Debug.Log("Error: " + request.error);
}
}
// Set Weather Variables Function
void SetWeather(string jsonString)
{
var weatherJson = jsonString.Parse(jsonString);
// issuing variables the data they need
currentLocation = weatherJson["name"].Value;
currentTemp = weatherJson["main"]["temp"].AsFloat;
currentLowTemp = weatherJson["main"]["temp_min"].AsFloat;
currentMaxTemp = weatherJson["main"]["temp_max"].AsFloat;
Debug.Log(currentLocation);
Debug.Log(currentTemp);
Debug.Log(currentMaxTemp);
Debug.Log(currentLowTemp);
}