using System.Collections.Generic;
public static void Main()
Game game = GetGameData(570);
Console.WriteLine("Name: " + data.name);
Console.WriteLine("Type: " + data.type);
Console.WriteLine("Description: " + data.short_description);
Console.WriteLine("Free: " + (data.is_free ? "Yes": "No"));
Console.WriteLine("Genres: " + string.Join(", ", data.genres.Select(g => g.description)));
if (data.categories != null)
Console.WriteLine("Categories: " + string.Join(", ", data.categories.Select(g => g.description)));
Console.WriteLine("Web site: " + data.website);
Console.WriteLine("Release date: " + data.release_date.date);
Console.WriteLine("Developers: " + string.Join(", ", data.developers));
Console.WriteLine("Platforms: " + GetPlatformString(data.platforms));
Console.WriteLine("Unsuccessful");
private static string GetPlatformString(Platforms platforms)
List<string> list = new List<string>();
if (platforms.windows) list.Add("windows");
if (platforms.mac) list.Add("mac");
if (platforms.linux) list.Add("linux");
return string.Join(", ", list);
public static Game GetGameData(int GameId)
var url = "https://store.steampowered.com/api/appdetails/?appids=" + GameId.ToString();
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format(url));
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Console.WriteLine(WebResp.StatusCode);
Console.WriteLine(WebResp.Server);
using (Stream stream = WebResp.GetResponseStream())
StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
jsonString = reader.ReadToEnd();
var dict = JsonConvert.DeserializeObject<Dictionary<string, Game>>(jsonString);
Game gameData = dict[GameId.ToString()];
public bool success { get; set; }
public Data data { get; set; }
public string type { get; set; }
public string name { get; set; }
public int steam_appid { get; set; }
public int required_age { get; set; }
public bool is_free { get; set; }
public List<int> dlc { get; set; }
public string detailed_description { get; set; }
public string about_the_game { get; set; }
public string short_description { get; set; }
public string supported_languages { get; set; }
public string reviews { get; set; }
public string header_image { get; set; }
public string website { get; set; }
public List<string> developers { get; set; }
public List<string> publishers { get; set; }
public List<int> packages { get; set; }
public List<PackageGroup> package_groups { get; set; }
public Platforms platforms { get; set; }
public Metacritic metacritic { get; set; }
public List<Category> categories { get; set; }
public List<Genre> genres { get; set; }
public List<Screenshot> screenshots { get; set; }
public List<Movie> movies { get; set; }
public Recommendations recommendations { get; set; }
public ReleaseDate release_date { get; set; }
public SupportInfo support_info { get; set; }
public string background { get; set; }
public class PcRequirements
public string minimum { get; set; }
public class MacRequirements
public string minimum { get; set; }
public class LinuxRequirements
public string minimum { get; set; }
public class PackageGroup
public string name { get; set; }
public string title { get; set; }
public string description { get; set; }
public string selection_text { get; set; }
public string save_text { get; set; }
public int display_type { get; set; }
public string is_recurring_subscription { get; set; }
public List<Sub> subs { get; set; }
public int packageid { get; set; }
public string percent_savings_text { get; set; }
public int percent_savings { get; set; }
public string option_text { get; set; }
public string option_description { get; set; }
public string can_get_free_license { get; set; }
public bool is_free_license { get; set; }
public int price_in_cents_with_discount { get; set; }
public bool windows { get; set; }
public bool mac { get; set; }
public bool linux { get; set; }
public int score { get; set; }
public string url { get; set; }
public int id { get; set; }
public string description { get; set; }
public string id { get; set; }
public string description { get; set; }
public int id { get; set; }
public string path_thumbnail { get; set; }
public string path_full { get; set; }
public int id { get; set; }
public string name { get; set; }
public string thumbnail { get; set; }
public Webm webm { get; set; }
public bool highlight { get; set; }
public string _480 { get; set; }
public string max { get; set; }
public class Recommendations
public int total { get; set; }
public bool coming_soon { get; set; }
public string date { get; set; }
public string url { get; set; }
public string email { get; set; }