无法使用 tweepy.Client 检索 public 指标

Unable to retrieve public metrics using tweepy.Client

我不知道这是怎么回事,但我正在尝试通过用户名获取用户信息,并使用 tweepy 从 Twitter API 中包含他们的 public_metrics。

这是我的代码:

import tweepy
BEARER_TOKEN = 'a 100% real API secret publicly posted on SO'
tweepyClient = tweepy.Client(BEARER_TOKEN)
response = tweepyClient.get_users(usernames=['ThreatLevelGG', 'Twitter', 'TwitterDev'], user_fields=['public_metrics'])

但是,它只返回默认信息:

我是不是愚蠢地漏掉了一些简单的东西,还是 tweepy 很烂?

来自relevant FAQ section in Tweepy's documentation about this

If you are simply printing the objects and looking at that output, the string representations of API v2 models/objects only include the default attributes that are guaranteed to exist.

The objects themselves still include the relevant data, which you can access as attributes or by key, like a dictionary.