Post

2 followers Follow
0
Avatar

Extracting Twitter Historical Data

Hi,

I need an optimal query to fetch 10 days twitter data(mentions,tweets,re tweets et..) for 300 users. Please some one provide and CSDL code which will results low DPU cost.

I wrote the below code....

interaction.author.id in [id1,id2,........id300]

Thanks in advance.......

madhu g

Please sign in to leave a comment.

3 comments

1
Avatar
interaction.author.id in [id1,id2,........id300]

will return only Tweets and retweets created by the users with the specified IDs. If you are also looking for mentions of those users in Tweets and retweets, you should consider the following:

interaction.author.id in [id1,id2,........id300] OR
interaction.mention_ids in [id1,id2,........id300]
Jason D. 1 vote
Comment actions Permalink
0
Avatar

Hi Jason,

Thanks you very much for your quick response.

I have a few more queries:

1.Is this is an optimal query?
2. I need the whole twitter data for last 30 days, so do i need to add any date filters in the code if yes tell me how to do?
3. If I want to do same based on twitter username then how to proceed further with CSDL code?

madhu g 0 votes
Comment actions Permalink
0
Avatar

1.Is this is an optimal query?
Yes - it optimal. Take a look at some of our CSDL optimization documentation and blog posts for more information on how to optimize your CSDL:
- CSDL Optimization Techniques blog post (old, but still relevant)
- CSDL Optimization documentation

2. I need the whole twitter data for last 30 days, so do i need to add any date filters in the code if yes tell me how to do?
When running Historics queries, you specify the timeframe when preparing the query, not in the CSDL. See the /historics/prepare endpoint documentation, or our Historics user guide for more information.

3. If I want to do same based on twitter username then how to proceed further with CSDL code?
You can use targets such as interaction.author.username and interaction.mentions instead of the previously mentioned targets. All targets you can filter on are fully documented in our targets list.

Jason D. 0 votes
Comment actions Permalink