{
 "openapi": "3.0.3",
 "info": {
  "title": "DeepSeekSite 独立站数据 API",
  "version": "0.1.0",
  "description": "已审核收录的独立站数据:价格带、折扣、政策、五维评分、技术栈、月度趋势。需要 API Key(免费试用见 https://deepseeksite.com/data-api)。每次调用计 1 次额度。"
 },
 "servers": [
  {
   "url": "https://api.deepseeksite.com"
  }
 ],
 "security": [
  {
   "bearer": []
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "API Key,以 dsk_ 开头"
   }
  }
 },
 "paths": {
  "/v1/meta": {
   "get": {
    "operationId": "getMeta",
    "summary": "数据集概览与可用筛选值",
    "description": "返回数据集规模、更新时间和可用的行业/平台/国家/技术栈取值。先调用它再筛选。",
    "parameters": [],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/sites": {
   "get": {
    "operationId": "searchSites",
    "summary": "搜索独立站",
    "description": "按行业、平台、国家、技术栈、评分、价格带筛选并排序。",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "description": "域名包含的关键字",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "industry",
      "in": "query",
      "description": "行业",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "platform",
      "in": "query",
      "description": "平台,如 shopify",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "description": "ISO 两位国家码",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 2
      }
     },
     {
      "name": "tech",
      "in": "query",
      "description": "使用的技术,如 Klaviyo",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "social_platform",
      "in": "query",
      "description": "只返回官方站点上发现了该社媒账号的店铺",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "instagram",
        "facebook",
        "tiktok",
        "youtube",
        "pinterest",
        "x"
       ]
      }
     },
     {
      "name": "min_score",
      "in": "query",
      "description": "综合评分下限 0-10",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "min_price",
      "in": "query",
      "description": "价格中位数下限",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "max_price",
      "in": "query",
      "description": "价格中位数上限",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "sort",
      "in": "query",
      "description": "排序字段",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "score",
        "traffic_rank",
        "products",
        "price",
        "newest"
       ]
      }
     },
     {
      "name": "order",
      "in": "query",
      "description": "排序方向",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "asc",
        "desc"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "返回条数,默认 20,最大 100",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100
      }
     },
     {
      "name": "offset",
      "in": "query",
      "description": "分页偏移",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/sites/{domain}": {
   "get": {
    "operationId": "getSite",
    "summary": "站点详情",
    "description": "价格带、折扣占比、退货期、包邮门槛、五维评分及依据(social 维度是营销工具成熟度,非社媒表现)、技术栈、官方社媒账号概要。",
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "description": "店铺域名,如 allbirds.com",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/sites/{domain}/snapshots": {
   "get": {
    "operationId": "getSiteHistory",
    "summary": "站点月度历史",
    "description": "最近至多 24 个月的月度快照。",
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "description": "店铺域名,如 allbirds.com",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/sites/{domain}/products": {
   "get": {
    "operationId": "getSiteProducts",
    "summary": "店铺商品样本",
    "description": "每站有数量上限的商品样本,非全量目录。",
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "description": "店铺域名,如 allbirds.com",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "on_sale",
      "in": "query",
      "description": "只看打折商品",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "返回条数,默认 20,最大 100",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100
      }
     },
     {
      "name": "offset",
      "in": "query",
      "description": "分页偏移",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/sites/{domain}/price-history": {
   "get": {
    "operationId": "getPriceHistory",
    "summary": "商品调价记录",
    "description": "价格变动记录,只在价格变化时记一条。",
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "description": "店铺域名,如 allbirds.com",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "条数,最大 500",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/compare": {
   "get": {
    "operationId": "compareSites",
    "summary": "对比 2-5 个站点",
    "description": "并排返回多个站点详情,不在数据集中的域名列在 meta.missing。",
    "parameters": [
     {
      "name": "domains",
      "in": "query",
      "description": "2 到 5 个域名,逗号分隔",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/stats": {
   "get": {
    "operationId": "getIndustryStats",
    "summary": "行业/平台/国家聚合统计",
    "description": "站点数、各维度平均分、价格中位数、折扣、政策中位数、平台分布、常用技术。",
    "parameters": [
     {
      "name": "industry",
      "in": "query",
      "description": "行业",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "platform",
      "in": "query",
      "description": "平台",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "description": "ISO 两位国家码",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/usage": {
   "get": {
    "operationId": "getMyUsage",
    "summary": "当前套餐与本月用量",
    "description": "",
    "parameters": [],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/sites/{domain}/social": {
   "get": {
    "operationId": "getSiteSocial",
    "summary": "站点社媒情况",
    "description": "官方社媒账号及聚合数字(粉丝数、近 30 天发帖数、历史)和 Reddit 提及聚合数;无帖子内容。数字覆盖不全(主要是部分 Instagram/TikTok/X 账号),多数账号只有链接;没发现账号不代表没有社媒。",
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "description": "店铺域名,如 allbirds.com",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完或 Key 过期"
     },
     "404": {
      "description": "域名不在数据集中"
     },
     "429": {
      "description": "超过每分钟限制"
     }
    }
   }
  },
  "/v1/assess": {
   "post": {
    "operationId": "assessSite",
    "summary": "按需评估任意独立站",
    "description": "对任意公网域名发起即时采集与评估(异步,通常 1-5 分钟)。3 天内评估过的域名直接复用结果,不占评估额度。返回任务 id,用 getAssessment 取结果。",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "domain"
        ],
        "properties": {
         "domain": {
          "type": "string",
          "description": "域名,如 example.com"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "202": {
      "description": "已受理,异步评估中"
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完、套餐不含评估或 Key 过期"
     },
     "404": {
      "description": "任务不存在"
     },
     "429": {
      "description": "超过频率或进行中任务数上限"
     }
    }
   },
   "get": {
    "operationId": "listAssessments",
    "summary": "最近 20 次评估与本月额度",
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "202": {
      "description": "已受理,异步评估中"
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完、套餐不含评估或 Key 过期"
     },
     "404": {
      "description": "任务不存在"
     },
     "429": {
      "description": "超过频率或进行中任务数上限"
     }
    }
   }
  },
  "/v1/assess/{id}": {
   "get": {
    "operationId": "getAssessment",
    "summary": "获取评估结果",
    "description": "status 为 pending/running 时未完成;设置 wait_seconds 可等待至完成或超时。",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "wait_seconds",
      "in": "query",
      "description": "最多等待秒数,最大 55",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 55
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功,响应为 {data, meta}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "202": {
      "description": "已受理,异步评估中"
     },
     "401": {
      "description": "Key 缺失或无效"
     },
     "402": {
      "description": "额度用完、套餐不含评估或 Key 过期"
     },
     "404": {
      "description": "任务不存在"
     },
     "429": {
      "description": "超过频率或进行中任务数上限"
     }
    }
   }
  }
 }
}