How get weekly twitter trends using REST API

This code sample will show how you can get weekly trends using REST API. The sample shows another feature of the API where you can specify a criteria to limit the results. You can specify a start date for the report. This is set by calling On method on ITwitterSearchTrends.

static List GetWeeklyTrends(DateTime ? onDate)
 TwitterClientInfo clientInfo = new TwitterClientInfo();
 clientInfo.ClientName = "Marketweet";
 clientInfo.ClientUrl = "";
 clientInfo.ClientVersion = "1.1";
 List trendNames = new List();
 IFluentTwitter ft = FluentTwitter.CreateRequest(clientInfo);
 ft.AuthenticateAs(LOGIN_NAME, PASSWORD);
 ITwitterSearchTrends searchTrends = ft.Search().Trends().Weekly();
 if (null != onDate)
 var resp = ft.Request();
 if (null != resp)
  var trends = resp.AsTrends();
  if (null != trends)
   foreach (TwitterSearchTrend trend in trends.Trends)
 return trendNames;




16.6 °C / 61.8 °F

weather conditions Clear

Monthly Posts

Blog Tags