How the Open Graph Protocol Works

The Open Graph protocol uses <meta> tag markup to deliver a comprehensive view of a web entity within a user’s social graph. These <meta> tags provide data about what is being described on a page or web source, such as a business, movie, actor, or sports team.

Besides the type of information that describes what is being displayed on the page, you can also include geographic information and contact details.

The Open Graph ecosystem comprises two main elements:

An Open Graph producer

This is the site that includes <meta> tag information about the entities being described.

An Open Graph consumer

This is a developer or site that consumes that <meta> tag information placed on a site—for example, the Facebook Like button integration.

These are the basics of the Open Graph protocol. The web application, or consumer, makes a request to the website for information about the site. The site, or producer, will respond with the metadata about itself. This process is depicted in Figure 10-1.

Open Graph protocol request/response workflow

Figure 10-1. Open Graph protocol request/response workflow

Next, we’ll explore how to work with and implement the Open Graph protocol.

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.