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

Empty response for specific accounts #1128

Open jasonmcauley opened 3 years ago

jasonmcauley commented 3 years ago

I am finding when polling "high profile" accounts, I am getting an empty array response (with a 200 response code) about 50% of the time.

image

vs.

image

var timelineParms = new GetUserTimelineParameters(_appSettings.TwitterAccountToWatch)
            {
                ExcludeReplies = true,
                TrimUser = false,
                PageSize = 1                
            };

var lastTweets = await twitterClient.Timelines.GetUserTimelineAsync(timelineParms);

Ive experimented with increasing the page side and/or including replies. I find I get less empty arrays, however the tweets that come back seem quite random (almost each request returns a unique set of results as far as which tweets, the order of the tweets, etc). I am finding that intermittently, when PageSize=1, it will pull a much older tweet (less frequent, under 1% of the time).

When pointing to my own twitter accounts, it seems to return the expected response every time. Is this a known issue with the twitter API? Do the APIs struggle for accounts that likely have a lot of API activity against them? Is there a way around it?

Seems some testing with the v2 API was also producing better results as far as consistency with the response, however it doesn't seem to pick up a new tweet until 10+ seconds after it has been tweeted, which is a problem for my use case in which I am trying to get the tweet as instantaneously as possible.