using System.Collections.Generic;
using Newtonsoft.Json.Serialization;
public static void Main()
WebClient cl = new WebClient();
string str = cl.DownloadString(@"http://api.openweathermap.org/data/2.5/weather?q=Ankara,tr");
RootObject result = JsonConvert.DeserializeObject<RootObject>(str);
Console.WriteLine(result.main.temp);
public double lon { get; set; }
public double lat { get; set; }
public int type { get; set; }
public int id { get; set; }
public double message { get; set; }
public string country { get; set; }
public int sunrise { get; set; }
public int sunset { get; set; }
public int id { get; set; }
public string main { get; set; }
public string description { get; set; }
public string icon { get; set; }
public double temp { get; set; }
public int pressure { get; set; }
public int humidity { get; set; }
public double temp_min { get; set; }
public double temp_max { get; set; }
public double speed { get; set; }
public int deg { get; set; }
public int all { get; set; }
public Coord coord { get; set; }
public Sys sys { get; set; }
public List<Weather> weather { get; set; }
public string @base { get; set; }
public MainWeather main { get; set; }
public Wind wind { get; set; }
public Clouds clouds { get; set; }
public int dt { get; set; }
public int id { get; set; }
public string name { get; set; }
public int cod { get; set; }