Hi I am writing a small task to learn ,querying stackoverflow api I want to achieve below ● Number of questions asked on that date ● Total number of views across all questions ● Distinct (i.e. no duplicates) comma separated list of the tags used across all questions for that date, ordered alphabetically.
I have done below api call but this is not I have expected.First thing I didn't find api end point to get no.of questions for date from stackexchange api . Any suggestions are much appreciated
static void Main()
{
Console.WriteLine("Making stackoverflow API Call...");
using (var client = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }))
{
client.BaseAddress = new Uri("https://api.stackexchange.com/docs");
// Int32 unixTimestamp = (Int32) (DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1,0,0,0,0))).TotalSeconds;
var unixStamp = Helper.ConvertToDateTime("2017, 09, 23, 0, 0, 0");
var response = client.GetAsync("questions?fromdate="+ unixStamp + "&todate="+ unixStamp + "&site=stackoverflow").Result;
response.EnsureSuccessStatusCode();
var s = response.Content.ReadAsStringAsync().Result;
var result = response.Content.ReadAsStringAsync().Result.Count();
Console.WriteLine("Total no.of questions asked: " + result);
}
Console.ReadLine();
}