AliExpress 商品列表爬虫 API
最后更新: · REST · JSON
发送 GET https://api.scrapier.io/api/v2/aliexpress-listings-scraper/?urls=airpods max,并在 X-API-Key 请求头中带上你的密钥,即可以 JSON 格式获得一页商品列表。每页商品列表 10 积分;失败的调用免费。
- 每页商品列表 10 积分
- 失败的调用免费
- 没有速率限制
调用 AliExpress 商品列表爬虫 API
在你自己的应用、脚本或智能体中使用 AliExpress 商品列表爬虫 API。你需要一个 Scrapier 账号,以及控制台中的 API 密钥。选择一种语言。
import requests# Replace YOUR_API_KEY with the key from your Scrapier dashboardAPI_KEY = "YOUR_API_KEY"params = { "urls": "airpods max", "currency": "USD", "region": "US", "locale": "en_US", "enrich_pdp": "false",}r = requests.get( "https://api.scrapier.io/api/v2/aliexpress-listings-scraper/", headers={"X-API-Key": API_KEY}, params=params, timeout=210,)r.raise_for_status()# The result sits under data.productsresult = r.json()["data"]["products"]print(result)
// Replace YOUR_API_KEY with the key from your Scrapier dashboardconst API_KEY = "YOUR_API_KEY";const params = new URLSearchParams({ urls: "airpods max", currency: "USD", region: "US", locale: "en_US", enrich_pdp: "false",});const res = await fetch(`https://api.scrapier.io/api/v2/aliexpress-listings-scraper/?${params}`, { headers: { "X-API-Key": API_KEY }, signal: AbortSignal.timeout(210_000),});if (!res.ok) throw new Error(`HTTP ${res.status}`);const { data } = await res.json();console.log(data.products);
# One GET request. The key goes in a header, never in the URL.GET /api/v2/aliexpress-listings-scraper/?urls=airpods max¤cy=USD®ion=US&locale=en_US&enrich_pdp=false HTTP/1.1Host: api.scrapier.ioX-API-Key: YOUR_API_KEYAccept: application/json
# Scrapier publishes an OpenAPI spec that covers every endpoint. No API key needed.curl -O https://api.scrapier.io/api/v2/openapi.json# Import openapi.json into Postman, Insomnia, Bruno or a code generator,# then add your key as the X-API-Key header.
# 1. Add the Scrapier MCP server to Claude Codeclaude mcp add -t http scrapier https://mcp.scrapier.io/mcp --header "X-API-Key: YOUR_API_KEY"# 2. Ask your agent. It finds the endpoint with search_endpoints# and calls it with run_scrape:"Get AliExpress listings for airpods max and rank them by discount percentage"run_scrape("aliexpress-listings-scraper", {urls: "airpods max"})
Python 版 AliExpress 商品列表爬虫 API
只需普通的 requests,无需 SDK。每个响应都是类型化 JSON。
安装
JavaScript 版 AliExpress 商品列表爬虫 API
可在 Node 18+、Deno、Bun 和边缘运行时中使用内置的 fetch。
检查你的环境
HTTP 版 AliExpress 商品列表爬虫 API
一次 GET 请求。认证只需一个 X-API-Key 请求头。
检查你的环境
AliExpress 商品列表爬虫 API 的 OpenAPI 定义
下载一次规范,然后导入到你已在使用的工具中。获取它无需密钥。
下载规范
通过 MCP 使用 AliExpress 商品列表爬虫 API
同一个端点可作为 Claude Code、Cursor 和 Windsurf 的工具调用。相同的 urls,每页商品列表同样 10 积分。
安装
其他调用方式
AliExpress 商品列表爬虫 API 交互式试用
编辑请求,观察代码更新,然后运行。没有密钥时它显示目录示例,不计费。使用你的密钥时,它会从浏览器发出真实调用;密钥只会发送到 api.scrapier.io,从不存储。
GET /api/v2/aliexpress-listings-scraper/?urls=airpods max点击运行请求发送。没有密钥时你得到的是目录示例。
失败的调用不计费。
无论输入什么,示例都相同:它展示的是响应结构,而不是你输入的账户。
示例响应,目录示例,2026 年11月 28 日
{
"success": true,
"data": {
"urls": "airpods max",
"from_url": "https://www.aliexpress.com/w/wholesale-airpods-max.html",
"page": 1,
"page_size": 59,
"products": [
{
"id": "3256809114515630",
"title": "Apple AirPods Max Lightning to 3.5mm AUX Audio Cable",
"productType": "natural",
"price": 90.82,
"originalPrice": 100.91,
"discountPercentage": 9,
"currency": "USD",
"inStock": true,
"imageUrl": "https://ae-pic-a1.aliexpress-media.com/kf/Sa675ec812e10487f826d374868481fa9B.jpg",
"additionalImages": [
"https://ae-pic-a1.aliexpress-media.com/kf/S912db5d305db43e88942cff2d7add1dcC.jpg"
],
"rating": null,
"totalSold": "8 sold",
"store": null,
"sellingPoints": [],
"input_url": "https://www.aliexpress.com/w/wholesale-airpods-max.html",
"search_url": "https://www.aliexpress.com/w/wholesale-airpods-max.html",
"scraped_at": "2026-09-15T08:41:52.827Z"
}
],
"next_cursor": "eyJxIjoiYWlycG9kcyBtYXgiLCJwIjoyLCJsayI6e30sInMiOlsiMzI1NjgwOTExNDUxNTYzMCJdfQ"
}
}你可以提取的数据
AliExpress 商品列表爬虫会读取搜索、类别或商品 URL,或搜索普通关键词,并将每条商品列表返回为一行:标题、价格、原价、折扣、货币、库存标记、图片和销量文本。下面每个字段都来自目录中的示例响应,以带类型的 JSON 呈现。
房源
响应中有 3 个字段。
- id
- title
- productType
价格和库存
响应中有 5 个字段。
- price
- originalPrice
- discountPercentage
- currency
- inStock
图片和详情
响应中有 6 个字段。
- imageUrl
- additionalImages
- rating
- totalSold
- store
- sellingPoints
来源
响应中有 3 个字段。
- input_url
- search_url
- scraped_at
响应结构与分页
响应中有 6 个字段。
- success
- data.urls
- data.from_url
- data.page
- data.page_size
- data.next_cursor
响应结构参考
示例响应中的每个字段。字段名每次调用都保持不变。
| 字段 | 类型 | 示例 | 说明 |
|---|---|---|---|
products.id | string | "3256809114515630" | AliExpress 商品 ID |
products.title | string | "Apple AirPods Max Lightning to 3.5mm AUX Au…" | 房源标题 |
products.productType | string | "natural" | 类型标签,示例中为 natural |
products.price | number | 90.82 | 当前价格(数字) |
products.originalPrice | number | 100.91 | 折扣前价格 |
products.discountPercentage | integer | 9 | 数字形式的折扣百分比 |
products.currency | string | "USD" | 货币代码,例如 USD |
products.inStock | boolean | true | 库存标记 |
products.imageUrl | string | "https://ae-pic-a1.aliexpress-media.com/kf/S…" | 主图 URL |
products.additionalImages | array | 1 items | 更多图片 URL 列表 |
products.rating | null | null | 评分;示例中为 null |
products.totalSold | string | "8 sold" | 销量文本,例如 8 sold |
products.store | null | null | 店铺信息;示例中为 null |
products.sellingPoints | array | [] | 卖点列表;示例中为空 |
products.input_url | string | "https://www.aliexpress.com/w/wholesale-airp…" | 该行数据来源的 URL |
products.search_url | string | "https://www.aliexpress.com/w/wholesale-airp…" | 使用的 AliExpress 搜索 URL |
products.scraped_at | string | "2026-09-15T08:41:52.827Z" | 该行被抓取的 UTC 时间 |
success | boolean | true | 每个 200 响应都为 true |
data.urls | string | "airpods max" | 你的输入,原样返回 |
data.from_url | string | "https://www.aliexpress.com/w/wholesale-airp…" | 读取的 AliExpress 页面 |
data.page | integer | 1 | 本次响应的页码 |
data.page_size | integer | 59 | 页面上的商品列表数 |
data.next_cursor | string | "eyJxIjoiYWlycG9kcyBtYXgiLCJwIjoyLCJsayI6e30…" | 作为 cursor 传回即可获取下一页;最后一页为 null |
请求参数参考
| 名称 | 类型 | 必填 | 默认值 | 说明 | 示例 |
|---|---|---|---|---|---|
urls | string | 是 | — | AliExpress 搜索、类别或商品 URL,或普通关键词。每次调用一个。首次调用必填。别名:url、searchUrls、search_urls、query、q、keyword | airpods max |
cursor | string | 否 | — | 原样传回上一个响应的 data.next_cursor,即可获取下一页;null 表示最后一页 | — |
currency | string | 否 | USD | 商店货币,默认 USD。锁定在游标中 | USD |
region | string | 否 | US | 收货地区代码,默认 US。锁定在游标中 | US |
locale | string | 否 | en_US | 商店区域设置,默认 en_US。锁定在游标中 | en_US |
enrich_pdp | boolean | 否 | false | 尽力获取店铺和库存详情,默认 false。AliExpress 可能拦截此步骤。锁定在游标中 | true |
use_proxy | boolean | 否 | true | 通过 Scrapier 的住宅代理池路由,默认开启。保持原样即可 | true |
raw_data | boolean | 否 | false | 在 raw_responses 下返回原始上游载荷,而不是格式化后的条目 | true |
每次调用一个 URL 或关键词:要搜索十次,就调用十次,并用 cursor 分别翻页。布尔值是字符串 true 或 false。
AliExpress 商品列表爬虫 API 的分页
AliExpress 商品列表爬虫 API 分页返回结果。把 data.next_cursor 作为 cursor 传回即可获取下一页;当它为 null 时就没有更多了。每次成功调用,无论是第一页还是后续页,都是 10 积分。
无需登录 AliExpress 即可访问
AliExpress 商品列表爬虫 API 不需要 AliExpress 账号、登录或会话 cookie。你在 X-API-Key 请求头中发送 Scrapier 密钥,就能拿到 JSON。它只读取公开数据:任何访客无需登录就能看到的内容。
速度、成本和并发
| 指标 | 数值 | 来源 |
|---|---|---|
| 成功调用的成本 | 10 积分 | Scrapier 目录 |
| 失败调用的成本 | 0 积分 | 任何非 2xx 响应 |
| 每个密钥的并行请求数 | 无限制 | 所有套餐均无速率限制 |
| 建议的客户端超时 | 210 秒 | Scrapier 文档,适用于每个端点 |
AliExpress 商品列表爬虫 API 的延迟
Scrapier 不公布该端点的延迟或成功率数据。每次调用都在调用时读取 AliExpress,所以响应时间取决于 AliExpress 和结果的大小。请按文档对每个端点的建议,把客户端超时设为 210 秒。
端点的限制
AliExpress 商品列表爬虫 API 的真实限制。
- 仅限公开数据。
- 失败的调用,例如商品列表页缺失或不可用,会返回非 2xx 状态,并消耗 0 积分。
- 数据在调用时实时读取。
- 没有速率限制,因此需要多少并行请求,就发多少。
- 较大的结果分页返回;把
data.next_cursor作为cursor传回。 - AliExpress 没有显示的字段不会返回。
Scrapier 与官方 AliExpress API 对比
如果你需要完全定制的爬虫,或已经运行自己的抓取技术栈,自建能提供更多控制;Scrapier 适合想用一个密钥、一种 JSON 结构覆盖多个平台的团队。
| 功能 | Scrapier AliExpress 爬虫 | 自建 AliExpress 抓取 |
|---|---|---|
| 所需权限 | 一个 Scrapier API 密钥 | 你自己的代理、解析器和服务器 |
| 哪些数据 | 按 URL 或关键词获取商品列表 | 你的解析器提取到什么就是什么 |
| 返回的字段 | 每条商品列表 17 个字段,包括价格、折扣、库存和图片 | 你构建并维护什么就是什么 |
| 设置 | 注册,复制密钥,发送请求 | 编写选择器,处理封锁和重试 |
| 成本 | 每次成功调用 10 积分,每 1,000 次调用低至 $1.20 | 代理、服务器和工程时间 |
错误与重试处理
| 状态 | 含义 | 是否计费 | 解决办法 |
|---|---|---|---|
| 200 | 在 data.products 中返回的商品列表数据页 | 是 | — |
| 400 | 输入有误或缺失 | 否 | 请检查 urls:每次调用一个值 |
| 401 | 缺少 X-API-Key 请求头 | 否 | 添加该请求头 |
| 402 | 积分用完(响应体含 balance) | 否 | 充值;重试无济于事 |
| 403 | API 密钥无效或已撤销 | 否 | 在控制台中检查密钥 |
| 429 | 被限流 | 否 | 等待 Retry-After 秒后重试 |
| 5xx | 上游故障或超时 | 否 | 退避重试;把客户端超时设为 210 s |
来自错误参考。任何非 2xx 响应消耗 0 积分。
AliExpress 商品列表爬虫 API 的重试逻辑
import time, requests def get_listings(value, key, tries=5): for attempt in range(tries): r = requests.get( "https://api.scrapier.io/api/v2/aliexpress-listings-scraper/", headers={"X-API-Key": key}, params={"urls": value}, timeout=210, ) if r.status_code == 429: time.sleep(int(r.headers.get("Retry-After", 2 ** attempt))) elif r.status_code >= 500: time.sleep(2 ** attempt) else: r.raise_for_status() return r.json() raise RuntimeError("gave up after retries")
价格与速率限制
| 套餐 | 月费 | 包含的商品列表页数 | 每 1,000 次成本 |
|---|---|---|---|
| Hobby | $29 | 15,000 | $1.93 |
| Pro | $79 | 50,000 | $1.58 |
| Scale | $299 | 250,000 | $1.20 |
AliExpress 商品列表爬虫 API 的计费规则
AliExpress 商品列表爬虫 API 按每个成功获取的商品列表页收取 10 积分。失败的调用(即任何非 2xx 状态)消耗 0 积分。所有套餐都没有速率限制。付费前可以先用免费额度试用。
批量查询与 CSV
urls 每次调用只接受一个值。对于列表,循环并行调用(没有速率限制),然后把每一行展平为一行 CSV。
import csv, requests from concurrent.futures import ThreadPoolExecutor values = ["airpods max"] # your list def fetch(value): r = requests.get( "https://api.scrapier.io/api/v2/aliexpress-listings-scraper/", headers={"X-API-Key": "YOUR_API_KEY"}, params={"urls": value}, timeout=210, ) r.raise_for_status() out = r.json()["data"]["products"] return out if isinstance(out, list) else [out] # no rate limits: use as many workers as you need with ThreadPoolExecutor(max_workers=3) as pool: rows = [row for part in pool.map(fetch, values) for row in part] cols = ["title", "price", "originalPrice", "discountPercentage", "currency", "inStock"] with open("out.csv", "w", newline="") as f: w = csv.DictWriter(f, fieldnames=cols, extrasaction="ignore") w.writeheader() w.writerows(rows)
从 AliExpress 商品列表爬虫 API 导出 CSV
title,price,originalPrice,discountPercentage,currency,inStock Apple AirPods Max Lightning to 3.5mm AUX Audio Cable,90.82,100.91,9,USD,true
通过 MCP 供 AI 智能体访问
AliExpress 商品列表爬虫 API 的 MCP
AI 智能体可以通过位于 https://mcp.scrapier.io/mcp 的 Scrapier MCP 服务器使用同一个端点。一条命令即可在 Claude Code 中注册:claude mcp add -t http scrapier https://mcp.scrapier.io/mcp --header "X-API-Key: YOUR_API_KEY"。智能体用 search_endpoints 找到该端点,并用 run_scrape 和端点 id aliexpress-listings-scraper 调用。它接受相同的 urls 输入,每页商品列表同样 10 积分。各客户端的设置见 AliExpress 商品列表爬虫 MCP 页面。
按角色划分的集成路径
n8n 和 Make
- 添加一个 HTTP Request 步骤
- 带上你的
X-API-Key请求头,对该端点发送 GET - 把
data.products字段映射到你的列
循环并翻页
智能体中的 MCP 工具
在 Claude、Cursor 或 Windsurf 中,用端点 aliexpress-listings-scraper 调用 run_scrape。设置见 MCP 页面。
CSV 和展平的 JSON
把每一行展平为一行 CSV,每个字段一列,可直接用于 Sheets、Excel 或 BI 工具。
法律与合规说明
在许多国家,抓取公开的网页通常是合法的,但具体取决于你收集什么、你在哪里以及如何使用。在美国,hiQ Labs v. LinkedIn 是公开数据抓取中被引用最多的案例。Scrapier 只返回任何访客无需登录就能看到的数据。商品列表包含的个人数据很少,不过店铺详情可能识别出卖家。根据 GDPR 及类似法律,你存储和使用任何个人数据的方式必须遵守当地数据保护规定,同时适用 AliExpress 的条款。如果你的用例涉及批量存储,请咨询法律顾问。这不构成法律建议;请参阅我们的使用条款。
常见问题
有 AliExpress 商品列表爬虫 API 吗?
有。Scrapier 的 AliExpress 商品列表爬虫 API 只需向 /api/v2/aliexpress-listings-scraper/ 发送一次 GET 请求,并在 X-API-Key 请求头中带上密钥,就返回 JSON。不使用 AliExpress 登录。
如何从 Python 调用?
对上面显示的 <code>/api/v2/aliexpress-listings-scraper/</code> URL 使用 <code>requests.get</code>,将 <code>urls</code> 设为 <code>airpods max</code>,带上 <code>X-API-Key</code> 请求头和 210 秒超时,然后从 JSON 中读取 <code>data.products</code>。
调用失败时会怎样?
任何非 2xx 响应都免费。检查状态码,如果输入有误就修正,或稍后退避重试。没有速率限制。
多少钱?
每次成功调用 10 积分,无论页面包含多少内容。失败的调用免费。套餐:Hobby $29 含 150,000 积分,Pro $79 含 500,000,Scale $299 含 2,500,000。
有 OpenAPI 规范吗?
有。它无需密钥,涵盖 Scrapier 的所有端点,因此你可以将其导入 Postman、Insomnia 或代码生成器。
一次请求最长要多长时间?
该端点耗时较长,一次调用可能超过两分钟。客户端超时至少设为 210 秒。它无法通过 Scrapier 登录连接使用,请发送你的 API 密钥。