Open Graph
Parse Open Graph, Twitter Card and HTML link-preview metadata from HTML text or URLs
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/opengraph/index.md to help me query Open Graph with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Pull the title and preview image out of an HTML document
Example output · captured
- Connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT og.title, og.image
FROM (SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>') AS og)
| title | image |
|---|---|
| Rock & Roll | /cover.png |
Quick start
Choose where to run Open Graph, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the release directly
Downloads the latest release for your platform and caches it locally.
ATTACH 'opengraph' AS opengraph (
TYPE vgi,
LOCATION 'github-auto://Query-farm/vgi-opengraph'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'opengraph' AS opengraph (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-opengraph:0.2.0'
);
3. Run a query
SELECT og.title, og.image
FROM (SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>') AS og)
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'opengraph' AS opengraph
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT og.title, og.image
FROM (SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>') AS og)
Query Farm operates Open Graph for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use opengraph as the catalog alias for the query below.
4. Run a query
SELECT og.title, og.image
FROM (SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>') AS og)
Technical details
- Verified connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach the release directly
Uses the verified release each time you attach the connector.
ATTACH 'opengraph' AS opengraph (
TYPE vgi,
LOCATION 'github-auto://Query-farm/[email protected]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'opengraph' AS opengraph (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-opengraph:0.2.0'
);
Overview
Link-preview metadata from web pages: Open Graph, Twitter Card and plain HTML fallbacks such as title, description, canonical URL and favicon, parsed from HTML you already hold or fetched from URLs with per-row HTTP errors.
Parse Open Graph, Twitter Card and HTML link-preview metadata in SQL, from HTML text or straight from URLs.
- Parse HTML you already have (crawl tables, saved pages) with no network access.
- Or fetch pages directly: redirects followed, only the
<head>read, failures reported per row in anerrorfield. - Sensible fallbacks: missing
og:*tags fall back totwitter:*, then<title>,<meta name=description>and<link rel=canonical>. - Relative image and page URLs resolved to absolute ones.
Sources and references
- The Open Graph protocol: the
og:*,article:*andproduct:*properties the parser reads. - oEmbed: the embed-discovery
<link>format reported alongside the tags. - HTML
<meta>element (WHATWG): the plain-HTMLname/contentmetadata used as the fallback.
A Query.Farm VGI worker.
Catalog
Everything opengraph exposes once attached — read straight from the worker's
released build.
main 3 functions
Scalars that parse or fetch Open Graph, Twitter Card and HTML link-preview metadata.
Schema examples (6)
Pull the title and preview image out of an HTML document
SELECT og.title, og.image
FROM (SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>') AS og);
| title | image |
|---|---|
| Rock & Roll | /cover.png |
Resolve a relative og:image against the page URL
SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>', 'https://example.com/music/').image AS image;
Build article preview cards from crawled HTML: title and absolute image from parse_opengraph(html, base_url), plus the article:tag keywords (not in the summary) collected from opengraph_tags
WITH pages(page_url, html) AS (VALUES ('https://blog.example.com/posts/duckdb', '<title>Blog</title><meta property="og:title" content="Why DuckDB"><meta property="og:image" content="/img/duck.png"><meta property="article:tag" content="duckdb"><meta property="article:tag" content="sql">'), ('https://blog.example.com/posts/hello', '<title>Hello, world</title><meta property="article:tag" content="intro">')) SELECT page_url, og.title, og.image, article_tags
FROM (SELECT page_url, opengraph.main.parse_opengraph(html, page_url) AS og, [t.content FOR t IN opengraph.main.opengraph_tags(html) IF t.property = 'article:tag'] AS article_tags FROM pages)
ORDER BY page_url;
Unnest the raw meta tags of a document
SELECT t.property, t.content
FROM (SELECT unnest(opengraph.main.opengraph_tags('<meta property="og:type" content="article"><meta property="article:author" content="Ada">')) AS t)
ORDER BY t.property;
2 more examples
Audit where each page's preview title comes from: check the raw tags from opengraph_tags for og:title or twitter:title, else parse_opengraph fell back to the <title> element
WITH pages(page_url, html) AS (VALUES ('https://shop.example.com/a', '<title>Shop A</title><meta property="og:title" content="Spring Sale">'), ('https://shop.example.com/b', '<title>Shop B</title><meta name="twitter:title" content="B on Twitter">'), ('https://shop.example.com/c', '<title>Shop C</title>')) SELECT page_url, preview_title, CASE WHEN list_contains(props, 'og:title') THEN 'og:title' WHEN list_contains(props, 'twitter:title') THEN 'twitter:title' ELSE '<title> fallback' END AS title_source
FROM (SELECT page_url, opengraph.main.parse_opengraph(html).title AS preview_title, [t.property FOR t IN opengraph.main.opengraph_tags(html)] AS props FROM pages)
ORDER BY page_url;
Unfurl a link the way a chat app would
SELECT og.title, og.site_name, og.image
FROM (SELECT opengraph.main.fetch_opengraph('https://github.com/duckdb/duckdb') AS og)
WHERE og.error IS NULL;
fetch_opengraph (url VARCHAR)
Download a web page and return its Open Graph metadata as a STRUCT, with HTTP status and error.
-
titleVARCHAR
-
descriptionVARCHAR
-
typeVARCHAR
-
urlVARCHAR
-
site_nameVARCHAR
-
localeVARCHAR
-
imageVARCHAR
-
image_altVARCHAR
-
image_widthINTEGER
-
image_heightINTEGER
-
imagesVARCHAR[]
-
videoVARCHAR
-
audioVARCHAR
-
twitter_cardVARCHAR
-
twitter_siteVARCHAR
-
twitter_creatorVARCHAR
-
canonical_urlVARCHAR
-
favicon_urlVARCHAR
-
oembed_urlVARCHAR
-
final_urlVARCHAR
-
http_statusINTEGER
-
content_typeVARCHAR
-
errorVARCHAR
Unfurl a link the way a chat app would
SELECT og.title, og.site_name, og.image
FROM (SELECT opengraph.main.fetch_opengraph('https://github.com/duckdb/duckdb') AS og)
WHERE og.error IS NULL;
opengraph_tags (html VARCHAR)
List every property/name and content pair in an HTML document, in document order.
Unnest the raw meta tags of a document
SELECT t.property, t.content
FROM (SELECT unnest(opengraph.main.opengraph_tags('<meta property="og:type" content="article"><meta property="article:author" content="Ada">')) AS t)
ORDER BY t.property;
Audit where each page's preview title comes from: check the raw tags from opengraph_tags for og:title or twitter:title, else parse_opengraph fell back to the <title> element
WITH pages(page_url, html) AS (VALUES ('https://shop.example.com/a', '<title>Shop A</title><meta property="og:title" content="Spring Sale">'), ('https://shop.example.com/b', '<title>Shop B</title><meta name="twitter:title" content="B on Twitter">'), ('https://shop.example.com/c', '<title>Shop C</title>')) SELECT page_url, preview_title, CASE WHEN list_contains(props, 'og:title') THEN 'og:title' WHEN list_contains(props, 'twitter:title') THEN 'twitter:title' ELSE '<title> fallback' END AS title_source
FROM (SELECT page_url, opengraph.main.parse_opengraph(html).title AS preview_title, [t.property FOR t IN opengraph.main.opengraph_tags(html)] AS props FROM pages)
ORDER BY page_url;
parse_opengraph (html VARCHAR, base_url VARCHAR) +1 overload
Parse Open Graph, Twitter Card and basic HTML metadata from an HTML document into a STRUCT.
parse_opengraph(html VARCHAR) → STRUCT of 19 fieldsparse_opengraph(html VARCHAR, base_url VARCHAR) → STRUCT of 19 fields
-
titleVARCHAR
-
descriptionVARCHAR
-
typeVARCHAR
-
urlVARCHAR
-
site_nameVARCHAR
-
localeVARCHAR
-
imageVARCHAR
-
image_altVARCHAR
-
image_widthINTEGER
-
image_heightINTEGER
-
imagesVARCHAR[]
-
videoVARCHAR
-
audioVARCHAR
-
twitter_cardVARCHAR
-
twitter_siteVARCHAR
-
twitter_creatorVARCHAR
-
canonical_urlVARCHAR
-
favicon_urlVARCHAR
-
oembed_urlVARCHAR
Pull the title and preview image out of an HTML document
SELECT og.title, og.image
FROM (SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>') AS og);
| title | image |
|---|---|
| Rock & Roll | /cover.png |
Resolve a relative og:image against the page URL
SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>', 'https://example.com/music/').image AS image;
Build article preview cards from crawled HTML: title and absolute image from parse_opengraph(html, base_url), plus the article:tag keywords (not in the summary) collected from opengraph_tags
WITH pages(page_url, html) AS (VALUES ('https://blog.example.com/posts/duckdb', '<title>Blog</title><meta property="og:title" content="Why DuckDB"><meta property="og:image" content="/img/duck.png"><meta property="article:tag" content="duckdb"><meta property="article:tag" content="sql">'), ('https://blog.example.com/posts/hello', '<title>Hello, world</title><meta property="article:tag" content="intro">')) SELECT page_url, og.title, og.image, article_tags
FROM (SELECT page_url, opengraph.main.parse_opengraph(html, page_url) AS og, [t.content FOR t IN opengraph.main.opengraph_tags(html) IF t.property = 'article:tag'] AS article_tags FROM pages)
ORDER BY page_url;
1 more example
SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>', 'https://example.com/music/').image AS image
ORDER BY ALL;
Try these queries
Resolve a relative og:image against the page URL
SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>', 'https://example.com/music/').image AS image
Uses parse_opengraph
Build article preview cards from crawled HTML: title and absolute image from parse_opengraph(html, base_url), plus the article:tag keywords (not in the summary) collected from opengraph_tags
WITH pages(page_url, html) AS (VALUES ('https://blog.example.com/posts/duckdb', '<title>Blog</title><meta property="og:title" content="Why DuckDB"><meta property="og:image" content="/img/duck.png"><meta property="article:tag" content="duckdb"><meta property="article:tag" content="sql">'), ('https://blog.example.com/posts/hello', '<title>Hello, world</title><meta property="article:tag" content="intro">')) SELECT page_url, og.title, og.image, article_tags
FROM (SELECT page_url, opengraph.main.parse_opengraph(html, page_url) AS og, [t.content FOR t IN opengraph.main.opengraph_tags(html) IF t.property = 'article:tag'] AS article_tags FROM pages)
ORDER BY page_url
Unnest the raw meta tags of a document
SELECT t.property, t.content
FROM (SELECT unnest(opengraph.main.opengraph_tags('<meta property="og:type" content="article"><meta property="article:author" content="Ada">')) AS t)
ORDER BY t.property
Uses opengraph_tags
Audit where each page's preview title comes from: check the raw tags from opengraph_tags for og:title or twitter:title, else parse_opengraph fell back to the <title> element
WITH pages(page_url, html) AS (VALUES ('https://shop.example.com/a', '<title>Shop A</title><meta property="og:title" content="Spring Sale">'), ('https://shop.example.com/b', '<title>Shop B</title><meta name="twitter:title" content="B on Twitter">'), ('https://shop.example.com/c', '<title>Shop C</title>')) SELECT page_url, preview_title, CASE WHEN list_contains(props, 'og:title') THEN 'og:title' WHEN list_contains(props, 'twitter:title') THEN 'twitter:title' ELSE '<title> fallback' END AS title_source
FROM (SELECT page_url, opengraph.main.parse_opengraph(html).title AS preview_title, [t.property FOR t IN opengraph.main.opengraph_tags(html)] AS props FROM pages)
ORDER BY page_url
Unfurl a link the way a chat app would
SELECT og.title, og.site_name, og.image
FROM (SELECT opengraph.main.fetch_opengraph('https://github.com/duckdb/duckdb') AS og)
WHERE og.error IS NULL
Uses fetch_opengraph
A relative og:image becomes absolute
SELECT opengraph.main.parse_opengraph('<html lang="en"><head><title>Fallback</title><meta property="og:title" content="Rock & Roll"><meta property="og:image" content="/cover.png"></head></html>', 'https://example.com/music/').image AS image
ORDER BY ALL;
Uses parse_opengraph
Open Graph is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
Bluesky
News, social & research
Bluesky posts, threads, profiles, followers, feeds, trends and the live Jetstream firehose
Hacker News
News, social & research
Hacker News front page, stories, comment threads and users
News
News, social & research
Search worldwide news articles from SQL via GDELT (free) or NewsAPI (with a key)