format

Open Graph Protocol

Open Graph is a protocol that uses meta tags in an HTML page's head to define how a URL is displayed when shared on social media platforms.

Developed by Facebook, the Open Graph (OG) protocol lets publishers control a URL's appearance in social shares by defining meta tags such as `og:title`, `og:description`, `og:image`, and `og:type`. When a social platform fetches a URL to generate a link preview, it reads these tags to populate the card's title, description, and thumbnail.

For scrapers, OG tags are a fast way to extract a page's canonical title, cover image URL, content type, and description without parsing the full page body. Because they are machine-readable meta elements in the `<head>` section, they can be extracted without JavaScript execution from the raw HTML source.

News aggregators, content monitoring tools, and social listening platforms routinely harvest OG data. Combined with schema.org annotations, OG tags provide rich metadata for a large proportion of the public web.

Examples

from bs4 import BeautifulSoup

soup = BeautifulSoup(html, "html.parser")
og = {}
for tag in soup.find_all("meta", property=lambda v: v and v.startswith("og:")):
    og[tag["property"]] = tag.get("content", "")
print(og.get("og:title"), og.get("og:image"))

Related Terms

Extract Open Graph Protocol data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

View API docs

Your first scrape.
Sixty seconds.

$1 free balance. No credit card. No SDK.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · Up to 5,000 free scrapes · Balance never expires

    Open Graph Protocol — Web Scraping Glossary | AlterLab