public async Task <Tweet> GetTweets(string searchText) { var baseUri = new Uri("https://api.twitter.com/1.1/search/tweets.json"); var client = new RestClient(baseUri); var request = new RestRequest(baseUri, Method.GET); request.AddParameter("q", searchText, ParameterType.QueryString); request.AddParameter("lang", "en", ParameterType.QueryString); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer " + _twitterService.GetBearerToken()); var tweet = client.Execute <Tweet>(request).Data; return(tweet); }