No results from statuses/user_timeline for a particular user (used to work)


#1

I have a basic app set up to allow access to query my client’s timeline to display their most recent tweets, via the following:
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" . $screenname . "&count=2&include_rts=false&exclude_replies=true

But as of today (and probably a bit sooner before it was noticed) that user’s screen name is no longer returning ANY results via the API request. I just get an empty array back as the result - no error message. Is it possible that screen names have their own rate limits or can be blocked from API access in some way? This was working fine with this screen name recently but now I get no results no matter what I try for this screen name. If I try literally any other screen name (I’ve tried dozens randomly just to test), I get expected user_timeline results.

I’ve tried turning off the include_rts=false, tried increasing the count, and verified that there are, in fact, recent tweets to be shown. This user is not private/protected. My app isn’t hitting a rate limit. I even tried the same API request from a different App, but get the same results - empty array for this screen name, expected results for anything else.

It seems to be just this particular screen name. Anybody run into anything similar or have any ideas?


#2

Are you able to try the same API call with the user ID instead of the screen name?

Is there an HTTP error code in the response?

Is there anything unusual about the screen name itself? can you share which one it is? does the timeline show up OK on the web?


#3

Andy, thanks for the reply.

I get the same result (empty array) when I attempt the query with the user_id instead of the screen_name:
https://api.twitter.com/1.1/statuses/user_timeline.json?user_id=

There is nothing unusual about the screen name - it’s all lowercase letters in the normal alphabet - no emojis or special characters or anything weird. I’m trying to avoid sharing it just to keep my client’s anonymity. But if you absolutely need it to diagnose let me know. Their timeline shows up without any issue when accessed via the web/twitter clients/etc.

Forgive my ignorance, I’m aware of checking for api errors in the response:
{“errors”:[{“message”:“Sorry, that page does not exist”,“code”:34}]}
But how do I check for potential HTTP error codes in the response?

Right now, all I get when I print_r() the API response I’m getting is a completely empty array:

Array ( )

#4

Also, the screen name in question is a verified account. Not sure if that changes things or not.


#5

Seems like my initial response to you Andy may have disappeared into the moderation ether…


#6

Trying again:

  • I get the same result (empty array as the response) when I try the API call with the user ID instead of the screen name.

  • I get 200 back as the HTTP code, so there don’t seem to be any HTTP errors.

  • Screen name is: “mallofamerica” - nothing unusual about it. It’s been around for several years. Contains only lowercase letters. Is a verified account. Their timeline shows up fine via the web, native twitter clients, etc. Only issue seems to be via the API.


#7

Figured it out. My query was trying to exclude retweets and replies, but they had so many recently that nothing was being returned result-wise without increasing the count number really high,

&count=2&include_rts=false&exclude_replies=true | returned nothing
&count=50&include_rts=false&exclude_replies=true | returned nothing
&count=100&include_rts=false&exclude_replies=true | returns first-party tweets as expected

Would be nice if count was actually only counting the tweets you say you want, rather than the stream as a whole before the exclusions, but I realize that’s not how the API works. Maybe someday…


#8

OK cool that you figured it out - my next step would otherwise have been to ask you to email me details - thanks for the feedback on the API too (and sorry it took me a while to check back!)