Mentions_timeline endpoint missing some mentions- why?


I’m supporting code that calls the mentions_timeline endpoint in the REST API v1.1. My customers have reported that some mentions are missing.

For example, nubankbrasil is a customer. This tweet mentions nubankbrasil: When my app authenticates as nubankbrasil and calls, the tweet is returned. The user_mentions of the tweet include a screen_name of nubankbrasil.

However, when my app requests with parameters like {:since_id=>“805819593327513600”, :max_id=>“805829609220673536”, :tweet_mode=>“extended”, :count=>200}, the response includes tweets before 805823851951259648 and tweets after 805823851951259648, but does not include 805823851951259648.

Is there something special about tweet 805823851951259648 that prevents it from being returned in mentions_timeline calls? A number of tweets from the same author seem to have this problem (805594962708533249, 805251376477597696, 805106539522621444.)


Seems weird. Does nubankbrasil show in the entities.user_mentions part on this endpoint for that tweet?



> tweet[:entities][:user_mentions]
=> [{:screen_name=>"nubankbrasil", :name=>"Nubank", :id=>2319390320, :id_str=>"2319390320", :indices=>[0, 13]}]


Do any of the mentions that come up actually start with the characters “@Nubankbrasil”? I’m thinking it might have something to do with these tweets being “to” the user rather than just mentioning them. I agree that you would expect them to still be considered mentions but you never know.


Daniel, I think that the mentions do start with the characters @nubankbrasil. For example, reads “@nubankbrasil oi Boa tarde!” in the Twitter web UI. Is that what you were asking?



Yes. What I’m asking is if all the tweets mentioning that account that aren’t showing up start with @{username} rather than having the @{username} later on.

If they are all starting with @ and don’t show up then it’s likely to be either a bug or an interesting design choice by Twitter as I would think they are still considered mentions.

You could use to try and find the tweets a different way though, maybe combining the to:NASA and @NASA examples.


I’m only aware of 4 Tweets that are acting this way, though I suspect there are more. All four start with @{username}. I’m able to find all four by using their IDs in the show endpoint, but none of them are visible on the mentions_timeline. Of course, other Tweets are visible on the mention_timeline. I suspect that if a Twitter employee were to examine the internal details of the Tweets, the explanation might be obvious, but it’s hard for me to tell what’s going on from the outside.