当前公开版本
路径固定在 /api/public/v1,方便其他项目稳定集成。
面向其他项目复用 Fitbit 本地缓存数据。接口按版本路径输出,分成完整缓存数据集、轻量趋势序列、公开仪表盘摘要和可直接嵌入的 SVG 图表,不开放创建、授权、删除等管理操作。
路径固定在 /api/public/v1,方便其他项目稳定集成。
所有示例链接都基于当前可公开访问的首个档案生成。
既可以拿结构化数据,也可以直接嵌入趋势图资源。
如果你是第一次接入,先拿公开档案列表,再读某个档案的 catalog 或 dashboard。这样能最快确认你的项目需要哪个数据域,再决定是否读取完整数据集或轻量趋势。
先拿所有可公开读取的 profile,再决定用哪个档案做集成。
GET http://fitbit.lucius7.dev/api/public/v1/profiles
先用 catalog 看睡眠、活动、恢复、体征、生活和账户各自的数据状态。
GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/catalog
前端图表或其他服务只需要少量时间序列时,改用 series 或 SVG。
GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/series/daily?metrics=sleep_score,steps,hrv&limit=30
接口按“数据地图、完整缓存、轻量趋势、摘要卡片、表格、快照、图表”分层。这样其他项目可以先确认数据域状态,再按体积和场景选择。
适合复用 FitBaus 中文健康页的数据结构,包含 overview、coverage、stats、charts、tables。
/catalog 按健康数据域返回状态、覆盖、核心指标和来源,适合先做接入判断。
/datasets 取结构化缓存,/series 取轻量时间序列,两者职责明确。
/snapshot 用来复用 Fitbit 元数据,/charts/*.svg 适合直接嵌入页面或报告。
布局按最常用的调用路径重新整理,不再只靠几块示例卡片展示。每组给出主入口和用途,方便你快速定位到正确层级。
GET http://fitbit.lucius7.dev/api/public/v1返回 API 索引和公开文档链接。GET http://fitbit.lucius7.dev/api/public/v1/profiles返回公开档案列表和快捷链接。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7返回单个公开档案的概要信息、覆盖范围和可调用链接。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/catalog返回按数据域整理的 catalog,适合先看结构和质量。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/dashboard返回完整公开 dashboard 数据,适合页面复用。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/datasets列出所有可用 dataset。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/datasets/activity?limit=120读取活动历史缓存。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/datasets/sleep?limit=120读取睡眠历史缓存。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/datasets/daily?limit=90读取服务端聚合后的日趋势数据。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/series/daily?metrics=sleep_score,steps,hrv&limit=30返回轻量级日趋势序列。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/sections返回 body、vitals、lifestyle、account 摘要卡片。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/tables返回 sleep、activity、devices 等表格结构。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/metrics返回页面指标卡和趋势信息。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/snapshot返回净化后的 Fitbit 快照缓存。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/snapshot/endpoints/profile读取某个 Fitbit 快照端点。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/charts/overview-trend.svg直接返回预置趋势图 SVG。GET http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/charts/series.svg?granularity=daily&metrics=sleep_score,hrv,rhr&limit=30按粒度和指标自定义轻量 SVG 走势。趋势、数据集和 SVG 图都支持轻量参数控制。这里单独列出来,避免你在文档正文里来回找。
daily、weekly、monthly。light 与 transparent。给其他前端项目或服务端脚本接入时,最常用的通常就是这几类:公开档案、完整 dashboard、轻量 series、完整 dataset 和 SVG 图表。
curl "http://fitbit.lucius7.dev/api/public/v1/profiles" curl "http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/dashboard"
curl "http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/series/daily?metrics=sleep_score,steps,hrv&limit=30" curl "http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/datasets/activity?limit=120" curl "http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/snapshot/endpoints/profile"
curl "http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/charts/overview-trend.svg" curl "http://fitbit.lucius7.dev/api/public/v1/profiles/Lucius7/charts/series.svg?granularity=daily&metrics=sleep_score,hrv,rhr&limit=30"
GET http://fitbit.lucius7.dev/api/public/v1/openapi.json GET http://fitbit.lucius7.dev/api/public/v1/docs.md