How to get page id of a facebook page

前端 未结 8 1455
囚心锁ツ
囚心锁ツ 2021-02-19 02:03

I need to fetch page id of a facebook page of a given URL in graph API. e.g this is the URL http://www.facebook.com/platform and I want to get the page id of this facebook page.

8条回答
  •  囚心锁ツ
    2021-02-19 02:39

    The answers given before this one (Oct 27, 2015) no longer work.

    What works right now is to go to the page or user's Facebook page, and grep the source for fb://page/\d+ or fb://profile/\d+.

    Example:

    https://www.facebook.com/idorecall/

    contains

    fb://page/1605841049661522

    https://www.facebook.com/dandasco

    contains

    fb://profile/100002764094643

    Try this on the command line:

    curl -skA "Mozilla/5.0" https://www.facebook.com/idorecall/ | grep -oE "fb://[^\"]+"
    

提交回复
热议问题