Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

355
Visualizações
Twitter API Javascript: How to count total number of likes and retweets a user has? If impossible due to rate limiting how else to measure engagement?

I'm trying to utilize Twitter API v2 in a javascript file to count how the average number of likes and retweets a user has per tweet. For example, if a user has 3 tweets, one has 5 likes, one has 6 likes, and one has 0 likes, I'd want a function to be able to return the average number of likes (3.67).

I'm finding the total number of tweets utilizing the following endpoint by extracting the status count from the object.

https://api.twitter.com/1.1/users/show.json?screen_name=${username}

How would I go about counting how many total likes a user has across their tweets? How would I go about counting the total number of times a user's tweets have been retweeted?

The closest thing I've found is the user tweet timeline endpoint, however it doesn't return how many likes and retweets each tweet in the timeline has.

https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets

I've considered looping through each tweet id in the timeline and calling the following endpoint to get the likes for each tweet, and then sum them. However, there's a rate limit of 50 calls per 15 minutes on this endpoint.

https://api.twitter.com/2/users/:id/likes

Is there any way to get the average number of likes and retweets a user has?

If not, would you have any suggestions of how else I could use the Twitter API to measure how much engagement a Twitter account has? I'm currently tracking number of followers and number of tweets, but I'd like to track engagement in other ways.

Thank you so much!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda