#
Facebook Graph API
Monitor your Facebook pages, posts, engagement metrics, and personal activity with AI-powered insights into your social media presence.
#
Overview
Connect Weavestream to Facebook to monitor:
For Personal Profiles:
- 📝 Your Posts - Your personal timeline posts
- 📸 Your Photos - Photos you've uploaded
- 👍 Your Likes - Pages and content you've liked
- 👥 Your Friends - Friend list (limited by privacy)
For Pages You Manage:
- 📄 Page Posts - All posts from your Facebook page
- 💬 Post Engagement - Likes, comments, shares on posts
- 📊 Page Insights - Reach, impressions, engagement metrics
- 📅 Scheduled Posts - Posts scheduled for future publication
- 💬 Comments - Comments on your page posts
- ⭐ Reviews - Reviews left on your page (if applicable)
- 📨 Messages - Page inbox messages (with appropriate permissions)
Estimated Setup Time: 15-20 minutes
#
Important: Personal Profile vs Page Access
Facebook Graph API has significant restrictions:
#
Personal Profile (Limited Access):
- ✅ Read your own posts, photos, likes
- ❌ Cannot read friends' posts or timelines
- ❌ Cannot read most personal profile data of others
- ❌ Very limited analytics
#
Facebook Pages (Full Access):
- ✅ Full control over page content
- ✅ Detailed analytics and insights
- ✅ All engagement metrics
- ✅ Scheduling and management features
- ✅ This is the recommended use case for Weavestream
Recommendation: Focus on Page monitoring for business/brand use. Personal profile access is very limited.
#
Prerequisites
- Facebook account
- Facebook Page (for full functionality)
- Page admin access (for page monitoring)
- Weavestream installed on your Mac
#
Part 1: Create Facebook App & Get Access Token
#
Step 1: Go to Facebook Developers
- Go to https://developers.facebook.com
- Sign in with your Facebook account
- Click "My Apps" (top right)
- Click "Create App"
#
Step 2: Choose App Type
Select app type based on your use case:
For Page Monitoring (Recommended):
- Select "Business" or "Other"
For Personal Profile (Limited):
- Select "Consumer" or "Other"
Click "Next"
#
Step 3: Configure App Details
Display Name:
Weavestream Monitor
App Contact Email:
your-email@example.com
App Purpose:
- Select "Yourself or your own business"
Click "Create App"
#
Step 4: Add Facebook Login Product
- On your app dashboard, find "Facebook Login"
- Click "Set Up" on Facebook Login
- Select "Web" as platform
- Site URL:
http://localhost:8080 - Click "Save"
#
Step 5: Configure OAuth Settings
- In left sidebar, click "Facebook Login" → "Settings"
- Under "Valid OAuth Redirect URIs", add:
http://localhost:8080/callback
- Click "Save Changes"
#
Step 6: Add Required Permissions
- In left sidebar, click "App Review" → "Permissions and Features"
- Request these permissions (click "Request Advanced Access"):
For Personal Profile:
user_posts- Read your postsuser_photos- Read your photosuser_likes- Read pages you've liked
For Page Monitoring (Recommended):
pages_show_list- List pages you managepages_read_engagement- Read page content and engagementpages_read_user_content- Read user-generated content on your pagepages_manage_posts- Manage page postsread_insights- Read page insights/analyticspages_messaging- Read page messages (optional)
- Click "Get Advanced Access" for each permission
- Some may require app review by Facebook (can take days)
#
Step 7: Get Your Access Token
Option 1: Graph API Explorer (Quick Testing)
- Go to https://developers.facebook.com/tools/explorer
- Select your app from dropdown
- Click "Generate Access Token"
- Select permissions you need
- Click "Generate Access Token"
- Copy the token
⚠️ Warning: This token expires in 1-2 hours. For production use, implement OAuth flow.
Option 2: Get Long-Lived Token (Recommended)
After getting short-lived token from Graph API Explorer:
- Go to: https://developers.facebook.com/tools/debug/accesstoken
- Paste your token
- Click "Debug"
- Click "Extend Access Token"
- Copy the new long-lived token (valid for 60 days)
For Page Tokens: Get page access token after user access token:
GET https://graph.facebook.com/v24.0/me/accounts?access_token=USER_TOKEN
This returns page tokens that don't expire (as long as you remain page admin).
Option 3: OAuth Flow (Production)
For production use with auto-refresh (see Advanced section).
#
Step 8: Find Your Facebook Page ID
If monitoring a page:
Method 1: Via Page Settings
- Go to your Facebook page
- Click "Settings"
- Look for "Page ID" in the left sidebar or general settings
Method 2: Via Graph API
GET https://graph.facebook.com/v24.0/me/accounts?access_token=YOUR_TOKEN
Returns all pages you manage with their IDs.
Method 3: Via Page URL
- Go to your page
- Look at URL:
facebook.com/YourPageName - Use Graph API:
GET https://graph.facebook.com/v24.0/YourPageName?access_token=YOUR_TOKEN
Response includes page ID.
#
Part 2: Configure Weavestream
#
Step 1: Add Facebook as a Source
- Open Weavestream
- Click the "+" button in the sidebar
- Select "Add Source"
- Fill in the source details:
- Name:
Facebook(orFacebook - [Page Name]) - Base URL:
https://graph.facebook.com/v24.0 - Auth Type:
Query Parameter - Query Param Name:
access_token - Query Param Value: Paste your access token
- Icon: Select
person.circleor customfacebookicon if available - Color: Choose your preference (suggested:
#1877F2- Facebook blue, or#007AFF) - Refresh Interval:
60minutes (1 hour)
- Name:
- Click "Add" or "Save"
#
Step 2: Add Endpoints
#
For Personal Profile (Limited)
#
Endpoint 1: Your Posts
Get your personal timeline posts.
Configuration:
- Name:
My Posts - Path:
/me/posts - Method:
GET
Query Parameters:
fields:id,message,created_time,story,full_picture,type,link
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
story(or compute from message preview) - Date Field:
created_time - Summary Fields:
message,type,link - Status Field: (none)
Retention Mode: Keep All
#
Endpoint 2: Your Photos
Get photos you've uploaded.
Configuration:
- Name:
My Photos - Path:
/me/photos - Method:
GET
Query Parameters:
fields:id,name,created_time,from,picture,imagestype:uploaded(only photos you uploaded, not tagged in)
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
from.name(your name) - Date Field:
created_time - Summary Fields:
name,picture - Status Field: (none)
Retention Mode: Archive on Sync
#
Endpoint 3: Pages You Like
Get pages you've liked (limited info).
Configuration:
- Name:
Liked Pages - Path:
/me/likes - Method:
GET
Query Parameters:
fields:id,name,category,link
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
name - Date Field: (none available)
- Summary Fields:
category,link
#
For Facebook Pages (Recommended)
#
Endpoint 4: Page Posts
Get all posts from your Facebook page.
Configuration:
- Name:
Page Posts - Path:
/{PAGE_ID}/posts
Replace {PAGE_ID} with your actual page ID
Example: /123456789012345/posts
Query Parameters:
fields:id,message,created_time,story,full_picture,type,permalink_url,reactions.summary(true),comments.summary(true),shareslimit:100
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field: Compute from message (first 50 chars) or use
story - Date Field:
created_time - Summary Fields:
message,type,reactions.summary.total_count,comments.summary.total_count,shares.count - Status Field: (none)
Retention Mode: Keep All
#
Endpoint 5: Published Page Posts (Simplified)
Alternative simpler endpoint.
Configuration:
- Name:
Published Posts - Path:
/{PAGE_ID}/published_posts - Method:
GET
Query Parameters:
fields:id,message,created_time,full_picture,permalink_urllimit:50
Field Mapping: Same as Page Posts
#
Endpoint 6: Page Insights (Analytics)
Get page performance metrics.
Configuration:
- Name:
Page Insights - Path:
/{PAGE_ID}/insights - Method:
GET
Query Parameters:
metric:page_impressions,page_reach,page_engaged_users,page_post_engagementsperiod:day(orweek,days_28)since:2024-01-01(start date)until:2024-01-31(end date)
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
name(metric name) - Date Field: Use sync time or parse from
values - Summary Fields:
values,description
Note: Insights data structure is complex. You may need custom parsing.
#
Endpoint 7: Post Engagement (Specific Post)
Get detailed engagement for a specific post.
Configuration:
- Name:
Post Engagement - [Post ID] - Path:
/{POST_ID} - Method:
GET
Replace {POST_ID} with actual post ID
Query Parameters:
fields:id,message,created_time,reactions.summary(true),comments.summary(true),shares,insights.metric(post_impressions,post_engaged_users)
Field Mapping:
- ID Field:
id - Title Field:
message(preview) - Date Field:
created_time - Summary Fields: All engagement metrics
Use Case: Create separate endpoints for important posts to track detailed metrics.
#
Endpoint 8: Page Reviews
Get reviews left on your page (if applicable - restaurants, businesses).
Configuration:
- Name:
Page Reviews - Path:
/{PAGE_ID}/ratings - Method:
GET
Query Parameters:
fields:created_time,reviewer,rating,review_text
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
reviewer.name - Date Field:
created_time - Summary Fields:
rating,review_text - Status Field:
rating- Map
5→ok - Map
4→info - Map
1-3→warning
- Map
#
Endpoint 9: Page Comments
Get all comments on your page's posts.
Configuration:
- Name:
Page Comments - Path:
/{PAGE_ID}/conversations - Method:
GET
Or for specific post:
- Path:
/{POST_ID}/comments
Query Parameters:
fields:id,created_time,from,message,comment_count,like_countfilter:stream(all comments)
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
from.name - Date Field:
created_time - Summary Fields:
message,like_count,comment_count
#
Endpoint 10: Scheduled Posts
Get posts scheduled for future publication.
Configuration:
- Name:
Scheduled Posts - Path:
/{PAGE_ID}/scheduled_posts - Method:
GET
Query Parameters:
fields:id,message,created_time,scheduled_publish_time
Field Mapping:
- Array Path:
data - ID Field:
id - Title Field:
message(preview) - Date Field:
scheduled_publish_time - Summary Fields:
message,created_time
#
Endpoint 11: Page Messages (Messenger)
Get messages sent to your page inbox.
Configuration:
- Name:
Page Messages - Path:
/{PAGE_ID}/conversations - Method:
GET
Query Parameters:
fields:id,updated_time,messages{message,from,created_time}
Requires: pages_messaging permission
Field Mapping:
- Array Path:
data - Complex nested structure - may need custom parsing
Note: Messages API is complex. Consider using for urgent message monitoring only.
#
Part 3: Understanding Facebook Graph API Data
#
Post Data Structure
{
"data": [
{
"id": "123456789_987654321",
"message": "Check out our new product!",
"created_time": "2024-01-26T14:30:00+0000",
"story": "Company Name shared a link.",
"full_picture": "https://scontent.xx.fbcdn.net/...",
"type": "link",
"permalink_url": "https://facebook.com/...",
"reactions": {
"summary": {
"total_count": 150
}
},
"comments": {
"summary": {
"total_count": 25
}
},
"shares": {
"count": 10
}
}
],
"paging": {
"cursors": {
"before": "abc123",
"after": "xyz789"
},
"next": "https://graph.facebook.com/..."
}
}
Key Fields:
id- Unique post identifiermessage- Post text contentcreated_time- ISO 8601 timestampreactions.summary.total_count- Total likes/reactionscomments.summary.total_count- Number of commentsshares.count- Number of sharespermalink_url- Direct link to post
#
Page Insights Data Structure
{
"data": [
{
"name": "page_impressions",
"period": "day",
"values": [
{
"value": 1250,
"end_time": "2024-01-26T08:00:00+0000"
}
],
"title": "Daily Total Impressions",
"description": "Daily: The number of times any content from your Page or about your Page entered a person's screen."
}
]
}
#
Part 4: Create Useful Filters
#
Filter 1: Posts This Week
- Under Facebook source, click "+" → "New Filter"
- Name:
Posts This Week - Select Endpoint: Page Posts or My Posts
- Add Condition:
- Field:
created_time - Operator:
in last - Value:
7 days
- Field:
- Save
#
Filter 2: High Engagement Posts
- Create new filter
- Name:
High Engagement (100+ reactions) - Select Endpoint: Page Posts
- Add Condition:
- Field:
reactions.summary.total_count - Type: Number
- Operator:
greater than - Value:
100
- Field:
- Save
#
Filter 3: Posts with Comments
- Create new filter
- Name:
Posts with Comments - Select Endpoint: Page Posts
- Add Condition:
- Field:
comments.summary.total_count - Type: Number
- Operator:
greater than - Value:
0
- Field:
- Save
#
Filter 4: Video Posts
- Create new filter
- Name:
Video Posts - Select Endpoint: Page Posts
- Add Condition:
- Field:
type - Operator:
equals - Value:
video
- Field:
- Save
Post Types:
link- Shared linksstatus- Text-only postsphoto- Photosvideo- Videosoffer- Offers/promotions
#
Filter 5: Low-Performing Posts
- Create new filter
- Name:
Low Engagement (<10 reactions) - Select Endpoint: Page Posts
- Add Conditions:
- Field:
reactions.summary.total_count - Operator:
less than - Value:
10 - AND
- Field:
created_time - Operator:
in last - Value:
7 days
- Field:
- Save
#
Part 5: Use AI to Analyze Your Social Media
#
Example Questions:
Engagement Analysis:
- "What posts got the most engagement this week?"
- "Show me posts with over 100 likes"
- "What's my average engagement rate?"
- "Which posts had the most comments?"
Content Performance:
- "What type of content performs best? (video vs photo vs link)"
- "When do I get the most engagement?"
- "What topics resonate with my audience?"
- "Show me underperforming posts"
Trend Analysis:
- "How is my engagement trending over time?"
- "Compare this month's performance to last month"
- "What was my most viral post?"
- "Show me engagement by day of week"
Content Planning:
- "What should I post about next based on past performance?"
- "Find successful post templates I can reuse"
- "What hashtags/topics should I focus on?"
Community Management:
- "Show me posts that need responses"
- "Which posts have unanswered comments?"
- "What negative reviews need attention?"
Page Management:
- "Summarize my page's performance this month"
- "What scheduled posts are upcoming?"
- "Show me inbox messages I haven't responded to"
#
Part 6: Advanced Configuration
#
Pagination Handling
Facebook uses cursor-based pagination:
Response includes:
{
"paging": {
"cursors": {
"before": "abc123",
"after": "xyz789"
},
"next": "https://graph.facebook.com/v24.0/..."
}
}
To get next page:
Use the next URL or add after=xyz789 cursor to your request.
Weavestream should handle this automatically.
#
Field Selection
Facebook Graph API uses field expansion:
Basic request:
GET /{PAGE_ID}/posts
Returns minimal fields.
With field selection:
GET /{PAGE_ID}/posts?fields=id,message,created_time,reactions.summary(true)
Returns only specified fields.
Nested field expansion:
fields=id,from{name,picture},comments{message,from}
Benefits:
- Faster responses
- Less data transfer
- Get exactly what you need
#
Insights Metrics
Available page insights metrics:
Engagement:
page_engaged_users- People who engagedpage_post_engagements- Total engagementspage_consumptions- Content clickspage_negative_feedback- Hide/unlike/report actions
Reach:
page_impressions- Times content was viewedpage_impressions_unique- Unique viewerspage_reach- People reachedpage_impressions_organic- Non-paid impressions
Page Views:
page_views_total- Total page viewspage_views_external_referrals- From outside Facebook
Actions:
page_actions_post_reactions_total- Reactions on postspage_fan_adds- New page likespage_fan_removes- Page unlikes
Period options: day, week, days_28, lifetime
#
Part 7: OAuth Setup (Production)
For production use with auto-refreshing tokens:
#
Facebook OAuth Flow:
- Authorization URL:
https://www.facebook.com/v24.0/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=http://localhost:8080/callback&scope=pages_show_list,pages_read_engagement,read_insights
- Token URL:
https://graph.facebook.com/v24.0/oauth/access_token
Required Parameters:
client_id: Your app IDclient_secret: Your app secretredirect_uri:http://localhost:8080/callbackcode: Authorization code from redirectgrant_type:authorization_code
Get Long-Lived Token:
GET /oauth/access_token?grant_type=fb_exchange_token&client_id=APP_ID&client_secret=APP_SECRET&fb_exchange_token=SHORT_TOKEN
- Get Page Token (Never Expires):
GET /me/accounts?access_token=USER_TOKEN
#
Troubleshooting
#
Issue: "Invalid OAuth access token"
Solution:
- Token expired - get a new long-lived token
- Verify token is for the correct app
- Check permissions haven't been revoked
- Debug token at: https://developers.facebook.com/tools/debug/accesstoken
#
Issue: "Requires extended permission: [permission]"
Solution:
- Go to Graph API Explorer
- Click "Get User Access Token"
- Select the required permission
- Generate new token with that permission
- For production: Request permission in App Review
#
Issue: "Unsupported get request" or endpoint not found
Solution:
- Verify endpoint path is correct (starts with
/) - Check you're using correct version (v24.0)
- Ensure you have permission for that endpoint
- Some endpoints require page tokens, not user tokens
#
Issue: "Array path 'data' not found"
Solution:
Most Facebook endpoints return data in data array. Ensure:
- Array path is set to
data - Response is actually an array (some insights return objects)
- Token has permission to access that data
#
Issue: "Rate limited"
Solution: Facebook has rate limits per app and per user:
- App-level: ~200 calls/hour/user
- Page-level: Higher limits for pages
Best practices:
- Increase refresh interval (60+ minutes)
- Use field selection to reduce data transfer
- Don't poll frequently for real-time updates
- Consider webhooks for real-time notifications (advanced)
#
Issue: "Cannot access posts from friends"
Solution: This is intentional. Facebook Graph API doesn't allow reading friends' posts for privacy reasons. You can only:
- Read your own posts
- Read posts on pages you manage
- Read public posts you're tagged in (limited)
#
Security & Privacy
#
Token Security:
Page Access Tokens:
- Don't expire (as long as you remain admin)
- More secure than user tokens
- Recommended for production
User Access Tokens:
- Short-lived: 1-2 hours
- Long-lived: 60 days
- Need to be refreshed
Best Practices:
- Never share tokens publicly
- Use page tokens when possible
- Rotate tokens regularly
- Store securely (Weavestream uses macOS Keychain)
- Monitor token usage in app dashboard
#
Privacy Settings:
For Personal Profiles:
- Only your own data is accessible
- Privacy settings affect what you can access
- Friends' data is protected
For Pages:
- All published content is accessible via API
- Unpublished/draft content requires manage permissions
- Private messages require special permissions and app review
#
Summary Checklist
Before you finish, verify:
- ✅ Facebook app created in Developers portal
- ✅ Required permissions requested/approved
- ✅ Access token obtained (long-lived or page token)
- ✅ Page ID found (if monitoring pages)
- ✅ Facebook source added to Weavestream
- ✅ At least one endpoint configured (Posts or Page Posts)
- ✅ Array path set to
data - ✅ Field mappings working (post content and dates visible)
- ✅ Smart filters created for engagement analysis
- ✅ Tested AI questions about your Facebook data
You're all set! Analyze your social media presence with AI-powered insights! 📱
Last updated: February 2026 Facebook Graph API version: v24.0