Get FeedBurner subscribers count using PHP

Write for Us: Familiar with Smart Home Automation, Media Streaming, HTPC, and Home Server topics? Write for us and get paid. Writing experience not required. APPLY HERE.

UPDATE (01/12/2013): This will no longer work because Google has shutdown FeedBurner API.


FeedBurner is a web feed management provider from Google. It provides custom RSS feeds and management tools to bloggers, podcasters, and other web-based content publishers. Recently, I wrote posts on how to get Facebook like count using PHP and Twitter followers count. Continuing along the same lines, in this post, I will explain how to get FeedBurner subscribers count using a simple PHP script. The number can be stored in cache or a database and displayed as simple formatted text or combined with other numbers to display a total followers/subscribers count thereby saving some much need sidebar-space. It also slightly improves page load speeds. So without further delay, here it goes.

Get Feedburner Subscribers Count
Feedburner Chicklet

PHP code to get FeedBurner Subscribers Count

The PHP script to get FeedBurner Subscribers count is pretty simple and straightforward:

$fburl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=http://feeds.feedburner.com/htpcBeginner";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $fburl);
$stored = curl_exec($ch);
curl_close($ch);
$grid = new SimpleXMLElement($stored);
$rsscount = $grid->feed->entry['circulation'];

$fburl is the variable to hold the link to access your FeedBurner API. Only edit you have to do is replace htpcBeginner with your account name. You can get it from your FeedBurner page:

Feedburner Myfeeds
Feedburner Myfeeds

After you get FeedBurner subscribers count, you can display it as simple text using the following PHP code:

echo $rsscount.' subscribers';

This will output 26 subscribers.

You can even get counts of your Facebook likes and Twitter followers and add them all together and display a combined followers count like this:

Combined Followers Subscribers Count
Combined Followers Subscribers Count

FeedBurner Subscribers Count History

Although you may be able to get FeedBurner subscribers count history and more by other means, I like to record the data in a format I like. I currently get Facebook like count, Twitter followers count, FeedBurner subscribers count, and Alexa site rank and record them in a MySQL database daily to see the growth of my blog. If you make any changes / improvements to your blog then you have the data to see what impact it had on your subscribers / followers count. In a separate post, I will explain how to accomplish this.

Meanwhile, get FeedBurner subscribers count using the above script, get creative, and find innovative ways to use the count. Please do not forget to share your idea with us in the comments sections.

Did this post help you?
SmartHomeBeginner brings in-depth tutorials easy enough to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
  • Feeling generous? Become a Sponsor (discounted options) or a Patron. You will receive privileges on our Discord Server.
  • Just want to thank us? Buy us a Coffee or a Ko-Fi.
  • May be another day? Shop on Amazon using our links. Your prices won't change but we get a small commission.
  • Don't feel like spending? You can still show your support by sharing this post, linking to it in forums, or even commenting below.

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.