freish
freish

Reputation: 63

Facebook posts URL's sometimes show up in a weird format. Is there any way to convert this to post id?

Usually you'd have 3 formats a post URL will be:

  1. https://www.facebook.com/XXXXX/posts/YYYYY
  2. https://www.facebook.com/XXXXX/photos/a.AAAAA/YYYYY
  3. https://www.facebook.com/permalink.php?story_fbid=YYYYY&id=XXXXX

where XXXXX - page id, and YYYYY - post id (both are a string of digits), but sometimes, very rarely, you get a link which is of the 1st type, but instead of having the post id be a string of digits at the YYYYY spot, it is a string of symbols that seem to always start with "pfbid".

https://www.facebook.com/XXXXX/posts/pfbid02yEJj6dTFRtQ644Gq8qwaXt85pSi8Qvih3M6NBnbMqbJc1NM9QcdjWPpokoggDhNGl

Sometimes you can just click on the date of the post and get a regular link, but sometimes you can't get a link that isn't of this type. Is there any way to convert the string at the end to a post id or is there any other way to get a different Facebook post URL, that would be of type 1, 2 or 3?

Upvotes: 6

Views: 2519

Answers (2)

ᴍᴇʜᴏᴠ
ᴍᴇʜᴏᴠ

Reputation: 5266

As of now in August 2023 it's still possible to obtain and use the old format URL. Here's a quick hack that doesn't require any API calls and can be done via simple copy and paste:

https://news.ycombinator.com/item?id=32118095

(I know link-only answers are discouraged, but I don't want to take any credit for someone else's post, so I won't copy it here.)

The whole thread is a discussion on why this move by Facebook is not a good thing.

Upvotes: 2

user3003816
user3003816

Reputation: 86

It's possible to retrieve post from graph api by calling endpoint /XXXXX_pfbidYYYYYY

It returns response with numeric id

Upvotes: 5

Related Questions