Feed validation library supporting Atom, RSS 2.0, and JSON Feed 1.1.
Validates feeds for:
Auto-detects feed format from content (XML root element or JSON structure).
Feed validation library supporting Atom, RSS 2.0, and JSON Feed 1.1. Validates feeds for: - Required elements per RFC 4287 (Atom), RSS 2.0 spec, or JSON Feed 1.1 - Valid date formats (RFC 3339 for Atom/JSON Feed, RFC 822 for RSS) - Feed freshness (updated/lastBuildDate timestamp) - URL validity - Semantic consistency (day-of-week in titles, Atom only) Auto-detects feed format from content (XML root element or JSON structure).
(detect-feed-format source)Detect feed format from content. Returns :atom, :rss, :json-feed, or :unknown.
Detect feed format from content. Returns :atom, :rss, :json-feed, or :unknown.
(parse-feed source)(parse-feed source {:keys [format]})Parse an Atom, RSS, or JSON Feed from string or input stream. Auto-detects format from content. Returns a map with feed data. Includes :format key (:atom, :rss, or :json-feed).
Options:
Parse an Atom, RSS, or JSON Feed from string or input stream. Auto-detects format from content. Returns a map with feed data. Includes :format key (:atom, :rss, or :json-feed). Options: - :format - Force format (:atom, :rss, or :json-feed), auto-detects if not specified
(parse-json-feed source)Parse a JSON Feed from JSON string or reader. Returns a Clojure map.
Parse a JSON Feed from JSON string or reader. Returns a Clojure map.
(valid? feed)(valid? feed opts)Quick check if a feed is valid. Returns true/false.
Quick check if a feed is valid. Returns true/false.
(validate-atom-feed feed)(validate-atom-feed feed
{:keys [semantic? strict?]
:or {semantic? true strict? false}})Validate an Atom feed specifically. Returns {:valid? bool :errors [...] :warnings [...] :feed map}.
Validate an Atom feed specifically. Returns {:valid? bool :errors [...] :warnings [...] :feed map}.
(validate-entry entry)(validate-entry entry
{:keys [semantic? strict?] :or {semantic? true strict? false}})Validate a single Atom entry. Returns {:valid? bool :errors [...] :warnings [...]}.
Arguments:
Options:
Example: (validate-entry {:title "Morning Brief: Thursday, June 19" :updated "2026-06-19T00:00:00Z" :id "urn:uuid:123"})
Validate a single Atom entry. Returns {:valid? bool :errors [...] :warnings [...]}.
Arguments:
- entry: A map with :id, :title, :updated, :links, etc.
Options:
- :semantic? - Enable semantic checks (default true)
- :strict? - Treat warnings as errors (default false)
Example:
(validate-entry {:title "Morning Brief: Thursday, June 19"
:updated "2026-06-19T00:00:00Z"
:id "urn:uuid:123"})(validate-feed feed)(validate-feed feed {:keys [format] :as opts})Validate a feed (Atom, RSS, or JSON Feed). Auto-detects format from content. Returns {:valid? bool :errors [...] :warnings [...] :feed map}.
Arguments:
Options:
Example: (validate-feed "<feed>...</feed>") ; Atom feed (validate-feed "<rss>...</rss>") ; RSS feed (validate-feed "{"version":...}") ; JSON Feed (validate-feed parsed-map {:semantic? false})
Validate a feed (Atom, RSS, or JSON Feed). Auto-detects format from content.
Returns {:valid? bool :errors [...] :warnings [...] :feed map}.
Arguments:
- feed: Either a parsed feed map, XML string/input-stream, or JSON string
Options:
- :semantic? - Enable semantic checks like day-of-week (default true, Atom only)
- :strict? - Treat warnings as errors (default false)
- :format - Force format (:atom, :rss, or :json-feed), auto-detects if not specified
Example:
(validate-feed "<feed>...</feed>") ; Atom feed
(validate-feed "<rss>...</rss>") ; RSS feed
(validate-feed "{\"version\":...}") ; JSON Feed
(validate-feed parsed-map {:semantic? false})(validate-json-feed feed)(validate-json-feed feed opts)Validate a JSON Feed. Returns {:valid? bool :errors [...] :warnings [...] :feed map}.
Arguments:
Options:
Example: (validate-json-feed "{"version":"https://jsonfeed.org/version/1.1",...}")
Validate a JSON Feed. Returns {:valid? bool :errors [...] :warnings [...] :feed map}.
Arguments:
- feed: Either a parsed feed map or JSON string
Options:
- :strict? - Treat warnings as errors (default false)
Example:
(validate-json-feed "{\"version\":\"https://jsonfeed.org/version/1.1\",...}")(validate-json-item item)(validate-json-item item opts)Validate a single JSON Feed item. Returns {:valid? bool :errors [...] :warnings [...]}.
Arguments:
Options:
Example: (validate-json-item {:id "1" :content_text "Hello world"})
Validate a single JSON Feed item. Returns {:valid? bool :errors [...] :warnings [...]}.
Arguments:
- item: A map with :id, :content_html/:content_text, etc.
Options:
- :strict? - Treat warnings as errors (default false)
Example:
(validate-json-item {:id "1" :content_text "Hello world"})Library version, read from POM at runtime.
Library version, read from POM at runtime.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |