开发者
API 参考
从任意 HTTP 客户端调用 SanDeals REST API:搜索优惠、浏览目录、读取站点元数据。
https://www.sandeals.net概览
REST API 返回与 MCP 服务器 相同的公开优惠目录。自然语言请求请使用 searchDeals,按分类浏览请使用 listDeals。结果仅包含目录中的数据;切勿给出响应中没有的优惠码或折扣。
https://www.sandeals.net/openapi.json。将 Authentication 设为 None。要调用的 operation 是 searchDeals。身份验证
无需 API 密钥或账户。请求是匿名的,API 为只读。响应允许跨域请求(Access-Control-Allow-Origin: *)。
速率限制
搜索端点与 MCP 服务器共享每个客户端每分钟 60 次请求的配额,以及每分钟的全局配额。超出配额的请求将返回 429 Too Many Requests,并附带以秒为单位的 Retry-After 响应头。请等待相应时间后再重试。
错误
错误使用标准 HTTP 状态码,并返回包含 ok: false 的 JSON 正文。
| 400 | 查询缺失或无效。 |
|---|---|
| 413 | 请求正文超过 16 KB。 |
| 429 | 已达到速率限制。请在 Retry-After 指定的秒数后重试。 |
| 503 | 搜索暂时不可用。请在 60 秒后重试。 |
在 SanDeals.net 搜索优惠
GET/api/search-advancedsearchDeals
搜索折扣码、优惠券和优惠。当用户想要 SanDeals 或电商平台的优惠或优惠券时使用。返回包含 title、href(优惠链接)、category 和 summary 的结构化 JSON。无需 API 密钥。
查询参数
| 名称 | 类型 | 说明 |
|---|---|---|
q必填 | string | 自然语言或关键词搜索,例如 coffee、giày、voucher、ưu đãi cafe最小长度 1 |
limit | integer | 最大结果数(1–50)。默认 10。1–50 · 默认 10 |
响应
| 200 | 结构化的优惠搜索结果AgentSearchResponse |
|---|---|
| 400 | 缺少查询ErrorResponse |
试一试
直接在浏览器中发送真实请求。修改参数后,选择“发送请求”。请求会计入每分钟 60 次的限制。
curl 'https://www.sandeals.net/api/search-advanced?q=coffee&limit=10'
{
"ok": true,
"query": "coffee",
"total": 1,
"results": [
{
"title": "Example Cafe",
"href": "https://slink.sandeals.net/example",
"category": "food",
"summary": "Example cafe deals",
"score": 13,
"source": "deals"
}
],
"response": "Found 1 deal for \"coffee\":\n1. Example Cafe — https://slink.sandeals.net/example",
"meta": {
"mode": "agent",
"language": "en",
"matched": true
}
}搜索优惠(POST,智能体模式)
POST/api/search-advancedsearchDealsPost
与 GET searchDeals 相同。发送 mode=agent 以获取结构化 JSON。ChatGPT Actions 建议使用 GET searchDeals。
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
query必填 | string | 搜索查询 |
mode | enum | 使用 agent 获取结构化结果agent · ui · 默认 agent |
limit | integer | 1–50 · 默认 10 |
响应
| 200 | 结构化的优惠搜索结果AgentSearchResponse |
|---|
试一试
直接在浏览器中发送真实请求。修改参数后,选择“发送请求”。请求会计入每分钟 60 次的限制。
curl -X POST 'https://www.sandeals.net/api/search-advanced' \
-H "Content-Type: application/json" \
-d '{"query":"coffee deals","limit":10,"mode":"agent"}'
{
"ok": true,
"query": "string",
"total": 1,
"results": [
{
"title": "string",
"href": "https://www.sandeals.net/",
"category": "string",
"summary": "string",
"score": 1,
"source": "deals"
}
],
"response": "string",
"meta": {
"mode": "string",
"language": "string",
"response_time_ms": 1,
"matched": true,
"fallback": true
}
}列出或筛选优惠目录
GET/api/dealslistDeals
按分类或关键词浏览 SanDeals 目录。当用户想要优惠列表或某个分类(food、shopping、tech)时使用。自然语言搜索建议使用 searchDeals。
查询参数
| 名称 | 类型 | 说明 |
|---|---|---|
category | enum | all · books · shopping · travel · food · tech · lifestyle · education · 默认 all |
search | string | 按 title/summary 关键词筛选优惠 |
q | string | search 的别名 |
limit | integer | 最大 200 · 默认 100 |
响应
| 200 | 优惠目录object |
|---|
试一试
直接在浏览器中发送真实请求。修改参数后,选择“发送请求”。请求会计入每分钟 60 次的限制。
curl 'https://www.sandeals.net/api/deals?category=all&limit=100'
{
"ok": true,
"deals": [
{
"title": "string",
"href": "string",
"category": "string",
"summary": "string"
}
],
"total": 1,
"categories": [
"string"
]
}获取 SanDeals 智能体发现元数据
GET/api/llmsgetSiteMetadata
返回站点功能、分类、智能体说明和 API 文档。如需在搜索前了解 SanDeals,请先调用此接口。
响应
| 200 | 供智能体使用的站点和 API 元数据object |
|---|
试一试
直接在浏览器中发送真实请求。修改参数后,选择“发送请求”。请求会计入每分钟 60 次的限制。
curl 'https://www.sandeals.net/api/llms'
{}数据结构
上述端点返回的对象。
DealResult
| 名称 | 类型 | 说明 |
|---|---|---|
title必填 | string | |
href必填 | string (uri) | 优惠 / 智能链接的 URL |
category必填 | string | |
summary | string | null | |
score | number | |
source | enum | deals · products |
Deal
| 名称 | 类型 | 说明 |
|---|---|---|
title | string | |
href | string | |
category | string | |
summary | string | null |
AgentSearchResponse
| 名称 | 类型 | 说明 |
|---|---|---|
ok必填 | boolean | |
query必填 | string | |
total必填 | integer | |
results必填 | DealResult[] | |
response | string | 简短易读的结果摘要 |
meta | object |
ErrorResponse
| 名称 | 类型 | 说明 |
|---|---|---|
ok | boolean | |
error | object | |
results | object[] | |
total | integer |
后续步骤
你已了解各个端点。接下来,连接智能体或导入规范。