首页 › 关于 › 目录 API

目录 API v1

只读、无鉴权。这是对外契约:改字段名或删字段要升 v2。不是 WordPress.org API,也不是带查询参数的 REST。

根地址

生产根是 https://wpbridge.com/api/v1。本地预览走 /api/v1/。信封字段 api、version、kind、asof、data。

GET https://wpbridge.com/api/v1/info.json
GET https://wpbridge.com/api/v1/schema.json
GET https://wpbridge.com/api/v1/categories.json
GET https://wpbridge.com/api/v1/hosts.json
GET https://wpbridge.com/api/v1/tags.json
GET https://wpbridge.com/api/v1/plugins.json
GET https://wpbridge.com/api/v1/themes.json
GET https://wpbridge.com/api/v1/items/{host}/{owner}/{repo}.json
GET https://wpbridge.com/api/v1/blueprints/{host}/{owner}/{repo}.json

CLI

和 API 同一套字段。本机有仓库数据时读 data/,否则读上面的生产根。

python3 -m wpbridge info
python3 -m wpbridge search "git updater"
python3 -m wpbridge show github/afragen/git-updater
python3 -m wpbridge list --kind theme --limit 10
python3 -m wpbridge search "sage" --json
python3 -m wpbridge try github/solstice23/argon-theme
python3 -m wpbridge blueprint github/solstice23/argon-theme

内部索引

站点页面仍读 /data/*.min.json。那是采集脚本的工作文件,不是 v1 契约,字段可能随周变更。