Skip to main content

How to Identify a Facebook URL

Find your Facebook URL below to see which identifier to extract and which factory method to call.

Profile​

A Facebook user profile.

URL exampleIdentifierFactory
https://www.facebook.com/IshowspeedIshowspeedProfile.from_username
https://www.facebook.com/profile.php?id=100084254631043100084254631043Profile.from_user_id
https://www.facebook.com/ads/library/? ... &view_all_page_id=103228679166389103228679166389Profile.from_page_id

Post​

A container post. May hold zero or more media posts.

Post https://www.facebook.com/Ishowspeed/posts/pfbid03879gxtiUxMyVbeyVFB9Vi8bT5poFwEY49j175X2pnYWAtn2bwrc3xnPJ5zDpABBal
│
├─ MediaPost https://www.facebook.com/photo/?fbid=1109890145162796
│
├─ MediaPost https://www.facebook.com/reel/1109890215162789/
│
└─ MediaPost https://www.facebook.com/100084254631043/videos/pcb.1109890215162789/1172936348430690

Each Post and each MediaPost has its own comment section. The example above has 4 comment sections.

From a pfbid URL

URL exampleIdentifierFactory
https://www.facebook.com/johndoe/posts/pfbid0qHZ...pfbid0qHZ...Post.from_pfbid

From a numeric id URL

URL exampleIdentifierFactory
https://www.facebook.com/johndoe/posts/253053527513133253053527513133Post.from_post_id
https://www.facebook.com/groups/2781022932139267/permalink/253617361590909253617361590909Post.from_post_id
https://www.facebook.com/permalink.php?story_fbid=253053527513133&id=100084254631043253053527513133Post.from_post_id
note

If you have a numeric id but don't know whether it belongs to a Post or a MediaPost, use PostBase.from_any_id. It tries Post.from_post_id first, then falls back to MediaPost.from_media_post_id.

MediaPost​

A single media item (photo or video) that is its own post, with its own comments, reactions, and permalink.

URL exampleIdentifierFactory
https://www.facebook.com/photo/?fbid=1109890145162796&set=a.1320383235541401109890145162796MediaPost.from_media_post_id
https://www.facebook.com/reel/1109890145162796/1109890145162796MediaPost.from_media_post_id
https://www.facebook.com/johndoe/videos/1109890145162796/1109890145162796MediaPost.from_media_post_id
https://www.facebook.com/Ishowspeed/videos/pcb.1109890215162789/11729363484306901172936348430690MediaPost.from_media_post_id

Group​

A Facebook group.

URL exampleIdentifierFactory
https://www.facebook.com/groups/workingmemesworkingmemesGroup.from_groupname
https://www.facebook.com/groups/27810229321392672781022932139267Group.from_group_id

MarketplaceListing​

A Marketplace listing.

URL exampleIdentifierFactory
https://www.facebook.com/marketplace/item/12345678901234561234567890123456MarketplaceListing.from_listing_id

An advertisement from the Meta Ad Library.

URL exampleIdentifierFactory
https://www.facebook.com/ads/library/? ... &id=123456789876789123456789876789Advertisement.from_ad_id