RSS 转 JSON API

把 RSS 2.0 / RSS 1.0 / Atom 订阅源解析成统一的 JSON;传入普通网页时自动查找页面声明的订阅源

数据来源:目标订阅源

返回统一的 JSON 格式 { code, message, cached, stale, updatedAt, data },支持跨域,免注册每天可免费调用 100 次,注册后每天 10000 次。

解析 RSS / Atom 订阅源

GET /api/rss

请求参数

  • url(必填):订阅源地址,或声明了订阅源的网页地址(http / https,只允许公网地址),示例 https://github.blog/feed/
  • limit:最多返回的条目数,1~100,示例 10
  • content:是否返回正文 HTML:true / false,示例 true

返回字段

  • url(string):请求的地址(规范化后)
  • feedUrl(string):实际解析的订阅源地址(跟随跳转后;自动发现时为页面声明的地址)
  • discovered(boolean):是否由网页 <link rel="alternate"> 自动发现的订阅源
  • format(string):订阅源格式:rss(RSS 2.0 / 0.9x)/ rdf(RSS 1.0)/ atom
  • version(string|null):版本号(RSS 取 version 属性,如 2.0;RDF、Atom 为 1.0);未声明时为 null
  • feed(object):订阅源信息
  • feed.title(string):订阅源标题
  • feed.description(string):订阅源描述(RSS description / Atom subtitle,纯文本);没有时为空字符串
  • feed.link(string|null):网站地址;没有时为 null
  • feed.language(string|null):语言(如 zh-CN);未声明时为 null
  • feed.updated(string|null):最后更新时间(ISO 8601);未声明时取第一条的发布时间,仍没有则为 null
  • feed.image(string|null):订阅源图标 / Logo 地址;没有时为 null
  • total(number):订阅源中的条目总数(limit 截取前)
  • truncated(boolean):订阅源是否超过 3MB 被截断(截断时只解析到已读取的部分)
  • items(array):条目列表,按订阅源中的顺序,最多 limit 条
  • items[].title(string):标题(纯文本)
  • items[].link(string|null):文章链接(绝对地址);没有时为 null
  • items[].author(string|null):作者(dc:creator / author / Atom 的 author.name);没有时为 null
  • items[].published(string|null):发布时间(ISO 8601,UTC);取 pubDate / dc:date / published / updated,无法解析时为 null
  • items[].summary(string):纯文本摘要(去掉 HTML 标签,最多 300 字,超出以 … 结尾)
  • items[].categories(array):分类 / 标签(去重)
  • items[].guid(string|null):唯一标识(RSS guid / Atom id);没有时为 null
  • items[].enclosure(object|null):附件(播客音频等);没有时为 null
  • items[].enclosure.url(string|null):附件地址(绝对地址)
  • items[].enclosure.type(string|null):附件 MIME 类型,如 audio/mpeg;未声明时为 null
  • items[].enclosure.length(number|null):附件大小(字节);未声明或为 0 时为 null
  • items[].content(string):正文 HTML 原文(content:encoded / Atom content,没有时用 description / summary;最多 20000 字符)。仅 content=true 时返回