Some retweeter requests give me a 34 error. Some do not. No pattern


#1

Please note: This is different from a previous topic of mine (“Getting 34 error after requesting retweeter IDs…”).

I’m trying to get the retweeters of each tweet from a small list of tweets, using the statuses/retweeters/ids REST API call. What’s really strange is that the responses for a few specific tweets always give me a 34 error, while most do not.

Does this mean that, for each of the tweets that result in a 34 error response, one of the retweeters is ‘protected’? If so, why can’t I see the other retweeters of that tweet?

Otherwise, I can’t seem to find any rhyme or reason to why some of the retweeter requests end up with 34 errors, while most do not. :frowning: – Any help would be much appreciated!

Thanks in advance.

-JC


#2

Got an example tweet id where this error occurs when you think it shouldn’t?


#3

Here you go, Igor: 6.786367e+17

So I’m essentially making the following GET request: https://api.twitter.com/1.1/statuses/retweeters/ids.json?count=100&stringify_ids=true&id=6.786367e+17

…with the appropriate token/authorization, of course.

Any help/clues would be appreciated!

-JC


#4

You need to use id_str instead of id. 6.786367e+17 is not a valid id and your language doesn’t support integers that big.


#5

Thanks, @abraham. Hmm. Just tried that, but it now gave me a ‘bad request’ error (214). Should I be converting to non-scientific before making this request?


#6

Eh, I just disabled scientific notation, and that didn’t work, either. Anyways, if you guys have any other suggestions, please let me know.

Hope you’re having a good morning.

-Jude


#7

The IDs should never be converted to scientific notation. Or any number format (unless you explicitly know your language supports enough bits in integers). You can read more about Twitter IDs.

Basically IDs should always look like "669077021138493440".


#8

Ok, well, like I said, converting to non-scientific didn’t work after all (btw, my language fully supports that many bits in integers; I’m using R). Please let me know if you have any other ideas.


#9

I don’t think converting to scientific notation will work. If it’s in SN to begin with it’s already lost the precision. What you need to do is output the ID in debug mode and make sure it matches exactly the ID you see in the URL of twitter.com while viewing that tweet.


#10

Eh, having it non-SN from the outset didn’t fix this, BUT it seems to have fixed another, unrelated problem (looping through list by max ids). Thanks, Abraham. If I encounter other clues on this one I’ll let you know.

-JC


#11

VERY strange. It’s definitely a precision problem, because I changed the final digit of that sample tweet ID, and everything works. HOWEVER, from the outset, I’m not in scientific notation mode, and I’m still getting the wrong tweet ID by one digit. :frowning: – Any ideas? It seems like the response I’m getting is actually off by one, because it’s non-SN from the outset, and I’m not changing anything.


#12

You probably need to change the type used.


#13

Found the problem. Type was fine, …but I had ignorantly changed the id string to numeric data type, for no good reason, somewhere in my app. :-\

Thanks, @abraham, for all your help!

-Jude