Skip to content

GET /api/keepa/lightningdeal

获取 Amazon Lightning Deals(限时秒杀):可按 ASIN 查询单条 deal,也可按站点拉取全量进行中 / 即将开始的秒杀清单。

对应 Keepa 官方接口:Lightning Deals

接口

GET https://mcp.keepamore.com/api/keepa/lightningdeal

计费

模式units
传入 asin1 unit / 次
不传 asin(站点全量)500 units / 次(响应体 10–20 MB)
  • state / type 等过滤参数 不会 改变计费金额
  • 全量请求建议每天最多调用 1–2 次,并把结果缓存在你自己的存储里

参数(Query String)

名称类型必填默认约束说明
domaininteger1–12站点 ID,参见 domain 映射。也可用 domainId / country 别名
asinstring10 位字母数字指定商品则仅返回该 ASIN 的 deal(自动 uppercase)
statestring见下表按 deal 状态过滤
typestring按 Keepa deal 类型过滤

state 枚举

AVAILABLE / UPCOMING / WAITLIST / SUSPENDED / CANCELED / EXPIRED / SOLDOUT

服务端会对单条 ASIN 查询设置 60 秒超时;全量查询设置 120 秒超时。客户端建议至少 180 秒。

响应

json
{
	"code": "0000",
	"msg": "ok",
	"data": {
		"lightningDeals": [
			{
				"asin": "B08N5WRWNW",
				"dealId": "76fbc441",
				"dealState": "AVAILABLE",
				"title": "...",
				"dealPrice": 2999,
				"currentPrice": 4299,
				"percentOff": 30,
				"percentClaimed": 23,
				"startTime": 7234567,
				"endTime": 7234627,
				"isPrimeEligible": true,
				"isFulfilledByAmazon": true
			}
		],
		"fromCache": false
	}
}

lightningDeals[] 每个元素的完整字段(变体 variation / dealState 全部取值 / 评分等)见 Lightning Deal ObjectstartTime / endTime 单位为 KeepaTime 分钟

示例

bash
# 请将 km_xxx 替换为你的 API Key
# 单 ASIN
curl "https://mcp.keepamore.com/api/keepa/lightningdeal?domain=1&asin=B08N5WRWNW" \
  -H "X-API-Key: km_xxx"

# 全量进行中的秒杀(⚠️ 500 units)
curl "https://mcp.keepamore.com/api/keepa/lightningdeal?domain=1&state=AVAILABLE" \
  -H "X-API-Key: km_xxx"
js
// 请将 km_xxx 替换为你的 API Key
// 单 ASIN
const resp = await fetch(
	"https://mcp.keepamore.com/api/keepa/lightningdeal?domain=1&asin=B08N5WRWNW",
	{ headers: { "X-API-Key": "km_xxx" } },
);
console.log(await resp.json());

// 全量秒杀(注意:500 units)
const resp2 = await fetch(
	"https://mcp.keepamore.com/api/keepa/lightningdeal?domain=1&state=AVAILABLE",
	{ headers: { "X-API-Key": "km_xxx" } },
);
console.log(await resp2.json());
python
# 请将 km_xxx 替换为你的 API Key
import requests

URL = "https://mcp.keepamore.com/api/keepa/lightningdeal"
HEADERS = {"X-API-Key": "km_xxx"}

# 1) 单 ASIN(1 unit)
r1 = requests.get(URL, params={"domain": 1, "asin": "B08N5WRWNW"},
                  headers=HEADERS, timeout=180)
print(r1.json())

# 2) 全量秒杀(⚠️ 500 units)
r2 = requests.get(URL, params={"domain": 1, "state": "AVAILABLE"},
                  headers=HEADERS, timeout=180)
print(r2.json())
php
<?php
// 请将 km_xxx 替换为你的 API Key
require 'vendor/autoload.php';
use GuzzleHttp\Client;

$client = new Client();
$resp = $client->get('https://mcp.keepamore.com/api/keepa/lightningdeal', [
    'headers' => ['X-API-Key' => 'km_xxx'],
    'query'   => ['domain' => 1, 'asin' => 'B08N5WRWNW'],
    'timeout' => 180,
]);
echo $resp->getBody();
java
// 请将 km_xxx 替换为你的 API Key(Java 11+ 标准库)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://mcp.keepamore.com/api/keepa/lightningdeal?domain=1&asin=B08N5WRWNW"))
    .header("X-API-Key", "km_xxx")
    .timeout(Duration.ofSeconds(180))
    .GET()
    .build();
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
go
// 请将 km_xxx 替换为你的 API Key(Go 标准库 net/http)
package main

import (
    "fmt"
    "io"
    "net/http"
    "time"
)

func main() {
    req, _ := http.NewRequest("GET",
        "https://mcp.keepamore.com/api/keepa/lightningdeal?domain=1&asin=B08N5WRWNW", nil)
    req.Header.Set("X-API-Key", "km_xxx")

    client := &http.Client{Timeout: 180 * time.Second}
    resp, err := client.Do(req)
    if err != nil { panic(err) }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

典型配方

场景建议参数units
监控某 ASIN 是否在做秒杀asin=B0...1
抓取站点全部进行中的秒杀state=AVAILABLE(不传 asin500
提前抓即将开始的秒杀state=UPCOMING(不传 asin500

deal 的区别

  • Lightning Deals:Amazon 官方秒杀栏目,短时窗口
  • Deals(browse_deals):Keepa 综合打折追踪,覆盖更广

和 MCP 的对应