微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何从 Twitter API 完整存档搜索中排除转推和回复

如何解决如何从 Twitter API 完整存档搜索中排除转推和回复

我正在尝试使用 twitter API 提取一些历史推文。我想排除转推和回复。我在这里尝试了其他建议的答案,但似乎没有任何效果。有人可以帮助我吗,我一周以来一直在努力寻找资源。以下是我的完整档案搜索端点。

https://api.twitter.com/2/tweets/search/all?query=MMIW 或 MMIP 或 MMIWG&start_time=2015-01-01T00:00:01Z&end_time=2015-01-15T23:59:01Z&max_results=500&tweet.fields=created_at,entities,geo,id_lang_user_reference,possably_sensitive,source,text,withheld&place.fields=country,full_name&user.fields=created_at,description,location,name,pinned_tweet_id,username,verified,withheld

解决方法

好的,所以我从下面的链接中从 twitter 的规则和过滤运算符中找出了: https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product

我只需要在我的查询字段中添加和否定 is:retweet 操作符。 例如:query=(MMIW OR MMIP OR MMIWG) -is:retweet 所以,我修改后的端点有效:

https://api.twitter.com/2/tweets/search/all?start_time=2015-01-01T00:00:01Z&end_time=2015-01-15T23:59:59Z&max_results=500&tweet.fields=created_at,entities,geo,id,lang,possably_sensitive,source,text,withheld,in_reply_to_user_id,referenced_tweets&place.fields=country,country_code,full_name,name&query=(MMIW OR MMIP OR MMIWG) -is:retweet&user.fields=created_at,de,位置,名称,pinned_tweet_id,用户名,已验证

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。