Retrieve data for Favourites, retweets and replies based on a post id


#1

I need to use twitter api to retrieve data for favourites, retweets and replies for a given postid.
Can anyone please help So a to which endpoint can be used ?
Can it be done using Free API or a paid version needs to be used?


#2

Are you trying to find who liked or Retweeted a status? There’s no easy way to do that.

If you’re looking to get information on the numbers of likes, Retweets and replies, you can either use the premium search API (which contains additional quote_count and reply_count values on the Tweet objects); or, for even more comprehensive information, the enterprise Engagement API.


#3

No, I am not trying to find who liked or retweeted a status.

I want the number of Likes (i.e. favorites), Number of retweets and number of replies on a particular post based on a post id. I am trying to find a suitable endpoint where in I can pass post id as parameter and get number of favorites, retweets and replies in the output.

A sample suitable endpoint which i came accross was - https://api.twitter.com/1.1/statuses/lookup.json

To use this Endpoint - we pass comma seperated Post Ids as input

e.g. - Sample Get Request -
https://api.twitter.com/1.1/statuses/lookup.json?id=930249893125300229,930245014663323648

In the output response, I am able to fetch data for favorites count and retweets counts but i am not able to get any data for Replies count.

a part of sample output -

“contributors”: null,
“is_quote_status”: false,
“retweet_count”: 1,
“favorite_count”: 3,
Attached is the sample response screenshot from above endpoint.

So, now basically i need a endpoint through which - if i can get data for favorites count, retweets count and replies count by passing postid as a parameter.

Can anyone please help with this?

Looping - @NakulRingshia!
SampleJsonOutput|690x225


#4

There is no endpoint that provides exactly that function. The Tweet objects returned from the premium 30-day search or any of the enterprise APIs do provide that data, but you cannot query by Tweet ID.


#5

Thanks for your reply Andy!!

We did go through Enterprise API and found a suitable endpoint (https://data-api.twitter.com/insights/engagement/totals) to retrieve metrics data ( number of Likes (i.e. favorites), Number of re-tweets and number of replies) data based on Tweet Ids.

We have the following questions -

1)Can you please let us know what is the limit of calls that can be made to this endpoint?

  1. We have an approx count of 2700 tweets Ids for which we will fetch metrics data every day.
    Can you please let us know the approximate cost to use this Enterprise API ?

3)Once we signup for Enterprise API, will we be able to access all 3 endpoints - current totals, last 28 hours and historical ?

Thanks,
Ruchi


#6

You’ll need to discuss via our enterprise access team.


#7

Hi Andy,

We did apply for enterprise access. Our Product Manager - Tony Obregon applied for the enterprise access on ID - avanadeinc.

We were given access on enterpise API… but only for endpoints - 1) tweets - 30days and 2) Tweets - Full Archive (I have attached screenshot of the existing accessible endpoints).

We are actually aiming to use the endpoint - “Get Tweet Engagement” under Metrics section.
https://developer.twitter.com/en/docs/metrics/get-tweet-engagement/overview

Can you please guide us so as how we can access the above mentioned endpoint ?
Or what are the next steps involved ?


#8

The screenshot actually shows that you have access to the premium APIs for 30-day search and full-archive search in the sandbox.

The Engagement API is an enterprise level product and does not appear in the premium dashboard. You’ll need to talk to the commercial team for approval to access the Engagement API.


#9

Thanks for the reply Andy.

Can you please provide a suitable email address / POC with whom we can connect from commercial team for access to Engagement API.

Also, will it be fine if we directly connect with the POC or does our Product owner - Tony Obregon needs to connect with him/her.

I would like to reiterate that we would like to use the endpoint - “Get Tweet Engagement” under Metrics section.
https://developer.twitter.com/en/docs/metrics/get-tweet-engagement/overview

The main reason behind doing this is - that we would be able to request by tweet id.
The sample request in “Get Tweet Engagement” looks like -

Thanks in advance.


#10

Hi Andy,

Can you please help us with the above querry.

It would be great if you can provide us with a suitable contact from commercial team for approval to access the Engagement API.

Thanks,
Ruchi Shah