Summary of "Week-2.2 Trust and Credibility on OSM"
Summary of "Week-2.2 Trust and Credibility on OSM" Video Tutorial
This tutorial is part of the PSOSM course and focuses on using the Facebook Graph API to collect data, exploring the concepts of access tokens, permissions, API versions, and practical data extraction from Facebook pages, posts, groups, and events. It provides a developer’s perspective on interacting with Facebook data programmatically.
Main Ideas and Concepts
- Introduction & Context
- Facebook Graph API Explorer
- Accessed via developers.facebook.com → Tools & Support → Graph API Explorer.
- Requires a Facebook account and login.
- The interface shows an Access Token: a key generated using OAuth protocol to authenticate and authorize API access.
- Access tokens are linked to apps (default is Graph API Explorer app).
- Tokens have expiration times (e.g., 2 hours).
- Permissions and Access Tokens
- Permissions correspond to what data the app can access (e.g., email, birthday, education).
- Users must grant permissions via checkboxes when generating the Access Token.
- Different permissions are needed for different data fields.
- Example: To access birthday and education, those permissions must be explicitly granted.
- Using the Graph API
- Queries specify fields to retrieve (e.g., id, name, email).
- API returns data in JSON format.
- Debug errors occur if permissions are insufficient.
- The API only returns data that the Access Token has permission to access.
- Data Extraction Examples
- Retrieving user info: id, name, email, birthday, education.
- Retrieving user friends: only friends who have also authorized the app are returned.
- Retrieving posts: using
me/postsendpoint. - API versions: older versions (e.g., 2.0) return more data by default; newer versions (e.g., 2.6) require explicit field requests.
- Reactions on posts (like, love, angry, etc.) can be fetched with API v2.6.
- Paging: API returns results in pages (default 25 items), with URLs to fetch next pages.
- Limit parameter can be adjusted to fetch more results per query.
- Searching Facebook Data
- Search API supports searching users, pages, groups, events, places.
- Search results only include publicly visible data.
- Example: Searching for Facebook pages and groups named "NPTEL".
- Manual verification by opening Facebook pages in browser using page IDs.
- Working with Facebook Pages
- Extracting page details: category, location, description, verification status.
- Fetching page posts and analyzing content.
- Posts have unique IDs combining user/page ID and post ID.
- Posts can be pinned by page admins.
- Posts have reactions and shares count accessible via API.
- JSON Data Handling
- API responses are in JSON format, which can be hard to read.
- Use online JSON viewers (e.g., jsonviewer.stack.hu) to format and explore JSON data easily.
- Privacy and Limitations
- API only returns data that is public or for which the user has granted permissions.
- Friends data is limited to those who have authorized the app.
- Verification status of pages is important to determine authenticity.
- Some data fields may not be available if privacy settings restrict access.
- Next Steps
- Upcoming tutorials will cover creating your own Facebook app.
- Extending access tokens.
- Programmatic data collection using Python.
Detailed Methodology / Instructions
- Accessing Graph API Explorer
- Go to developers.facebook.com.
- Navigate to Tools & Support → Graph API Explorer.
- Log in with your Facebook account.
- Generating Access Token
- Click “Get Access Token” → “Get User Access Token”.
- Select required permissions (e.g., email, user_birthday, user_education_history).
- Confirm permissions in the dialog box.
- Copy the Access Token from the bar.
- Making API Requests
- Enter query in the Query Field (e.g.,
me?fields=id,name,email). - Click Submit.
- Review returned JSON data.
- Enter query in the Query Field (e.g.,
- Handling Permissions Errors
- If errors occur, revisit the Access Token generation.
- Add missing permissions.
- Regenerate token and retry.
- Exploring Data Types
- Retrieve friends (
me?fields=friends). - Retrieve posts (
me/posts). - Retrieve reactions on posts (
post_id/reactions). - Use filters for specific reactions (
- Retrieve friends (
Category
Educational