Skip to content

OPML import and export

Bring subscriptions in from Inoreader (or any feed reader), and take them out again (SI-525). Code: opml.ts and import-jobs.ts. In the app: Import and export (/settings/import).

Import

  1. Read the file. Each outline with an xmlUrl is a feed, and the folder it’s in becomes a tag. Inoreader lists a feed once per folder, so the listings are merged into one feed with several tags. Nested folders give only the innermost folder as a tag. Feeds on youtube.com/feeds/videos.xml become youtube sources (SI-526), everything else rss. Outlines without a feed URL, or with a URL that isn’t http(s), are reported as invalid, and the rest is imported.
  2. Subscribe. A feed the user already follows is skipped, but its missing tags are added. Feeds that moved since the file was exported count too: a source keeps its old URLs after a permanent redirect (config.previousUrls). A feed another user follows shares its source. The OPML title becomes the subscription’s title, so names given in the old reader stay. Nothing from the file is written to the source itself: sources are shared, so their title and site come from the feed, not from one user’s upload. “Keep folders as tags” can be turned off.
  3. First fetch. Sources that have never been fetched are fetched right away, in the background, within the fetcher’s limits (feeds.md). The page shows the progress and lists the failed feeds and the invalid entries.

The subscriptions are saved before the import answers. The progress lives in memory, and only the last 5 imports per user are kept. A restart during the first fetch loses the progress, but not the subscriptions. Sources not fetched yet are picked up by the scheduler within minutes (scheduler.md).

Measured on 2026-11-12 with the Inoreader export (2,086 outlines, 1,021 feeds, 32 folders): the import took 0.75 s. The first fetch took 155 s: 993 OK, 28 failed, 21,911 items. Importing the same file again adds nothing.

BODY_SIZE_LIMIT is 5M in the image. That export is 448 KB, close to adapter-node’s default limit of 512 KB.

YouTube subscriptions from Google Takeout (subscriptions.csv) import the same way: youtube.md.

Export

GET /api/v1/opml (the “Download OPML” link) returns OPML 2.0. Each tag is a folder, and a subscription with several tags appears in each of them, as in Inoreader. Subscriptions without tags are at the top level. Importing the file gives the same feeds, titles and tags. A test checks this, and so did a run with the real Inoreader data. JSON APIs, web pages and added links aren’t feeds and stay out of the file. A GitHub repository’s releases are exported as the repository’s page, which Hotaru imports as its releases again; other readers can’t read it (source-types.md).

API

GET /api/v1/opml The user’s subscriptions as an OPML file
POST /api/v1/opml Import: the OPML as the body, or a multipart field file. ?tags=false leaves out the folders, and ?fetch=false skips the first fetch. Also takes Google Takeout’s YouTube subscriptions.csv. Answers 202 with the job, or 400 if the file is neither. Needs a session or a write token
GET /api/v1/imports/:id The job and its progress. 404 if it doesn’t exist, isn’t yours, or the server has restarted since

In the SDK: exportOpml(), importOpml(opml, { keepTags, fetch }) and importJob(id).