I crawled some Tweets with R using the Twitter API. Now I am looking at the data and some of the Tweets have either a Tweet_id or user_id looking like this 5.03453238356772e-223
. This doesn’t allow me to look for the respective screen_name. Anyone who knows how I could look up the screen name with a user oder tweet_id looking like this? Is it possible to convert it, to a more ‘normal’ format, like 49616273
?
Question posted in Twitter API
The official Twitter API documentation can be found here.
The official Twitter API documentation can be found here.
2
Answers
From the Twitter API documentation:
And as far as I know, it can be the case with R.
So if you are using the V1.1 API, use the
id_str
field instead of theid
field, and if you are using the V2 API (or were already using theid_str
field), store it as a string and do not cast it to int.I expect that what has happened here is that something (maybe a spreadsheet program?) is mangling the Tweet and User IDs. These are 64-bit large integers. The Twitter API returns these values as strings, to avoid anything reformatting them. You’ll need to go back and get the data again, and save the values in a format where the number is not converted to another format.