Social counter API

For personal purpose, I need to know the number of followers, likes, subscribers, etc…

The examined social platforms are:

  1. Facebook (number of likes)
  2. Instagram (number of followers)
  3. Youtube (number of subscribers)
  4. Twitter (number of followers)

Let’s start.

Facebook – likes

https://graph.facebook.com/?ids=[URL_TO_ANALYZE]&fields=engagement&access_token=[TOKEN]

To use Facebook, you need to create a new app and use the generated token.

More on developer.facebook.com.

Instagram – Followers

https://www.instagram.com/dilettaleotta/?__a=1

Instagram is simple, you need to parse the returned Json. The field is called “edge_followed_by”.

Youtube – Subscribers

https://www.googleapis.com/youtube/v3/channels?part=statistics&id=[CHANNEL_ID]&fields=items/statistics/subscriberCount&key=[YOUR_KEY]

Same as Facebook, you need to register your new app and create a new Key.

More info here: console.cloud.google.com

Twitter – Followers

https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names=lupasca

Easy also for Twitter. Parse json and get values!

Field is called “followers_count”.

Enjoy.

 

Alberto Pasca

Software engineer @ Pirelli & C. S.p.A. with a strong passion for mobile  development, security, and connected things.