linvi / tweetinvi

Tweetinvi, an intuitive Twitter C# library for the REST and Stream API. It supports .NET, .NETCore, UAP (Xamarin)...
MIT License
1.01k stars 220 forks source link

SearchTweetsAsync does not return non_private_metrics and other fields #1174

Open jakubbloksa opened 2 years ago

jakubbloksa commented 2 years ago

When I try V2.SearchTweetsAsync and I want NonPublicMetrics or OrganicMetrics they are null in the result. But when I create the same request and call it with Execute.RequestAsync I got them included. In both cases, the userClient is the same and I have an access token and access secret + consumer key and secret. I think this is a bug or am I missing something?

var result = await userClient.Execute.RequestAsync<TweetsV2Response>(query =>
{
    query.Url = "https://api.twitter.com/2/tweets/search/recent?query=from:someUsername&tweet.fields=non_public_metrics";
});

var result2 = await userClient.SearchV2.SearchTweetsAsync(new SearchTweetsV2Parameters("from:someUsername")
{
        TweetFields =
    {
        TweetResponseFields.Tweet.NonPublicMetrics,
        TweetResponseFields.Tweet.OrganicMetrics,
    },
});