Using look_upsers doesn't get me account_created_at? What should I use?

Hi!
I have a list of user_id and I want the date of their creation using rtweet

I’d thought that lookp_users would get me the “account_created_at” of the users, but it doesn’t retrieve it.

Am I using an incorrect method?

Is twitteR best suited for this?

Is there any other library (for R or Python library) to get this info?
Hi! I’d thought that lookp_users would get me the “account_created_at” of the users, but it doesn’t retrieve it.

Am I using an incorrect method?

Is twitteR best suited for this?

Is there any other library (for R or Python library) to get this info?

Which version of rtweet are you using? Can you provide a minimal reproducible example of this?

1 Like

Hello, @llrs!

I’m using

> packageVersion("rtweet")
[1] ‘0.7.0’

I don’t know how to make a reproducible example for this.

df <- search_tweets(q = "query", 
                       n = 18000,
                       type = "recent",
                       include_rts = TRUE,
                       retryonratelimit = TRUE)

That function gives me the account_created_at column I need. Which tells me when an account was created if tweeted “query”.

But when I use

df_various-status_id <- lookup_tweets(list_of_status-id)

or

df_various-users_id <- lookup_users(list_of_users-id)

The account_created_at column is not present

That’s my main objective: I need to get the date when a a list of users_id was created.

@llrs I was just not looking good enough lol. I found out that it actually gives you that variable (account_created_at)

Im kind of a newbie. How would I write a code to iterate through user IDs so I can avoid the 15 minute reset the rate limit? I’ve got NO IDEA.

I see I cannot use retryonratelimit = TRUE to make this for me automatically.

Glad you found the column name. To provide a reproducible example you need to provide code and its results that proofs your claim. In your case it was enough with:

library("rtweet")
df <- lookup_users("rstatstweet")
"account_created_at" %in% colnames(df)
## TRUE

This would have shown that indeed the account_created_at colum is on the results of lookup_users as shown on the last line of the code.

There is no way around the wait of 15 minutes. That is a condition imposed by Twitter to control and limit how much data is extracted from the company.

However, if you look to download batches of data there is the research environment and the CRAN - Package academictwitteR to help you with it (I haven’t added support to this kind of interaction with Twitter on rtweet yet).

Good luck!

2 Likes