Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A command-line and programmatic interface to various social sharecount endpoints.

Project Description

A command-line utility and Python library to access the social share counts for a particular URL.

Note: unfortunately this utility can no longer be used to fetch tweet and retweet counts, as Twitter has removed the API this functionality relied on. Facebook and other platforms still work.


  socialshares <url> [<platforms>...] [options]

  -h, --help  Show this screen.
  -p, --plain  Plain output.
  -r <attempts>, --retry <attempts>  Retry fetching up to <attempt> times [default: 1]
  -e, --exit  Exit with an error code when not all counts could be fetched.

Some examples:

# fetch count for all supported platforms,
# try again once (the default) for platforms that fail
$ socialshares

# fetch only facebook
$ socialshares facebook     --retry 2

Supported platforms

Platform Description
facebook facebook shares and comments
linkedin linkedin shares
google google +1’s
pinterest pinterest pins
reddit reddit ups and downs (summed across posts)

Platforms are fetched in parallel and retried (once by default.) If no platforms are specified, just facebook and twitter will be returned.

Unsupported platforms

The following APIs unfortunately no longer exist, and have been removed from the interface.

Platform Description
twitter twitter tweets and retweets containing the URL
facebookfql facebook likes, shares and comments


By default, socialshares outputs JSON:

  "reddit": {
    "downs": 0,
    "ups": 6
  "google": 20,
  "facebook": 1498,
  "twitter": 300,
  "pinterest": 1

Use the --plain flag if instead you’d like space-separated output.

$ socialshares twitter

Usage from Python

import socialshares
counts = socialshares.fetch(url, ['facebook', 'pinterest'])


pip install socialshares
# optionally, for asynchronous fetching
pip install grequests

If requests_futures and (for Python 2.x) futures are installed, social-shares will use these packages to speed up share count fetching, by accessing the various social media APIs in parallel.

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
socialshares-1.1.0.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source Sep 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting