def METHOD_NAME():
    global region, forecast, index, power_list, datetime_to, datetime_from
    print(f"Requesting URL: {URL}")
    r = urequests.get(URL)
    # open the json data
    j = r.json()
    print("Data obtained!")
    print(j)
    # parse the json data
    region = j["data"][0]["shortname"]
    forecast = j["data"][0]["data"][0]["intensity"]["forecast"]
    index = j["data"][0]["data"][0]["intensity"]["index"]
    power_list = []
    for power in j["data"][0]["data"][0]["generationmix"]:
        power_list.append(power['perc'])
    datetime_to = j["data"][0]["data"][0]["to"].split("T")
    datetime_from = j["data"][0]["data"][0]["from"].split("T")
    # close the socket
    r.close()