Profile
A Facebook user profile.
Profile can be created with:
- From ID
- From username
Profile.from_user_id(context: FacebookContext, user_id: str) -> ProfileProfile.from_username(context: FacebookContext, username: str) -> ProfileThe username is resolved to an ID using regex matching. Prefer from_user_id when possible.
Properties
Identity
id: str- Facebook user ID.
name: str | None- Display name.
alternate_name: str | None- Alternate name or nickname.
gender: str | None- Reported gender, e.g.
"MALE". url: str | None- Facebook profile URL.
status_text: str | None- Short status or tagline.
profile_picture_url: str | None- URL of the profile picture.
is_verified: bool | None- Whether the account has a verified badge.
followers_count: str | None- Follower count as a display string, e.g.
"6.9k". following_count: str | None- Following count as a display string, e.g.
"6.9k". friends_count: str | None- Friend count as a display string, e.g.
"4".
About
biography: str | None- Short bio shown on the profile.
category: str | None- Page category, e.g.
"Gaming video creator". description: str | None- Longer profile description.
current_location: str | None- Current city or location.
hometown: str | None- Hometown listed on the profile.
birthday: str | None- Birthday as a display string, e.g.
"21 January 2005".
Relationship & family
relationship: dict | NoneRelationship status as
{"type", "date", "desc"}.family: list[dict] | NoneFamily members as
{"name", "type"}entries.
Languages, links, work
language: list[str] | None- Languages listed on the profile.
links: list[dict] | NoneExternal links as
{"link", "desc"}entries.works: list[dict] | NoneWork history as
{"company", "desc"}entries.
Education
colleges: list[dict] | NoneColleges as
{"name", "date", "subject", "activities", "dorm", "classes", "desc"}entries.high_schools: list[dict] | NoneHigh schools as
{"name", "date"}entries.
Interests & travel
hobbies: list[dict] | NoneHobbies as
{"name", "desc"}entries.travels: list[dict] | NonePlaces visited as
{"name", "date"}entries.interests: dict | NoneInterests grouped under
musics,tv_shows,movies,games, andsports.
Contacts & pronunciation
contacts: list[dict] | NoneContact info under
socials,phones,emails,messenger,whatsapp_number, andmedia_kit.name_pronunciation: list[dict] | NoneName pronunciation as
{"name"}entries.nicknames: list[dict] | NoneNicknames as
{"type", "name"}entries.
Business
business_rating: str | None- Rating summary, e.g.
"4.6 (100 reviews)". business_address: str | None- Business address.
business_hours: str | None- Business hours as a display string, e.g.
"Mon-Fri: 6am-7pm".
Methods
All methods return a PaginatedIterator of model objects.
get_posts()-> PaginatedIterator[Post]- User's posts.
get_photos()-> PaginatedIterator[Photo]- User's photos.
get_videos()-> PaginatedIterator[Video]- User's videos / reels.
get_followers()-> PaginatedIterator[Profile]- Users following this user.
get_followees()-> PaginatedIterator[Profile]- Users this user follows.
get_friends_followers()-> PaginatedIterator[Profile]- Friends of the user who also follow them.
get_friends_followees()-> PaginatedIterator[Profile]- Friends of the user whom they also follow.
Example
import facebook_gql_scraper as fgs
context = fgs.FacebookContext(cookies_file="facebook_cookies.json")
user = fgs.Profile.from_user_id(context, user_id="100084254631043")
# Or from username: user = fgs.Profile.from_username(ctx, username="Ishowspeed")
for post in user.get_posts():
print(post.id, post.text)