substats

substats

跨平台社交媒体订阅者统计无服务器API

substats是一个基于Cloudflare Workers的无服务器API,用于统计多个社交媒体和内容平台的关注者数量。它通过简单的HTTP请求接口支持多个数据源,并可与shields.io集成生成动态徽章。目前处于2.0版本beta阶段,该项目为开发者和内容创作者提供了一种简便方式来展示和追踪其在线影响力。

substatsAPI关注者统计服务集成徽章生成Github开源项目
<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编码,如果您请求feedlyinoreaderfeedspub路由时请记住这一点。

制作徽章 🎫

当然可以!事实上,substats与shields.io/dynamic路由配合得很好。下面这些徽章都是使用substats的数据动态生成的: GitHub Telegram 微博 少数派 爱发电 即刻 Steam 知乎 哔哩哔哩 掘金 [语雀 你可以使用我们的徽章生成器在 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, }, ] } ] }

因此,我们提供的 datapathrewards.0.details.2.mora。(我特意选择了这个数据,因为它包含一个数组,用来演示如何通过索引引用数组中的 mora 值。)

你提供的 endpoint 响应会使用 object-path 进行解析,构建引用响应中值的 datapath 的方法是相同的。

在这里试试我们的 /common 路由 API URL 生成器:substats.swo.moe/common

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格式外,大多数更新都在底层进行。

  • 使用TypeScript重构。
  • 更新至CloudFlare的模块式workers。
  • Worker现在使用esbuild而非webpack构建,速度更快!
  • 已废弃对Newsblur的支持~~(似乎没人使用)~~。
  • 现在支持KV存储,包括instagram在内的一些路由依赖此功能来存储cookies(仍在开发中)。
  • 2.0版本中的缓存功能已移植到模块式workers,一如既往地受到支持。
  • 新的文档和查询构建器。

如果你正在寻找2.0版本中的多源和查询功能 - 它仍在重构中,因为itty-router无法解析多个查询参数,暂时阻碍了这项功能的实现。在我们等待期间,你仍可以使用1.0版本的路由。v1.0版本的README和文档(已废弃)

贡献

这是一个由pnpm管理的monorepo。./worker目录包含Cloudflare Worker模块,而./docs是一个用于文档的React网站(由ViteChakra 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>

编辑推荐精选

扣子-AI办公

扣子-AI办公

职场AI,就用扣子

AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!

堆友

堆友

多风格AI绘画神器

堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。

图像生成热门AI工具AI图像AI反应堆AI工具箱AI绘画GOAI艺术字堆友相机
码上飞

码上飞

零代码AI应用开发平台

零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。

Vora

Vora

免费创建高清无水印Sora视频

Vora是一个免费创建高清无水印Sora视频的AI工具

Refly.AI

Refly.AI

最适合小白的AI自动化工作流平台

无需编码,轻松生成可复用、可变现的AI自动化工作流

酷表ChatExcel

酷表ChatExcel

大模型驱动的Excel数据处理工具

基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。

AI工具使用教程AI营销产品酷表ChatExcelAI智能客服
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
AIWritePaper论文写作

AIWritePaper论文写作

AI论文写作指导平台

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

数据安全AI助手热门AI工具AI辅助写作AI论文工具论文写作智能生成大纲
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

热门AI工具AI办公办公工具智能排版AI生成PPT博思AIPPT海量精品模板AI创作
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

下拉加载更多