我正在尝试使用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,实体,地理位置,id,referenced_tweets,in_reply_to_user_id,语言,possibly_sensitive,源,文本,withheld&place.fields=country,full_name&user.fields=created_at,描述,位置,名称,pinned_tweet_id,用户名,已验证,保留
发布于 2021-02-26 02:34:17
好的,我从推特的规则和过滤操作符中找到了下面的链接:https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product
我只需要在我的查询字段中添加和否定is:retweet operaor。例如: query=(MMIW或MMIP或MMIWG) -is:retweet So,我修改后的端点:
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,possibly_sensitive,source,text,withheld,in_reply_to_user_id,referenced_tweets&place.fields=country,country_code,full_name,geo,id,name&query=(MMIW或MMIP或MMIWG) -is:retweet&user.fields=created_at,描述,位置,名称,pinned_tweet_id,用户名,已验证
https://stackoverflow.com/questions/66344129
复制相似问题