{"id":5758,"date":"2025-09-05T13:50:20","date_gmt":"2025-09-05T13:50:20","guid":{"rendered":"https:\/\/www.wizbrand.com\/tutorials\/?p=5758"},"modified":"2025-09-05T13:56:22","modified_gmt":"2025-09-05T13:56:22","slug":"how-to-fetch-facebook-page-info-on-your-websites","status":"publish","type":"post","link":"https:\/\/www.wizbrand.com\/tutorials\/how-to-fetch-facebook-page-info-on-your-websites\/","title":{"rendered":"How to Fetch Facebook page info on your websites"},"content":{"rendered":"\n<p>Here\u2019s a clean, end-to-end path to make Wizbrand fetch Page likes\/followers\/posts <strong>legally via Meta\u2019s Graph API<\/strong> for each customer.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step-by-step plan<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 0 \u2014 Decide scope &amp; rules<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Data you\u2019ll show:<\/strong> public page info, latest posts, reactions\/comments counts, follower\/like counts, and selected <strong>Page Insights<\/strong> (requires permission).<\/li>\n\n\n\n<li><strong>Compliance choice:<\/strong> <strong>No scraping.<\/strong> Only Graph API. Customers must connect their Page and grant permissions.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 1 \u2014 Create &amp; configure the Meta app<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li><strong>Create app:<\/strong> In Meta for Developers \u2192 Create App \u2192 choose <strong>Manage everything on your Page<\/strong> (Pages API) and add <strong>Facebook Login<\/strong>.<\/li>\n\n\n\n<li><strong>Business assets ready:<\/strong> Public <strong>Privacy Policy URL<\/strong>, <strong>Terms URL<\/strong>, <strong>User Data Deletion<\/strong> instructions\/page, a support email, app icon, and your <strong>App Domains<\/strong> (wizbrand.com etc.).<\/li>\n\n\n\n<li><strong>Business verification:<\/strong> In <strong>Business Settings<\/strong>, complete <strong>Business Verification<\/strong> (you\u2019ll need docs + domain verification). This is required for most Page permissions.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 2 \u2014 Implement customer connect (OAuth) flow<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li><strong>Facebook Login setup:<\/strong> Add valid OAuth redirect URIs (e.g., <code>https:\/\/wizbrand.com\/oauth\/facebook\/callback<\/code>).<\/li>\n\n\n\n<li><strong>Scopes (permissions) you\u2019ll request from each customer:<\/strong><ul><li><code>pages_show_list<\/code> (let user pick which Page)<\/li><li><code>pages_read_engagement<\/code> (read posts, comments, reactions &amp; basic metadata)<\/li><li><code>pages_read_user_content<\/code> (read UGC on the Page)<\/li><li><code>read_insights<\/code> (Page Insights metrics like fans, reach, engagement)<\/li><li><code>pages_manage_metadata<\/code> (to subscribe your app to Page webhooks; optional but recommended)<\/li><\/ul>If you also plan to publish content later, add <code>pages_manage_posts<\/code> (not needed for read-only).<\/li>\n\n\n\n<li><strong>Token flow in code:<\/strong>\n<ul class=\"wp-block-list\">\n<li>User clicks <strong>Connect Facebook Page<\/strong> in Wizbrand.<\/li>\n\n\n\n<li>Redirect to Facebook Login with scopes above.<\/li>\n\n\n\n<li>On callback, you receive a <strong>short-lived User Access Token<\/strong> \u2192 exchange for <strong>long-lived User Token<\/strong>.<\/li>\n\n\n\n<li>Use the long-lived User Token to call <code>\/{user-id}\/accounts<\/code> to list Pages the user manages.<\/li>\n\n\n\n<li>User selects one or more Pages \u2192 for each Page, store the <strong>Page ID<\/strong> and <strong>Page Access Token<\/strong> returned for that page.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Tip: If a customer only gives a Page URL, your UI should still require them to connect &amp; authorize; do not attempt to \u201clook up\u201d data without permission.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 3 \u2014 App Review (before going Live)<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"9\">\n<li><strong>Prepare review:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Add screencast showing your exact user flow (how user connects a Page, what you fetch, where you show it).<\/li>\n\n\n\n<li>Explain why you need each permission and show only Page-level, non-personal data in the demo.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Submit for:<\/strong><code>pages_show_list<\/code>, <code>pages_read_engagement<\/code>, <code>pages_read_user_content<\/code>, <code>read_insights<\/code>, <code>pages_manage_metadata<\/code>.\n<ul class=\"wp-block-list\">\n<li>Optional: <strong>Page Public Content Access<\/strong> <em>only<\/em> if you need to read <strong>public posts from Pages you don\u2019t manage<\/strong> (this does <strong>not<\/strong> grant insights\/likes).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Test users &amp; testers:<\/strong> Add them so reviewers can log in and see your flow.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 4 \u2014 Fetching data the right way<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"12\">\n<li><strong>Store securely (multi-tenant):<\/strong> For each org\/customer in Wizbrand, store <strong>Page ID<\/strong> + <strong>Page Access Token<\/strong> encrypted (KMS\/HashiCorp Vault\/etc.). Track <code>expires_at<\/code> if present.<\/li>\n\n\n\n<li><strong>Core reads (examples; fields vary by API version &amp; permissions):<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Basic profile\/metrics<\/strong><br><code>GET \/{page-id}?fields=name,link,about,fan_count,followers_count,category<\/code><br><em>(fan\/followers fields may require insights\/engagement permissions and can vary by version)<\/em><\/li>\n\n\n\n<li><strong>Recent posts (with counts)<\/strong><br><code>GET \/{page-id}\/posts?fields=id,created_time,message,permalink_url,reactions.summary(true).limit(0),comments.summary(true).limit(0),attachments{type,url}<\/code><br>Use paging (<code>after<\/code> cursors) to iterate.<\/li>\n\n\n\n<li><strong>Insights (daily)<\/strong><br><code>GET \/{page-id}\/insights?metric=page_fans,page_follows,page_posts_impressions,page_engaged_users&amp;period=day<\/code><br>Cache and aggregate for charts.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"14\">\n<li><strong>Rate limits &amp; scheduling:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Queue background jobs per Page; stagger calls; cache results (e.g., refresh posts hourly, insights daily).<\/li>\n\n\n\n<li>Use <code>If-None-Match<\/code>\/<code>ETag<\/code> or <code>since<\/code> params where supported to reduce calls.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"15\">\n<li><strong>Webhooks (recommended):<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add a verify endpoint in Wizbrand (https, fixed path).<\/li>\n\n\n\n<li>In App Dashboard \u2192 Webhooks \u2192 subscribe to <strong>Page<\/strong>.<\/li>\n\n\n\n<li>When a Page is connected, call <code>POST \/{page-id}\/subscribed_apps<\/code> with <code>subscribed_fields=feed<\/code> (requires <code>pages_manage_metadata<\/code>).<br>Now you\u2019ll get push updates for new posts\/comments and can refresh just-in-time.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 5 \u2014 Token lifecycle &amp; re-auth<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"16\">\n<li><strong>Long-lived tokens:<\/strong> Always exchange user token for long-lived; derive Page token each connect. Some Page tokens can be long-lived; still handle invalidation.<\/li>\n\n\n\n<li><strong>Re-connect UX:<\/strong> If token expires\/permissions change, show a <strong>Reconnect Facebook<\/strong> banner for that Page.<\/li>\n\n\n\n<li><strong>Disconnect UX:<\/strong> Provide <strong>Disconnect<\/strong> button \u2192 delete stored token and unsubscribe app from the Page.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 6 \u2014 Productization &amp; compliance<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"19\">\n<li><strong>UI\/UX in Wizbrand:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u201cConnect Facebook Page\u201d CTA.<\/li>\n\n\n\n<li>Page picker (multi-select), per-page status (Connected \/ Needs reconnect).<\/li>\n\n\n\n<li>Dashboards: Posts table, Reactions\/Comments counts, Insights charts, Follower\/Likes counters (with \u201clast synced\u201d).<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"20\">\n<li><strong>Data governance:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only store what you need, encrypt at rest, restrict access by tenant.<\/li>\n\n\n\n<li>Honor <strong>Data Deletion<\/strong> (self-serve button + documented endpoint).<\/li>\n\n\n\n<li>Add clear copy explaining you never post or DM; read-only access.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"21\">\n<li><strong>Go Live:<\/strong> After approvals, switch app to <strong>Live Mode<\/strong>. Ensure your Privacy Policy\/Deletion pages remain accessible.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">(Optional) Public pages you don\u2019t manage<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"22\">\n<li>If you must display <strong>public posts<\/strong> from Pages that didn\u2019t connect to Wizbrand: apply for <strong>Page Public Content Access<\/strong>.<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This <strong>won\u2019t<\/strong> give you insights or follower\/like counts. For that, you still need the Page admin to connect.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Minimal endpoint cheat-sheet (reference)<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>List managed pages: <code>GET \/{user-id}\/accounts<\/code><\/li>\n\n\n\n<li>Page profile\/metrics: <code>GET \/{page-id}?fields=...<\/code><\/li>\n\n\n\n<li>Posts: <code>GET \/{page-id}\/posts?fields=...<\/code><\/li>\n\n\n\n<li>Insights: <code>GET \/{page-id}\/insights?metric=...&amp;period=day<\/code><\/li>\n\n\n\n<li>Subscribe app to page (webhooks): <code>POST \/{page-id}\/subscribed_apps<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Quick success checklist<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>App created with <strong>Manage everything on your Page<\/strong> + <strong>Facebook Login<\/strong><\/li>\n\n\n\n<li>Business verified + domain verified<\/li>\n\n\n\n<li>OAuth redirect URIs set<\/li>\n\n\n\n<li>Permissions requested: <code>pages_show_list<\/code>, <code>pages_read_engagement<\/code>, <code>pages_read_user_content<\/code>, <code>read_insights<\/code>, (<code>pages_manage_metadata<\/code> for webhooks)<\/li>\n\n\n\n<li>App Review demo recorded<\/li>\n\n\n\n<li>Token exchange coded; Page tokens stored securely per tenant<\/li>\n\n\n\n<li>Background sync jobs + caching + rate limiting<\/li>\n\n\n\n<li>Webhooks wired for <code>feed<\/code><\/li>\n\n\n\n<li>Data deletion + privacy policy live<\/li>\n\n\n\n<li>Live Mode enabled after approval<\/li>\n<\/ul>\n\n\n\n<p>If you want, I can generate a tiny \u201cconnect flow\u201d sample (Node\/Laravel) showing the exact OAuth URLs, token exchange, and the three API calls you\u2019ll need for posts, insights, and follower counts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here\u2019s a clean, end-to-end path to make Wizbrand fetch Page likes\/followers\/posts legally via Meta\u2019s Graph API for each customer. Step-by-step [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5758","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/posts\/5758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/comments?post=5758"}],"version-history":[{"count":2,"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/posts\/5758\/revisions"}],"predecessor-version":[{"id":5760,"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/posts\/5758\/revisions\/5760"}],"wp:attachment":[{"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/media?parent=5758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/categories?post=5758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wizbrand.com\/tutorials\/wp-json\/wp\/v2\/tags?post=5758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}