the users api is not returning the proper follower count(it randomly returning 50-100 etc while the original count is 11.5M), this happens only in our AKS (Azure kubernetes cluster) cluster IPS and is working fine locally…

curl --location --request GET 
'https://api.twitter.com/1.1/users/show.json?screen_name=MeekMill' \
--header 'Authorization: Bearer XXXXXX'

response

{"id":20567939,"id_str":"20567939","name":"MeekMill","screen_name":"MeekMill","location":"Killadelphia","profile_location":null,"description":"I just wanna see the sun shine tomorrow @dreamchasers #hustler","url":"https:\/\/t.co\/QZDzse4qdU","entities":{"url":{"urls":[{"url":"https:\/\/t.co\/QZDzse4qdU","expanded_url":"http:\/\/MeekMill.lnk.to\/TooMuchMotionEp1","display_url":"MeekMill.lnk.to\/TooMuchMotionE\u2026","indices":[0,23]}]},"description":{"urls":[]}},"protected":false,
"followers_count":57,"friends_count":1490,"listed_count":8764,"created_at":"Wed Feb 11 03:15:04 +0000 2009","favourites_count":1416,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":true,"statuses_count":17855,"lang":null,"status":{"created_at":"Tue Jan 24 01:07:39 +0000 2023","id":1617690560776785921,"id_str":"1617690560776785921","text":"@ShaunG my merchandise business doing well I need a head designer \u2728\u2728\u2728\u2728\u2728\u2728\u2728\u2728\u2728\u2728\u2728\u2728","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"ShaunG","name":"Shaun G","id":346763751,"id_str":"346763751","indices":[0,7]}],"urls":[]},"source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":346763751,"in_reply_to_user_id_str":"346763751","in_reply_to_screen_name":"ShaunG","geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":8,"favorite_count":105,"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":true,"profile_background_color":"131516","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme14\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme14\/bg.gif","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/1488755792081833986\/RNwmrPA__normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/1488755792081833986\/RNwmrPA__normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/20567939\/1631734047","profile_link_color":"009999","profile_sidebar_border_color":"EEEEEE","profile_sidebar_fill_color":"EFEFEF","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null,"translator_type":"none","withheld_in_countries":[]}root@api-staging-deployment-6fc5466d67-8phwv:/home/api# 

Multiple data centers can return different results at times, and will eventually have the same number (eventual consistency).
May reasons could be for this: growth, user was login challenged and lost their follower count, or even bug in loading code.
That’s why you will see one center is different than the other, but eventually it will be the same.

1 Like

No it is not same, whenever I try to get the follower count for the above user the is always different and very low like 20-100 but I can get the follower count as 11M from my local machine.I am not sure why twitter send different responses if the request is coming from azure virtual machines.

1 Like

Hmmm it is strange that you get this until now. I just tried this same account myself locally and from Azure (US east), and got the 11M count.
It could be that you are hitting a faulty data center? Which region in Azure are you using? Do you get the same result if you change regions?

1 Like

we are using US west, no we are only allowed to run from this region.
so changing region is not an option for us.

1 Like

I understand. But I was wondering if you can run your code from an instance in a different region just for testing to see if this is datacenter related, or something wrong in your code (though seeing you posted json result, I don’t see how that could be)
You can also use postman from the same production IP (or region) to see if you get the same json result

yes just tested, it seems only happening with the us west region…not sure why twitter sends response different based on the region of client.

1 Like

They have different data centers, each center responds to requests coming from different locations.
You can ping the dns to see if you have different ip addresses when you do it from azure east US and west US, most likely the one giving faulty results responds to calls from west region

1 Like

you mean twitter has different data centers, right?
I will try to find the twitter ips

1 Like

the ips seems changing, not consistent…

Yes, they are IP ranges, not individual IP.
So look at the location of the IP, and the ranges. Here

and here

Though I believe one data center was shutdown recently, so not exactly sure which range that falls under, and if these lists were updated accordingly

1 Like

yes but I am not sure how can we fix this our side as we can not change region…
I assume it is likely twitter side it needs to be fixed their faulty data center.

1 Like

If the bug is not in your code then obviously you cannot fix it.
But the more troubleshooting info you provide, and a workflow that can be consistently reproduced, then hopefully they will look at the issue and investigate.

1 Like

yes, I would like someone from twitter look into it.

1 Like

To be honest, they are super busy, there are far bigger issues on the platform that they need to look into.
So the more specific steps you can provide, the more likely it will not be ignored.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.