I set up an API and cloud deployed it to get the current weather in my city with
co=CloudDeploy[APIFunction[{},ResponseForm[QuantityMagnitude[UnitConvert[=current temperature in new york city,"DegreesCelsius"]],"JSON"]&],Permissions->"Public"]
This works perfectly and I'm able to access the output with an http request.
Only problem is that the value returned for temperature seems to be stuck at the value of when I originally deployed the API.
Is the problem maybe just the actual frequency the data is updated on wolfram's side, or do I need to change something in the code?
Thanks!
PS: I'm new no Mathematica and not sure what's the best way to paste my input code here, so just to explain, for the =current temperature in new york city
I used the natural language processing function in Mathematica.
Update: Without relying on natural language input, the line above can be replaced with the following. Thanks Syed for pointing this out.
co=CloudDeploy[APIFunction[{},ResponseForm[QuantityMagnitude[UnitConvert[AirTemperatureData[Entity["City", {"NewYork", "NewYork", "UnitedStates"}]],"DegreesCelsius"]],"JSON"]&],Permissions->"Public"]
Delayed
in conjunction withCloudDeploy
. $\endgroup$Value
field, but that is now gone. Any ideas? $\endgroup$api = CloudDeploy[APIFunction[{}, ResponseForm[DateString["ISODateTime"], "JSON"]&]]; Lookup[URLExecute[api, "JSON"],"Result"]
$\endgroup$AirTemperatureData[ Entity["City", {"NewYork", "NewYork", "UnitedStates"}]]
if you don't want natural language input. $\endgroup$