Hello, I am using the API to populate some data on each tweet such as number of retweets, likes, replies, quotes but am getting really strange information back.

We have made a request to /2/tweets/search/recent?query=%23test&max_results=100&tweet.fields=created_at,public_metrics&expansions=author_id&start_time=2021-01-06T02:49:14Z
and received the tweets, but the public_metrics fields are with wrong values (except for the number of retweets).

Strangly, When the number of retweets was 0, the other public_metrics fields had the correct values when we checked on the site.

Has anyone come across this, or a possible solution.

We were using V1.1 of the API but were unable to get the total replies so we moved to V2 but now having this issue.

Thanks

Do you have an example of where the values are wrong? Like tweet IDs: What values did you get from the API and how are they different on the site?

1 Like

Sure.

We are using a google sheet temporarily to check the data,

As you can see from the following image. most entries have zero values. Mostly in this case because they are actually zero. But an example here is row 4 and row 7.

[Row 4] = twittecom/i/web/status/1346922595484979200 (had 2 quotes + 65 likes)
[Row 7] = twittercom/i/web/status/1346922138075357185 (had 15 likes)

(Sorry, I am not sire how you get around posting links)

These clearly are producing different values to what are in the tweet and this seems to be happening with almost all entries.

We have had the search go back to over 6 hours and the results do not improve much.

Are you sure these are not new interactions made in the time between retrieving them and you viewing them on the web?

No because I pulled the information and then checked instantly. It is just displaying zero, and even when we call the API again a second time, it still shows zero for Likes, Replies, Quotes.

I assume you are not having the same problem?

I did notice there’s a delay between tweets being sent, and tweets being available in v2 so i assume it’s the same thing - that the API is not consistent.