
temperature = WeatherData[GeoPosition[Entity["City", {"Lima", "Lima", "Peru"}]], "Temperature"];

result = ExportString[<|"Description" -> "Temperature",
  "Location" -> "Lima, Peru",
  "Magnitude" -> QuantityMagnitude[temperature],
  "Unit" -> QuantityUnit[temperature],
  "DateTime" -> DateString["ISODateTime"]|>, "RawJSON", "Compact" -> True ]
