How to restore Twitter share counts

Chris A. Williams
Journalism, Deliberated
2 min readDec 16, 2015

Twitter recently turned off share counts, after announcing the demise of the popular feature on October 6th. Luckily, with a bit of programming, you can use the Twitter Search API to track shares for new articles.

The search API lets you use a URL as a search term. It’s my favorite feature, and the basis of my personal project, currently in alpha: http://quoted.news

Important details:

  1. The Twitter Search API is limited to results from roughly the past 7 days. So if your article is more than 6 days old, this method will not provide an accurate number of tweets. Sorry, those are gone.
  2. The URL needs to be as generic as possible, which basically means as short as possible. Remove cruft such as tracking information, which generally follows a “?” or “#” character. Here on Medium, a text string is added after a “#” in the URL that you need to remove. Usually you need to look for a “?” mark. For instance, from the New York Times homepage, a link I clicked on added “?action=click&pgtype=Homepage&clickSource=story-heading” to the URL after the “.html” Remove it. However, don’t remove something like “?id=12345”! In that case, remove everything beginning with the first “&” character.
  3. Using the search API means the counts will not be live. Figure out how often you want them updated. Twitter gives you 180 searches every 15 minutes. Each search returns up to one hundred results. A low-publishing site could update all of their links every fifteen minutes. High-publishing sites will need to prioritize.

For quoted.news, I search Twitter for roughly 2,500 new articles per day. It’s always a few hours behind. An article with a lot of tweets will be searched for more frequently than one with only a few tweets. Once a search returns zero new tweets it is not searched again for three days. The system generally catches up overnight and gives a good overview of the previous day.

I hope this is useful!

--

--