
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
FBGraphHandler is a Python library that simplifies the process of interacting with Facebook's Graph API. It provides methods for authenticating users, retrieving user details, posting text and video feeds, and more.
You can install FBGraphHandler using pip:
pip install FBGraphHandler
from FBGraphHandler import FBGraphHandler
# Create an instance of FBGraphHandler
graph_handler = FBGraphHandler()
# Configure FBGraphHandler with your Facebook App credentials
graph_handler.Config(client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", version="14.0")
# Generate an authorization URL for users to complete the authentication process
auth_url = graph_handler.GenerateAuthURL(redirect_uri="YOUR_REDIRECT_URI", scopes=["public_profile", "email"])
# Exchange the authorization code for an access token
access_token = graph_handler.ExchangeCodewithToken(code="AUTHORIZATION_CODE")
# Get user details using the access token
user_details = graph_handler.GetUserDetails(access_token="ACCESS_TOKEN")
# Post a text feed to a user or page
post_id = graph_handler.PostTextFeed(text="Hello, Facebook!", id="PAGE_OR_USER_ID", access_token="ACCESS_TOKEN")
# Post a video feed to a user or page
post_id = graph_handler.PostVideoFeed(text="Check out this video!", id="PAGE_OR_USER_ID", access_token="ACCESS_TOKEN", video_url="VIDEO_URL")
# Post text, photos, or videos to a user or page
media_urls = ["PHOTO_URL_1", "PHOTO_URL_2"]
post_id = graph_handler.PostToFacebook(text="My Facebook post", media_urls=media_urls, access_token="ACCESS_TOKEN", id="PAGE_OR_USER_ID", isVideo=False)
For detailed documentation and more information about available methods and parameters, please refer to the official documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Unofficial Facebook Graph API Handler
We found that GraphHandler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.