JSON Feed Specification
repository·master·Indexed 21 days ago
https://github.com/manton/jsonfeedDocumentation and resources for the JSON Feed specification, including version 1.1 technical details, mapping guides for RSS and Atom, and best practices for publishers and readers. Includes official graphics, JSON schema information, and a directory of language libraries and CMS plugins.
What's inside JSON Feed
- JSON Feed is a web standard for providing content feeds in JSON format. It is designed as a simpler, more developer-friendly alternative to XML-based formats like RSS and Atom. It is currently at version 1, which is designed to be stable and backward-compatible.
Find implementations and libraries for JSON Feed
masterThe JSON Feed ecosystem includes various implementations across multiple programming languages and content management systems. You can find libraries for parsing and generating feeds, as well as plugins for static site generators and CMS platforms.
Key categories include:
- CMS Plugins: WordPress, Drupal, Craft CMS, Movable Type, Pelican, Eleventy, and Metalsmith.
- Static Site Generators: Jekyll, Hugo, Pelican, and MkDocs.
- Language Libraries:
- Go:
st3fan/jsonfeed,kr/jsonfeed,gopherlibs/jsonfeed. - Rust:
jsonfeed,feed-rs,json-feed-model. - PHP:
php-json-feed,jdecool/jsonfeed,feed-io. - Ruby:
feedparsergem,feedjiragem. - Swift:
totocaster/JSONFeed,wesbillman/JSONFeed. - C#:
gramgibson/jsonfeed,DanRigby/JsonFeed.NET. - Python:
jsonfeedvalidator. - Scala:
chobeat/scala-json-feed. - Perl5:
JSON::Feed.
- Go:
- Converters: Tools to convert RSS/Atom to JSON Feed (e.g.,
feed2json.org) or JSON Feed to Atom/RSS.
Understand the purpose of the JSONFeed repository
masterThis repository serves as the source for the JSONFeed.org website. It contains the Markdown files and supporting resources used to build the site, but it does not contain the actual rendered website or the hosting infrastructure.How to add extensions to a JSON Feed
masterYou can add custom data to a JSON Feed by using objects with keys that start with an underscore (
_).Rules for extensions:
- The extension name must start with
_followed by a letter (e.g.,_blue_shed). - The extension name and its member keys must not contain any
.(dot) characters. - Member keys should be alphanumeric (emojis are allowed).
- It is good practice to include an
aboutkey in the extension to provide a URL explaining the custom schema for humans. - Feed readers that do not recognize the extension must ignore it.
"_blue_shed": { "about": "https://blueshed-podcasts.com/json-feed-extension-docs", "explicit": false, "copyright": "1948 by George Orwell", "owner": "Big Brother and the Holding Company", "subtitle": "All shouting, all the time. Double. Plus. Good." }- The extension name must start with
Use the `hubs` array for real-time notifications
masterTo allow feed aggregators to subscribe to changes immediately rather than polling, use the top-level
hubsarray. This array points to services that can send notifications to an application as soon as the feed is updated.typefield: Describes the protocol used (e.g.,rssCloudorWebSub).- WebSub: When using the WebSub protocol, the JSON Feed's
feed_urlshould be passed as thehub.topicparameter.
Subscribe to real-time notifications using hubs
masterTo avoid inefficient polling, JSON Feed supports real-time notifications via a top-level
hubsarray. This array contains services that feed aggregators can subscribe to. When the feed updates, the hub sends a notification to the application.- The
typefield in the hub object specifies the protocol (e.g.,rssCloudorWebSub). - For
WebSub, the JSON Feed'sfeed_urlshould be passed as thehub.topicparameter.
- The
Guidelines for building JSON Feed readers
masterWhen developing a feed reader, follow these pragmatic rules for handling data:
- Invalid JSON: Do not attempt to parse or use partial data from invalid JSON.
- Missing IDs: Mandatory. Any
itemwithout anidmust be discarded. Without a unique identifier, it is impossible to track changes or prevent duplicate entries. - Missing MIME types: If an
attachmentis missing amime_type, you can attempt to infer it from the file suffix or the browser's download response. - Malformed Dates: If
date_publishedcannot be parsed, you may substitute the date the reader parsed the item. - URL Selection: Use the
urlfield as the default link (as it is a permalink). If anexternal_urlis present, you may offer the user a choice or prioritize it in the UI. - Efficiency: Use Conditional GET to minimize bandwidth and CPU usage.
Access the JSONFeed specification versions
masterThe JSONFeed specification (both current and historical versions) is maintained within thepages/version/directory of this repository. If you are looking for the technical details of how to implement a JSON Feed, refer to the files in that folder.Implement custom extensions in JSON Feeds
masterPublishers can include custom data in a JSON Feed using extension objects. To ensure compatibility, follow these rules:
- Naming: The extension name must start with an underscore (
_) followed by a letter (e.g.,_blue_shed). - Constraints: The extension name and its member keys must not contain any
.(period) characters. Member keys should be alphanumeric. - Location: Extensions can appear anywhere in the feed (top-level or within items).
- Documentation: It is recommended to include an
aboutstring within the extension object to explain its purpose to humans. This is optional but helpful. - Compatibility: Feed readers that do not recognize an extension must ignore it.
Example extension:
"_blue_shed": { "about": "https://blueshed-podcasts.com/json-feed-extension-docs", "explicit": false, "copyright": "1948 by George Orwell", "owner": "Big Brother and the Holding Company", "subtitle": "All shouting, all the time. Double. Plus. Good." }- Naming: The extension name must start with an underscore (
Map RSS Item elements to JSON Feed
masterRSS
itemobjects map to JSON Feeditems. Follow these specific transformations:title$\rightarrow$title(Must be plain text in JSON Feed)link$\rightarrow$url(the permalink to the content) ANDexternal_url(if the item is a link to another page, e.g., a linkblog)description$\rightarrow$content_htmlORcontent_text(choose based on content type)guid$\rightarrow$idauthor(single value) $\rightarrow$author(object withname,url, andavatar)pubDate$\rightarrow$date_published(Convert to RFC 3339 format, e.g.,2010-02-07T14:04:00-05:00)enclosure$\rightarrow$attachmentsarray. Map attributes as follows:url$\rightarrow$urllength$\rightarrow$size_in_bytestype$\rightarrow$mime_type- (JSON Feed also allows adding
titleandduration_in_seconds)
category$\rightarrow$tags(Note: RSSdomainattributes have no equivalent in JSON Feed)
Map Atom Entry elements to JSON Feed
masterAtom
entryobjects map to JSON Feeditems. Use the following mappings:title$\rightarrow$title(Must be plain text)id$\rightarrow$idsummary$\rightarrow$summary(Must be plain text)- Content mapping based on Atom
typeattribute:type="html"ortype="xhtml"$\rightarrow$content_htmltype="text"$\rightarrow$content_text
link(withrel="alternate") $\rightarrow$urllink(withrel="related") $\rightarrow$external_urlauthor(containingname,uri,email) $\rightarrow$author(object withname,url, andavatar)published$\rightarrow$date_published(Both use RFC 3339)updated$\rightarrow$date_modified(Both use RFC 3339)link(withrel="enclosure") $\rightarrow$attachmentsarray. Map attributes as follows:href$\rightarrow$urllength$\rightarrow$size_in_bytestype$\rightarrow$mime_type- (JSON Feed also allows adding
titleandduration_in_seconds)
Use JSON Feed graphics on your site
masterYou can use the official JSON Feed graphics (created by Craig Hockenberry) when linking to your JSON Feed to help users visually identify the content type. The graphics include a symbol and a specific color scheme designed for recognition, similar to the RSS icon. You are permitted to modify the images to suit your site's design, but it is recommended to maintain the core symbol and color scheme to ensure user understanding.