简体   繁体   English

从Python中的Twitter API获取历史推文元数据

[英]Get Historical Tweet Metadata from Twitter API in Python

I am doing a project where I want to build a model that estimates the number of retweets at a given time for a given tweet bearing a certain keyword, so that when a new tweet with the same keyword comes in, I can track its number of retweets and see if there is any anomaly. 我正在做一个项目,我想建立一个模型来估计带有特定关键字的给定推文在给定时间的推文数量,以便当带有相同关键字的新推文进入时,我可以跟踪其数量转推,看看是否有异常。 For that, on top of collecting a large number of tweets with that certain keyword for modeling, I need to know for each of the tweets what was the number of retweets on day 1, day 2, etc (the unit of time is arbitrary here, can be in days or in minutes) since it was created. 为此,除了收集带有该关键字的大量推文进行建模之外,我还需要为每个推文知道第1天,第2天等的转发数(此处的时间单位是任意的) ,可以在创建后的几天或几分钟内完成)。

I've done some research on stackoverflow, but I have not seen a solution for this particular problem. 我已经对stackoverflow进行了一些研究,但是还没有看到针对此特定问题的解决方案。 I understand that twitter API allows you to search for tweets with keywords, but it only gives you the tweets' current number of retweets but not the historical performance. 我知道twitter API允许您搜索带有关键字的tweet,但是它仅提供tweets的当前tweet数量,而不提供历史记录。

I would really appreciate it if anyone can point me to the right direction. 如果有人能指出正确的方向,我将不胜感激。 Thank you very much! 非常感谢你!

There's no API method in any of Twitter's API tiers (standard, premium or enterprise) that would enable you to do this. Twitter的任何API层(标准,高级或企业级)中都没有API方法可以使您做到这一点。 You'd need to have already been listening for the Tweets, record the Tweet IDs, check them every day for total engagement numbers, and then record the differential every day. 您需要已经在收听Tweet,记录Tweet ID,每天检查它们的总参与人数,然后每天记录差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM