PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] How to get attending guests count from event using FB Graph API?

 February 11, 2022     facebook, facebook-graph-api, facebook-javascript-sdk, facebook-php-sdk     No comments   

Issue

I would like to get attending guests count from event using Facebook Graph API v2.1. I can't use FQL Query becouse it is deprecated after current version.

I can use /{event-id}/attending and sum all guests but this solution is very ineffective (queries are performed for a long time - usually >2000ms and it work only for ~1000 guests, not more).


Solution

If you make a call to the Event ID itself, you can add fields for attending_count, declined_count and maybe_count to get the totals easily.

Example:

https://graph.facebook.com/{event_id}?fields=attending_count,declined_count,maybe_count

If I do the following:

https://graph.facebook.com/468185256651918?fields=attending_count,declined_count,maybe_count

I see:

{
  "attending_count": 304, 
  "declined_count": 277, 
  "maybe_count": 97, 
  "start_time": "2014-09-06T20:00:00+0100", 
  "id": "468185256651918"
}


Answered By - Niraj Shah
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing