<div align="center">
<img src="https://yellow-cdn.veclightyear.com/835a84d5/7bc6500f-38cb-4475-8440-57d2999f188e.png" alt="substats" />
<h3><a href="https://api.swo.moe/stats">substats</a></h3>
<p><a href="#开始使用">开始使用</a> · <a href="#最新动态">最新动态</a> · <a href="#赞助">赞助</a></p>
<p>( `д′) <em>我有多少粉丝?有多少!</em></p>
<img src="https://img.shields.io/badge/Cloudflare-F69652?style=flat&logo=cloudflare&logoColor=white" alt="Cloudflare Workers" />
<img src="https://img.shields.io/badge/Version-2.0*-F69652?style=flat&labelColor=2B3137" alt="Version 2.0/substats" />
<a href="https://github.com/spencerwooo/substats/actions?query=workflow%3ADeploy"><img src="https://github.com/spencerwooo/substats/workflows/Deploy/badge.svg" alt="Vercel" /></a>
</div>
开始使用
sub · stats /səb ˈ stats/
- 一个用于获取您在各种服务中粉丝数量的无服务器API
*版本2.0仍处于"测试阶段",并非所有功能都从1.0版本移植过来。详情请查看下方👇
基础用法
https://api.swo.moe
您的请求:
GET /stats/:source/:key
我的响应:
{
source: string,
key: string,
failed: true | false,
count: number | string // 当source不等于'common'时,通常是一个数字
}
没错,现在就是这么简单。;)
*注意,key
需要进行URL编码,如果您请求feedly
、inoreader
或feedspub
路由时请记住这一点。
制作徽章 🎫
当然可以!事实上,substats与shields.io
的/dynamic
路由配合得很好。下面这些徽章都是使用substats的数据动态生成的:
[
你可以使用我们的徽章生成器在 substats.swo.moe 轻松创建自己的徽章。

高级用法 - /common
路由 🍀
如果你想使用的数据源尚未被支持,但它只是一个简单的 GET
请求,你可以使用以下路由:
GET /stats/common?endpoint=<url>&datapath=<path>
例如:
GET /stats/common/?endpoint=https://api.genshin.dev/domains/cecilia-garden&datapath=rewards.0.details.2.mora
在这个例子中,endpoint
是一个 API 地址:
https://api.genshin.dev/domains/cecilia-garden
这个 URL 返回的响应看起来像这样:
{
"name": "仙跳墙",
"type": "锻造",
// ...
"rewards": [
{
"details": [
{ /* ... */ },
{ /* ... */ },
{
"mora": 1125,
},
]
}
]
}
因此,我们提供的 datapath
是 rewards.0.details.2.mora
。(我特意选择了这个数据,因为它包含一个数组,用来演示如何通过索引引用数组中的 mora
值。)
你提供的 endpoint
响应会使用 object-path 进行解析,构建引用响应中值的 datapath
的方法是相同的。
在这里试试我们的 /common
路由 API URL 生成器:substats.swo.moe/common。

支持的数据源
- 爱发电
- 哔哩哔哩
- 酷安
- Feedly
- FeedsPub
- GitHub
- Inoreader
- Instagram
- 即刻
- Mastodon
- Medium
- 网易云音乐
- Reddit
- 少数派
- Steam 游戏
- Steam 好友
- Telegram
- Twitter
- Unsplash
- 微博
- 中文维基百科
- 知乎
- 掘金
- 语雀
<a href="https://api.swo.moe/stats/afdian/afdian"><img src="https://yellow-cdn.veclightyear.com/835a84d5/f9d55ef9-2107-43d5-9eab-037feacbd3c2.png" width="auto" height="64px" alt="爱发电徽标" /></a>
<a href="https://api.swo.moe/stats/bilibili/401742377"><img src="https://yellow-cdn.veclightyear.com/835a84d5/be2e4e9a-5808-48c8-887e-4e520f125ea7.png" width="auto" height="64px" alt="哔哩哔哩徽标" /></a>
<a href="https://api.swo.moe/stats/coolapk/466253"><img src="https://yellow-cdn.veclightyear.com/835a84d5/006a1c9f-e05e-45a7-a3ce-500535b72bc8.png" width="auto" height="64px" alt="酷安徽标" /></a>
<a href="https://api.swo.moe/stats/feedly/https%3A%2F%2Fnnw.ranchero.com%2Ffeed.xml"><img src="https://yellow-cdn.veclightyear.com/835a84d5/f4d67eaa-926c-4219-bca9-afb808f9d5de.png" width="auto" height="64px" alt="Feedly徽标" /></a>
<a href="https://api.swo.moe/stats/feedspub/https%3A%2F%2Fnnw.ranchero.com%2Ffeed.xml"><img src="https://yellow-cdn.veclightyear.com/835a84d5/e297d965-1413-42f9-b94e-40961a6fdfb2.png" width="auto" height="64px" alt="FeedsPub徽标" /></a>
<a href="https://api.swo.moe/stats/github/spencerwooo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/1dd3713e-1028-4c61-82fb-3ee37da0e463.png" width="auto" height="64px" alt="GitHub徽标" /></a>
<a href="https://api.swo.moe/stats/inoreader/https%3A%2F%2Fnnw.ranchero.com%2Ffeed.xml"><img src="https://yellow-cdn.veclightyear.com/835a84d5/d86bbcdc-c36c-4d33-b106-b91b9efd4369.png" width="auto" height="64px" alt="Inoreader徽标" /></a>
<a href="https://api.swo.moe/stats/instagram/9gag"><img src="https://yellow-cdn.veclightyear.com/835a84d5/96cb4281-f180-4bb0-a687-4fd1bf56a77b.png" width="auto" height="64px" alt="Instagram徽标" /></a>
<a href="https://api.swo.moe/stats/jike/2204A477-38C8-4D9D-9705-9C9B990BE042"><img src="https://yellow-cdn.veclightyear.com/835a84d5/84e95ad0-7ec9-4e85-a3a6-268b1b5714ff.png" width="auto" height="64px" alt="即刻徽标" /></a>
<a href="https://api.swo.moe/stats/mastodon/oldpanda@mastodon.social"><img src="https://yellow-cdn.veclightyear.com/835a84d5/0ed46920-6712-40e9-8915-4cfcf6a43fdd.png" width="auto" height="64px" alt="Mastodon徽标" /></a>
<a href="https://api.swo.moe/stats/medium/SpencerWooo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/4dfe9aab-7cb8-4422-9609-f09a4aed837c.png" width="auto" height="64px" alt="Medium徽标" /></a>
<a href="https://api.swo.moe/stats/neteasemusic/416608258"><img src="https://yellow-cdn.veclightyear.com/835a84d5/cbe2f69b-f9ce-4b68-8bc9-9fa0875a0c22.png" width="auto" height="64px" alt="网易云音乐徽标" /></a>
<a href="https://api.swo.moe/stats/reddit/jushoro"><img src="https://yellow-cdn.veclightyear.com/835a84d5/29d053a4-5a8f-4d6b-b3bd-9f7f88174eac.png" width="auto" height="64px" alt="Reddit徽标" /></a>
<a href="https://api.swo.moe/stats/sspai/spencerwoo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/a9fc5a8a-a42d-48a4-bd01-57259a613804.png" width="auto" height="64px" alt="少数派徽标" /></a>
<a href="https://api.swo.moe/stats/steam/401742377"><img src="https://yellow-cdn.veclightyear.com/835a84d5/48673eb4-ae62-4f82-af25-40bbf090d9c7.png" width="auto" height="64px" alt="Steam徽标" /></a>
<a href="https://api.swo.moe/stats/telegram/realSpencerWoo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/d9eed5a6-fd3e-4dc5-b489-1c4b5a8578b4.png" width="auto" height="64px" alt="Telegram徽标" /></a>
<a href="https://api.swo.moe/stats/twitter/GenshinImpact"><img src="https://yellow-cdn.veclightyear.com/835a84d5/273734d0-ee92-470a-8c18-b9eb06bf313c.png" width="auto" height="64px" alt="Twitter徽标" /></a>
<a href="https://api.swo.moe/stats/unsplash/adamhoang"><img src="https://yellow-cdn.veclightyear.com/835a84d5/35022e59-4a96-453b-9bcf-54fdac96dbfd.png" width="auto" height="64px" alt="Unsplash徽标" /></a>
<a href="https://api.swo.moe/stats/weibo/5648729445"><img src="https://yellow-cdn.veclightyear.com/835a84d5/6499fe6d-76c6-4d39-9b16-e0315e28dc0d.png" width="auto" height="64px" alt="微博徽标" /></a>
<a href="https://api.swo.moe/stats/wikipediazh/ChenSimon"><img src="https://yellow-cdn.veclightyear.com/835a84d5/b7c97372-eddb-4ff7-a84d-16442df932a0.png" width="auto" height="64px" alt="维基百科徽标" /></a>
<a href="https://api.swo.moe/stats/zhihu/bi-xiao-tian-99"><img src="https://yellow-cdn.veclightyear.com/835a84d5/b50da002-40ad-4d15-899c-b5f359f27665.png" width="auto" height="64px" alt="知乎标志" /></a>
<a href="https://api.swo.moe/stats/juejin/1838039172387262"><img src="https://yellow-cdn.veclightyear.com/835a84d5/a65984b6-ecd5-452e-8145-72fe6b8de630.png" width="auto" height="64px" alt="掘金标志" /></a>
<a href="https://api.swo.moe/stats/yuque/lyndon"><img src="https://yellow-cdn.veclightyear.com/835a84d5/f86fa990-3e31-459f-9760-0a088febbb5c.png" width="auto" height="64px" alt="语雀标志" /></a>
有什么新变化?
是的,substats
现在已经是v2.0-beta
版本了!除了API格式外,大多数更新都在底层进行。
如果你正在寻找2.0版本中的多源和查询功能 - 它仍在重构中,因为itty-router
无法解析多个查询参数,暂时阻碍了这项功能的实现。在我们等待期间,你仍可以使用1.0版本的路由。v1.0版本的README和文档(已废弃)。
贡献
这是一个由pnpm
管理的monorepo。./worker
目录包含Cloudflare Worker模块,而./docs
是一个用于文档的React网站(由Vite和Chakra UI驱动)。详情请查看两个包的README.md文件。
赞助
开源工作很艰难!如果你恰好喜欢这个项目并希望我继续下去,请考虑赞助我或提供一次性捐赠!感谢所有的爱与支持!
🧸 请捐赠 - 微信/支付宝 · Patreon · 爱发电
许可证
MIT
<div align="center">
<img src="https://yellow-cdn.veclightyear.com/835a84d5/f1cf4508-1ed7-44ad-b0ec-0bc627c1180f.png" />
<em>由<a href="https://spencerwoo.com">spencer woo</a>用❤️制作</em>
</div>