Weather API Script not receiving datay

I have a script that uses Openweathermap API for weather data, the problem is for some reason that data is not being received, and there are no errors in Output.

Script:

--API Data-
local Api_Key = "API key here"
local Api_City_Name = "New York"
local Api_Url = "https://api.openweathermap.org/data/2.5/weather?q="..Api_City_Name.."&appid="..Api_Key

--Get HttpService--
local HS = game:GetService("HttpService")

--Get Weather Data--
local Data = nil
local s, e = pcall(function()
	Data = HS:GetAsync(Api_Url)
end)
if Data ~= nil then
	Data = HS:JSONDecode(Data)
	print(Data)
end

You might have leaked your API Key… Be careful!

Did you try opening the link in your browser?

Its not printing any error bc you have it in a pcall, just print the returns of the pcall after it.

Json Output will look like raw data in browser. I’d recommend trying it in a browser before testing it with get requests. Also an API Key is not something you should share!

First of all, never leak API keys in the forum(I highly suggest you edit the post to set it to "") people can use them to make requests as you. Secondly the error may happen because you didn’t url encode the city name(urls don’t allow spaces):

local Api_City_Name = HS:UrlEncode("New York") --New%20York

Oh, I almost forgot I still had my key in the script, thanks for reminding me.

This didn’t work for me either, what’s odd is there are as I mentioned no errors in output but there’s also no sign that the script is even running, I’m not sure if my output settings are messed up or what.

I discovered my script was in server storage, not server script service.