快速开始 / 约 5 分钟
用 5 分钟接入一个 API。
5 分钟完成 Pontx Hub CLI 安装、API 搜索、接口参数检查、请求预览和统一 SDK 集成。
01搜索目录
pontx-hub search02预览请求
pontx-hub preview03通用调用
pontx-hub call04类型集成
@pontx/<api>01
安装统一 CLI
需要 Node.js 20 或更高版本。
pnpm add --global @pontx/hub-cli
pontx-hub --version只想先看看?网站无需安装,打开 API 目录即可完成同样的发现与预演流程。
02
搜索并检查
可以按能力、入参、出参或数据结构自然语言搜索。
- 1搜索你要做的事
需要把结果交给脚本时加上 --json。
- 2记下资源 ID
把结果中的 API、Endpoint 或 Schema ID 交给 show,就能继续查看详情。
pontx-hub search "把欧元换算成美元的接口" --locale zh --json
pontx-hub show endpoint:frankfurter/get-latest-rates
pontx-hub show schema:frankfurter/ExchangeRateResponse03
预演再调用
preview 会解析最终 URL、查询参数、脱敏请求头与请求体,但不会发送到供应商。
pontx-hub frankfurter preview 'Exchange Rates' getLatestRates --base USD
# Only call after the preview looks right.
pontx-hub frankfurter call 'Exchange Rates' getLatestRates --base USD04
进入 SDK 集成
确认接口后,查看运营方发布的准确包名与版本。
pontx-hub sdk frankfurter
pnpm add @pontx/frankfurter