user_timeline missing about 1 in every 200 tweets?

count
api

#1

For many channels, this works perfectly. However, ocassionally I’ll come across a user that will only return 198 or so tweets out of 200. Obviously this is not a big difference and not a big deal, but I’m wondering if there’s any reason why this could be? Thank you!

def parse(channels,n):
    print("Getting tweets...")
    objList=[]
    for x in range(len(channels)):
        channel=channels[x]
        page = 1
        while page<=n:
            statuses = None
            try:
                statuses = api.user_timeline(page=page, id=channel,count=200, include_rts=True)
            except:
                renew_time = time.strftime("%H:%M:%S", time.gmtime(api.rate_limit_status()['resources']['statuses']['/statuses/user_timeline']['reset']-21600))
                sys.exit("Oops! Rate limit exceeded. Try again at: " + str(renew_time + " CST."))
            if statuses:
                count=0
                for status in statuses:
                    txt = status["text"]
                    text_clean = re.sub(r"(?:\@|https?\:\/\/)\S+", "URL", txt)
                    newTweet = Tweet(text_clean,channel)
                    objList.append(newTweet)
                    count=count+1
                print(count)
            page += 1
    return objList

#2

I am not 100% sure but I think that the count will take into account deleted tweets as well, so if that user posted a Tweet and deleted it again it still counts as a Tweet for this endpoint but is not present in the reply, as it’s deleted. Another reason could be that some tweets cane be blocked in some locations for a variety of legal reasons, most common are DMCA takedowns.