Programmatically determine if a Facebook page has been merged with another page

Facebook has begun to "merge" duplicate pages. For example, if you go to this page for the movie Good Fellas: https://www.facebook.com/105652212803097 , you will notice that it is redirected to the main page: https://www.facebook.com/goodfellasthemovie when the following message is displayed : "Goodfellas was merged with this page"

This is great, but users also copied from the "old" page to the "new" page without deleting it from the "old" page. Therefore, if you ask the user to like who liked the page that was merged, you will get 2 separate types of ids for what is now the same page - without indicating the link between the pages or the fact that one of them was automatically generated .

Is there a way to programmatically determine if a page has been merged with another page? Or that two pages are connected to each other? Or that the page is no longer functioning and redirected?

+2
facebook facebook-graph-api
source share
1 answer

After posting the question, I found the answer.

There is a field called "best_page" that gives the best alternative identifier for the page you request. Using the original Good Fellas movie example, if you request any of your "bad" pages with the "best_page" field, for example on page id 102154619826846, if the page is not yet the best page, you will return the "best page" property indicating to the id of the main page 193801173989136:

 { "id": "102154619826846", "name": "Good Fellas", "best_page": { "category": "Movie", "name": "Goodfellas", "id": "193801173989136" } } 

https://developers.facebook.com/tools/explorer?method=GET&path=102154619826846%2F%3Ffields%3Did%2Cname%2Cbest_page&version=v2.1

If the page you are requesting is already the best page, you will not get any "best_page" property in the response:

 { "id": "193801173989136", "name": "Good Fellas" } 

https://developers.facebook.com/tools/explorer?method=GET&path=193801173989136%2F%3Ffields%3Did%2Cname%2Cbest_page&version=v2.1

To expand the solution, if you request all users and want to find out the best page for each of them without reviewing each page separately, you can use it with the likes endpoint:

 /v2.1/me/likes?fields=id,name,best_page{id} 

https://developers.facebook.com/tools/explorer?method=GET&path=me%2Flikes%3Ffields%3Did%2Cname%2Cbest_page%7Bid%7D&version=v2.1

This will return all your preferences using the "best_page" property for anyone who has the best page. As above, only pages that are not the best page will return the "best_page" property.

+3
source share

All Articles