API 文档
基于 API Key 的极干净 JSON 接口,剔除所有营销 HTML,返回 Agent 可直接消费的结构化数据。
如何获取 API Key
注册账号 → 登录 → 自助创建 API Key,整个流程无需人工审核,立即可用。
- 1. 在网站右上角点击「Sign up」注册账号(需企业邮箱)。
- 2. 使用邮箱和密码「Sign in」登录。
- 3. 进入「申请 API Key」页面,点击「创建 API Key」按钮。
- 4. 复制生成的 Key(明文仅显示一次,遗失需重新创建)。
- 5. 在请求头中携带 Authorization: Bearer <key> 即可调用所有 /api/v1/dev/* 接口。
api-key-flow
bash
# 1. 注册账号
curl -X POST "https://api.tikchip.cn/api/v1/auth/register" \
-H "Content-Type: application/json" \
-d '{"email":"you@company.com","password":"YourPass123","password_confirm":"YourPass123","company":"Your Company","username":"yourname"}'
# 2. 登录获取 JWT
curl -X POST "https://api.tikchip.cn/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"username":"you@company.com","password":"YourPass123"}'
# → 返回 data.token(JWT,用于后续管理接口)
# 3. 用 JWT 创建 API Key
curl -X POST "https://api.tikchip.cn/api/v1/dev/keys" \
-H "Authorization: Bearer <JWT>" \
-H "Content-Type: application/json" \
-d '{"name":"Production"}'
# → 返回 data.api_key(tk_xxx,仅显示一次,请立即保存)
# 4. 用 API Key 调用业务接口
curl -H "Authorization: Bearer <API_KEY>" \
"https://api.tikchip.cn/api/v1/dev/search?keyword=STM32"鉴权
在请求头中携带 Authorization: Bearer <key>,或使用 X-TikChip-Key。
curl
bash
curl -H "Authorization: Bearer $TIKCHIP_API_KEY" \
"https://api.tikchip.cn/api/v1/dev/search?keyword=STM32F103C8T6&in_stock_only=true"限流与配额
搜索类接口 60 次/分钟;submit_inquiry 默认每 Key 每日 20 次。超限返回 429 与 Retry-After。
429
http
HTTP/1.1 429 Too Many Requests
Retry-After: 12端点清单
全部端点位于 /api/v1/dev 前缀下,需 Agent API Key 鉴权。
| Tool | Method | Endpoint |
|---|---|---|
| search_components | GET | /api/v1/dev/search |
| get_component_detail | GET | /api/v1/dev/component/{mpn} |
| compare_components | POST | /api/v1/dev/compare |
| check_stock | GET | /api/v1/dev/stock |
| recommend_alternatives | GET | /api/v1/dev/alternatives |
| submit_inquiry | POST | /api/v1/dev/inquiry |
| register_b2b_account | POST | /api/v1/dev/register |
| get_inquiry_messages | GET | /api/v1/dev/inquiry/{id}/messages |
| reply_to_inquiry | POST | /api/v1/dev/inquiry/{id}/reply |
| list_inquiries | GET | /api/v1/dev/inquiries |
| get_bom_price | POST | /api/v1/dev/bom/price |
发现端点(无需 Key)
Agent 可自动读取以下公开端点识别本站能力。
discovery
http
GET /api/v1/dev/agent-card.json # Agent 版 robots(身份 / 能力 / 频率)
GET /api/v1/dev/manifest # 机器可读工具清单
GET /api/v1/dev/openapi # OpenAPI 3.0 文档- /api/v1/dev/agent-card.jsonAgent Card
- /api/v1/dev/manifest工具清单 Manifest
- /api/v1/dev/openapiOpenAPI 文档
