Facebook Photos – How to Tag Friends on External Websites

facebookfacebook-photosfacebook-tags

How do you Facebook tag you and your friends in photos on an external website?

This is an example of it in action, but not sure how they did it:

http://mlb.mlb.com/photos/gigapan/?gpId=e9652024f103d4cd414e286ce041a419&c_id=tex

Basically I want people to be able to tag themselves and their Facebook friends in photos on my website. Surely it must be possible since they did it here. Any ideas how this is done?

Best Answer

This is accomplished through the Facebook Graph API.

At Facebook's core is the social graph; people and the connections they have to everything they care about. The Graph API presents a simple, consistent view of the Facebook social graph, uniformly representing objects in the graph (e.g., people, photos, events, and pages) and the connections between them (e.g., friend relationships, shared content, and photo tags).

The connections supported for people and pages include:
Friends: https://graph.facebook.com/me/friends?access_token=...
Photo Tags: https://graph.facebook.com/me/photos?access_token=...
Photo Albums: https://graph.facebook.com/me/albums?access_token=...
Video Tags: https://graph.facebook.com/me/videos?access_token=...

…among others.