Skip to content
"Likes" counter of facebook page
CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


"Likes" counter of facebook page.

screen shot


cd <your MagicMirror Directory>/modules
git clone

To Get FACEBOOK Access Token (Ref. from StackOverflow )

0. Create Facebook App

** You should be an owner of facebook page or should have a permission to manage target page. **

If you already have an app, skip to step 1.

  1. Go to facebook developer page
  2. Click "Add a new App"
  3. Setup your app. (detail is not important. just make one.)
  4. After creation, see the detail app information. You can find App ID and App Secret Code.
  5. Remember App ID and App Secret (Copy them to any memo program)

1. Get Short-lived Access Token

  1. Go to Graph API Explorer
  2. Select the application you want to get the access token for (in the "Application" drop-down menu, not the "My Apps" menu).
  3. Click "Get Token" > "Get User Access Token".
  4. In the pop-up, under the "Extended Permissions" tab, check "manage_pages".
  5. Click "Get Access Token".
  6. Grant access from a Facebook account that has access to manage the target page.
  7. Remember Access token string (copy it to any memo program).

2. Generate Long-Lived Access Token

  1. Open any browser and navigate to this URL:{app_id}&client_secret={app_secret}&fb_exchange_token={short_lived_token}

You can get some TEXT or JSON string. The value of access_token is new Long-Lived Access Token, but not permanent. (It will expire after 2 month.) So you should get a permanent access token.

3. Get User ID

  1. Open a browser and try this.{long_lived_access_token}

Now you get id. Let's go further.

4. Get Permanent Page Access Token

  1. Open a browser and try this.{account_id}/accounts?access_token={long_lived_access_token}

You can get some JSON string. The JSON response should have a data field under which is an array of items the user has access to. Find the item for the page you want the permanent access token from. The access_token field should have your permanent access token.


Now you have Page ID and Permanent Page Access Token for your target page.

    module: "MMM-fbPageCounter",
    config: {
        access_token: "<your Permanent Page Access Token>",
    	page_id: "<your target Page ID>",
      	refresh_interval_sec: 30,
field description
access_token Your facebook page access token for target page.
page_id Your facebook page ID
refresh_interval_sec minimum 10(sec)
If your page has few visitors(under 5 visitors daily), use 30 or 60 as this filed. Or you could get API rate limit.
Over 5 visitors daily, you can use this minimum 10.
size default:default
default, small, huge are available values


Thanks to Chris Nanney, who create CSS-Flip-Counter

You can’t perform that action at this time.