Skip to content

Feed

Fetch feeds into SQL rows and import or generate feed documents with COPY

Connector software
Free and open source
Service credentials
Not needed
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/feed/index.md to help me query Feed 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.

List the items parsed from an inline RSS 2.0 feed, ordered by position.

Example output · captured
Connector release
v0.6.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT seq, title, link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')
ORDER BY seq;
Result
seq title link
0 First Post https://query.farm/first
1 Second Post https://query.farm/second

Quick start

Choose where to run Feed, 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.

setup.sql
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;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'feed' AS feed (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-feed'
);

3. Run a query

query.sql
SELECT seq, title, link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')
ORDER BY seq;
More example queries →
Technical details
Verified connector release
v0.6.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
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 'feed' AS feed (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Fetch, query, import, and generate RSS / Atom / JSON feeds.

Catalog

Everything feed exposes once attached — read straight from the worker's released build.

feed 1 schema
main 1 view · 6 functions

RSS / Atom / JSON feed parsing table functions.

Schema examples (5)
Examples (5)

List the items parsed from an inline RSS 2.0 feed, ordered by position.

SELECT seq, title, link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')
ORDER BY seq;
Result
seq title link
0 First Post https://query.farm/first
1 Second Post https://query.farm/second

Count the items in an inline feed.

SELECT count(*) AS items
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>');

Read feed-level metadata: title, detected format, language, and item count.

SELECT title, feed_type, language, item_count
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>');

Find the entries that are new since an earlier snapshot of the same feed by anti-joining the current feed_items against the snapshot's feed_items on link (returns Second Post; no network access).

SELECT cur.seq, cur.title, cur.link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>') AS cur ANTI
JOIN feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><item><title>First Post</title><link>https://query.farm/first</link></item></channel></rss>') AS prev ON cur.link = prev.link
ORDER BY cur.seq;
1 more example

Break a feed's entries down by category: join feed_info (feed title and reported item_count) to the UNNESTed categories from feed_items to get each category's entry count and its share of the feed (news 2 entries = 1.0, release 1 = 0.5; no network access).

SELECT f.title AS feed_title, c.category, count(*) AS entries,
  round(count(*) / f.item_count, 2) AS share_of_feed
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>') AS f
CROSS JOIN (SELECT UNNEST(categories) AS category FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')) AS c
GROUP BY f.title, f.item_count, c.category
ORDER BY entries DESC, c.category;
Views
feed_registry 2 examples5 cols

Curated registry of well-known public RSS / Atom / JSON feeds (name, url, feed_type, category, description) to browse and feed into feed_items / feed_info.

Columns
name VARCHAR
Human-friendly feed name.
url VARCHAR
Feed URL to pass to feed_items(input) or feed_info(input).
feed_type VARCHAR
Feed format: rss, atom, or json.
category VARCHAR
Broad topic such as Technology, News, Science, Security, or Comics.
description VARCHAR
One-line description of what the feed publishes.
Examples (2)

Browse every feed in the registry with its URL, format, and topic.

SELECT name, url, feed_type, category
FROM feed.main.feed_registry
ORDER BY name;

Find the feed URLs published in JSON Feed format.

SELECT name, url
FROM feed.main.feed_registry
WHERE feed_type = 'json'
ORDER BY name;
Link
Table functions
feed_info (input VARCHAR, timeout_ms := BIGINT) 4 examples

Return feed-level metadata (title, type, language, item count) for an RSS/Atom/JSON feed

Positional arguments
input VARCHAR
Feed URL (http/https) or raw feed text (RSS/Atom XML or JSON Feed)
Named arguments
timeout_ms := BIGINT
HTTP fetch timeout in milliseconds · default 15000
Returns columns
title VARCHAR
Feed title (empty string when absent).
description VARCHAR
Feed description / subtitle (empty string when absent).
link VARCHAR
Feed home / site URL (empty string when absent).
feed_type VARCHAR
Detected feed format: rss, atom, or json.
language VARCHAR
Feed language code such as en-us (empty string when absent).
updated TIMESTAMP
Feed last-updated time in UTC; NULL when absent or unparseable.
item_count INTEGER
Number of items present in the feed.
Examples (4)

Inspect an inline feed's title, detected format, language, and item count (no network access).

SELECT title, feed_type, language, item_count
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>');

Parse feed-level metadata directly from a raw inline RSS document (no network access).

SELECT feed_type, item_count
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Example</title><item><title>Hi</title></item></channel></rss>');

Break a feed's entries down by category: join feed_info (feed title and reported item_count) to the UNNESTed categories from feed_items to get each category's entry count and its share of the feed (news 2 entries = 1.0, release 1 = 0.5; no network access).

SELECT f.title AS feed_title, c.category, count(*) AS entries,
  round(count(*) / f.item_count, 2) AS share_of_feed
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>') AS f
CROSS JOIN (SELECT UNNEST(categories) AS category FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')) AS c
GROUP BY f.title, f.item_count, c.category
ORDER BY entries DESC, c.category;
1 more example

Fetch a public feed URL and inspect its metadata (requires network access).

SELECT title, feed_type, item_count
FROM feed.main.feed_info('https://www.nasa.gov/feed/', timeout_ms := 5000);
Link
feed_items (input VARCHAR, timeout_ms := BIGINT, max_items := BIGINT) 6 examples

Parse an RSS/Atom/JSON feed (URL or raw text) into one row per item

Positional arguments
input VARCHAR
Feed URL (http/https) or raw feed text (RSS/Atom XML or JSON Feed)
Named arguments
timeout_ms := BIGINT
HTTP fetch timeout in milliseconds · default 15000
max_items := BIGINT
Maximum number of items to return · default 1000
Returns columns
seq BIGINT
0-based position of the item within the feed.
guid VARCHAR
Item GUID / id (empty string when the feed omits one).
title VARCHAR
Item title (empty string when absent).
link VARCHAR
Item link / permalink URL (empty string when absent).
published TIMESTAMP
Publish time in UTC; NULL when absent or unparseable.
updated TIMESTAMP
Last-updated time in UTC; NULL when absent or unparseable.
author VARCHAR
Author display name or email (empty string when absent).
categories VARCHAR[]
Item categories / tags as a list (empty list when none).
summary VARCHAR
Item summary / description (empty string when absent).
content VARCHAR
Full item content (empty string when not provided).
Examples (6)

List items parsed directly from an inline RSS 2.0 document (no network access).

SELECT seq, title, link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')
ORDER BY seq;
Result
seq title link
0 First Post https://query.farm/first
1 Second Post https://query.farm/second

Expand each item's categories into one row per (item, category), capped at 20 items.

SELECT title, UNNEST(categories) AS category
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>', max_items := 20);

Find the entries that are new since an earlier snapshot of the same feed by anti-joining the current feed_items against the snapshot's feed_items on link (returns Second Post; no network access).

SELECT cur.seq, cur.title, cur.link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>') AS cur ANTI
JOIN feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><item><title>First Post</title><link>https://query.farm/first</link></item></channel></rss>') AS prev ON cur.link = prev.link
ORDER BY cur.seq;
3 more examples

Fetch a public RSS URL over HTTP and return its first 25 entries in feed order (requires network access).

SELECT title, link, published
FROM feed.main.feed_items('https://hnrss.org/frontpage', timeout_ms := 5000, max_items := 25)
ORDER BY seq;
SELECT title, UNNEST(categories) AS category
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')
ORDER BY seq;
SELECT title, feed_type, language, item_count
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>');
Link
read_feed_copy (timeout_ms := BIGINT, max_items := BIGINT)

Import RSS, Atom, or JSON Feed items from a URL or file using COPY FROM

Named arguments
timeout_ms := BIGINT
HTTP timeout in milliseconds · default 15000
max_items := BIGINT
Maximum items; zero imports all items up to the safety limit · default 0
Returns columns
seq BIGINT
Zero-based position in the feed.
guid VARCHAR
Item ID, or empty when absent.
title VARCHAR
Item title.
link VARCHAR
Item URL.
published TIMESTAMP
Publish time in UTC; NULL when unavailable.
updated TIMESTAMP
Update time in UTC; NULL when unavailable.
author VARCHAR
Author name or email.
categories VARCHAR[]
Category names; empty list when absent.
summary VARCHAR
Item summary.
content VARCHAR
Full item content.
Returns columns · depends on the arguments
seq BIGINT
Zero-based position in the feed.
guid VARCHAR
Item ID, or empty when absent.
title VARCHAR
Item title.
link VARCHAR
Item URL.
published TIMESTAMP
Publish time in UTC; NULL when unavailable.
updated TIMESTAMP
Update time in UTC; NULL when unavailable.
author VARCHAR
Author name or email.
categories VARCHAR[]
Category names; empty list when absent.
summary VARCHAR
Item summary.
content VARCHAR
Full item content.
Link
write_atom_copy (title := VARCHAR, link := VARCHAR, description := VARCHAR, language := VARCHAR, author := VARCHAR)

Export SQL rows to a atom feed document using COPY TO

Named arguments
title := VARCHAR
Required feed title
link := VARCHAR
Required absolute HTTP or HTTPS home-page URL
description := VARCHAR
Feed description; required for RSS · default ""
language := VARCHAR
Feed language code · default ""
author := VARCHAR
Feed author name; defaults to the feed title for Atom · default ""
Link
write_jsonfeed_copy (title := VARCHAR, link := VARCHAR, description := VARCHAR, language := VARCHAR, author := VARCHAR)

Export SQL rows to a jsonfeed feed document using COPY TO

Named arguments
title := VARCHAR
Required feed title
link := VARCHAR
Required absolute HTTP or HTTPS home-page URL
description := VARCHAR
Feed description; required for RSS · default ""
language := VARCHAR
Feed language code · default ""
author := VARCHAR
Feed author name; defaults to the feed title for Atom · default ""
Link
write_rss_copy (title := VARCHAR, link := VARCHAR, description := VARCHAR, language := VARCHAR, author := VARCHAR)

Export SQL rows to a rss feed document using COPY TO

Named arguments
title := VARCHAR
Required feed title
link := VARCHAR
Required absolute HTTP or HTTPS home-page URL
description := VARCHAR
Feed description; required for RSS · default ""
language := VARCHAR
Feed language code · default ""
author := VARCHAR
Feed author name; defaults to the feed title for Atom · default ""
Link

COPY formats

Attaching feed also registers 4 file formats for DuckDB's own COPY statement, so you can load files into local tables and write query results out to files without a function call. The FORMAT name starts with the ATTACH alias — feed with the Quick start above; use yours if you attach it under another name.

FORMAT 'feed.atom'

COPY … TO · export

COPY atom feed. Export feed items to a worker-local file, preserving query order.

copy.sql
-- Write a query's rows out to a file
COPY (SELECT * FROM my_table) TO 'out.atom' (FORMAT 'feed.atom');

Options

Pass these inside the COPY statement's parentheses, after FORMAT. Unknown options are rejected.

titleVARCHAR
Required feed title
linkVARCHAR
Required absolute HTTP or HTTPS home-page URL
descriptionVARCHAR
Feed description; required for RSS
languageVARCHAR
Feed language code
authorVARCHAR
Feed author name; defaults to the feed title for Atom
Full reference
Generate a atom feed

Export atom using COPY TO a worker-local file. Source columns are matched by feed_items column names and types. title and link options are required; RSS also requires description. Optional language and author describe the feed. Use ORDER BY to choose item order. Missing item IDs are generated deterministically; Atom dates default to the export time.

Input and output

Alias and cast source columns to the item schema; subsets are supported. This is a sink with no result columns. DuckDB reports the COPY row count. Every item needs title, summary, or content; Atom requires a title. Empty input produces a valid empty feed.

Example
COPY (SELECT 'First post' AS title, 'https://example.com/1' AS link)
TO '/tmp/posts.feed' (FORMAT 'feed.atom', title 'Posts', link 'https://example.com', description 'Recent posts');
Limits

Only worker-local destinations are supported. Buffered input and encoded output are limited to 64 MiB, and exports to one million items. The destination is replaced after successful encoding.

FORMAT 'feed.auto'

COPY … FROM · import

COPY auto feed. Import feed items from an HTTP(S) URL or a worker-local file; columns map by name.

copy.sql
-- Load a file into an existing local table
COPY my_table FROM 'data.auto' (FORMAT 'feed.auto');

Options

Pass these inside the COPY statement's parentheses, after FORMAT. Unknown options are rejected.

timeout_msBIGINT
HTTP timeout in milliseconds
max_itemsBIGINT
Maximum items; zero imports all items up to the safety limit
Full reference
Import feed items

Import auto feed items using COPY FROM an HTTP(S) URL or worker-local file. Target columns must be a subset of feed_items columns with matching names and types. timeout_ms defaults to 15000; max_items defaults to 0 (all items). Documents over 64 MiB or over one million items are rejected.

Column mapping

The destination table chooses the output schema. Use any subset of the item columns, in any order, with matching types. Dates are plain TIMESTAMP; categories are VARCHAR[]. Unknown columns and incompatible types are errors.

Example
CREATE TABLE headlines (title VARCHAR, link VARCHAR);
COPY headlines FROM 'https://hnrss.org/frontpage' (FORMAT 'feed.auto', timeout_ms 5000);

Local file paths refer to the worker's filesystem, including for remote workers.

FORMAT 'feed.jsonfeed'

COPY … TO · export

COPY jsonfeed feed. Export feed items to a worker-local file, preserving query order.

copy.sql
-- Write a query's rows out to a file
COPY (SELECT * FROM my_table) TO 'out.jsonfeed' (FORMAT 'feed.jsonfeed');

Options

Pass these inside the COPY statement's parentheses, after FORMAT. Unknown options are rejected.

titleVARCHAR
Required feed title
linkVARCHAR
Required absolute HTTP or HTTPS home-page URL
descriptionVARCHAR
Feed description; required for RSS
languageVARCHAR
Feed language code
authorVARCHAR
Feed author name; defaults to the feed title for Atom
Full reference
Generate a jsonfeed feed

Export jsonfeed using COPY TO a worker-local file. Source columns are matched by feed_items column names and types. title and link options are required; RSS also requires description. Optional language and author describe the feed. Use ORDER BY to choose item order. Missing item IDs are generated deterministically; Atom dates default to the export time.

Input and output

Alias and cast source columns to the item schema; subsets are supported. This is a sink with no result columns. DuckDB reports the COPY row count. Every item needs title, summary, or content; Atom requires a title. Empty input produces a valid empty feed.

Example
COPY (SELECT 'First post' AS title, 'https://example.com/1' AS link)
TO '/tmp/posts.feed' (FORMAT 'feed.jsonfeed', title 'Posts', link 'https://example.com', description 'Recent posts');
Limits

Only worker-local destinations are supported. Buffered input and encoded output are limited to 64 MiB, and exports to one million items. The destination is replaced after successful encoding.

FORMAT 'feed.rss'

COPY … TO · export

COPY rss feed. Export feed items to a worker-local file, preserving query order.

copy.sql
-- Write a query's rows out to a file
COPY (SELECT * FROM my_table) TO 'out.rss' (FORMAT 'feed.rss');

Options

Pass these inside the COPY statement's parentheses, after FORMAT. Unknown options are rejected.

titleVARCHAR
Required feed title
linkVARCHAR
Required absolute HTTP or HTTPS home-page URL
descriptionVARCHAR
Feed description; required for RSS
languageVARCHAR
Feed language code
authorVARCHAR
Feed author name; defaults to the feed title for Atom
Full reference
Generate a rss feed

Export rss using COPY TO a worker-local file. Source columns are matched by feed_items column names and types. title and link options are required; RSS also requires description. Optional language and author describe the feed. Use ORDER BY to choose item order. Missing item IDs are generated deterministically; Atom dates default to the export time.

Input and output

Alias and cast source columns to the item schema; subsets are supported. This is a sink with no result columns. DuckDB reports the COPY row count. Every item needs title, summary, or content; Atom requires a title. Empty input produces a valid empty feed.

Example
COPY (SELECT 'First post' AS title, 'https://example.com/1' AS link)
TO '/tmp/posts.feed' (FORMAT 'feed.rss', title 'Posts', link 'https://example.com', description 'Recent posts');
Limits

Only worker-local destinations are supported. Buffered input and encoded output are limited to 64 MiB, and exports to one million items. The destination is replaced after successful encoding.

Try these queries

Count the items in an inline feed.

SELECT count(*) AS items
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>');

Uses feed_items

Read feed-level metadata: title, detected format, language, and item count.

SELECT title, feed_type, language, item_count
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>');

Uses feed_info

Find the entries that are new since an earlier snapshot of the same feed by anti-joining the current feed_items against the snapshot's feed_items on link (returns Second Post; no network access).

SELECT cur.seq, cur.title, cur.link
FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>') AS cur ANTI
JOIN feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><item><title>First Post</title><link>https://query.farm/first</link></item></channel></rss>') AS prev ON cur.link = prev.link
ORDER BY cur.seq

Uses feed_items

Break a feed's entries down by category: join feed_info (feed title and reported item_count) to the UNNESTed categories from feed_items to get each category's entry count and its share of the feed (news 2 entries = 1.0, release 1 = 0.5; no network access).

SELECT f.title AS feed_title, c.category, count(*) AS entries,
  round(count(*) / f.item_count, 2) AS share_of_feed
FROM feed.main.feed_info('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>') AS f
CROSS JOIN (SELECT UNNEST(categories) AS category FROM feed.main.feed_items('<rss version="2.0"><channel><title>Query Farm Sample Feed</title><link>https://query.farm/</link><description>A small RSS feed used by vgi-feed examples</description><language>en-us</language><item><title>First Post</title><link>https://query.farm/first</link><category>news</category><category>release</category><description>The first sample entry</description></item><item><title>Second Post</title><link>https://query.farm/second</link><category>news</category><description>The second sample entry</description></item></channel></rss>')) AS c
GROUP BY f.title, f.item_count, c.category
ORDER BY entries DESC, c.category

Uses feed_infofeed_items

Browse every feed in the registry with its URL, format, and topic.

SELECT name, url, feed_type, category
FROM feed.main.feed_registry
ORDER BY name

Uses feed_registry

Find the feed URLs published in JSON Feed format.

SELECT name, url
FROM feed.main.feed_registry
WHERE feed_type = 'json'
ORDER BY name

Uses feed_registry

5 more examples in the Catalog, each listed under the table or function it uses.

Feed 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.