Mentions_timeline endpoint missing some mentions- why?


#1

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: https://twitter.com/gabrieldesa_/status/805823851951259648. When my app authenticates as nubankbrasil and calls https://api.twitter.com/1.1/statuses/show/805823851951259648.json, the tweet is returned. The user_mentions of the tweet include a screen_name of nubankbrasil.

However, when my app requests https://api.twitter.com/1.1/statuses/mentions_timeline.json 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.)


#2

Seems weird. Does nubankbrasil show in the entities.user_mentions part on this endpoint for that tweet? https://dev.twitter.com/rest/reference/get/statuses/show/%3Aid


#3

Yes:

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

#4

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.


#5

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

Thanks!


#6

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 https://dev.twitter.com/rest/public/search to try and find the tweets a different way though, maybe combining the to:NASA and @NASA examples.


#7

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.