商品条码查询PRO API 接入文档barcode-gs1
官方权威的商品条码查询接口,数据直通中国物品编码中心官方注册数据库。 与 `barcode-lookup` 定位不同: - 本接口**官方权威**:返回厂商注册名称、产品登记信息、上市日期、官方商品图等可追溯的官方数据 - 本接口**仅覆盖国内注册条码**(6/690 开头),进口商品或非注册条码会返回 found=false - 适合合规核验、溯源、上架审核等对数据权威性要求高的场景 支持输入格式:8 / 12 / 13 / 14 位纯数字,或 16 位 AI(01) 前缀 + GTIN-14。 返回数据包含:产品名称、品牌、通用名、分类(含分类编号)、规格、净含量、上市日期、厂商企业名、官方商品图、条码激活日期、产品创建日期、企业注册日期、已用天数等核心字段,部分情况下额外提供生产国、企业地址、参考售价、厂商识别代码等扩展字段。
1. 基本信息
| 接口地址 | https://v1.apizero.cn/api/barcode-gs1 |
|---|---|
| 请求方法 | GET |
| 分类 | life |
| 提供方 | 极数本源 |
| 计费模式 | 按次付费 · 月套餐 |
| 单次消耗 | 0 积分 |
| 起步价 | ¥0.00 / 1000 次 |
| QPS 限制 | 2 req/s |
| 每日免费额度 | 20 次(已认证用户) |
| 匿名每日额度 | 20 次(无 API Key) |
| VIP 免费 | 是 |
| 调用次数 |
2. 认证
可匿名调用(每天 20 次),传 API Key 后每天 20 次免费额度 + 付费套餐;响应缓存 24h
获取 API Key:登录 https://apizero.cn/account/keys
3. 请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
code | string | 是 | 商品条形码(8/12/13/14 位纯数字,或 16 位 AI(01) 前缀 + GTIN-14) | 6921168509256 |
4. 请求头
| Header | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
Authorization | string | 否 | 登录用户传 API Key 享用更高额度;匿名调用每天 20 次免费 | — |
5. 请求示例
以下 5 种语言示例都是可直接运行的,只需把 YOUR_API_KEY 替换为实际 Key。
cURL
curl "https://v1.apizero.cn/api/barcode-gs1?code=6921168509256&key=YOUR_API_KEY"Python
import requests
resp = requests.get(
"https://v1.apizero.cn/api/barcode-gs1",
params={
"code": "6921168509256",
"key": "YOUR_API_KEY",
},
timeout=15,
)
resp.raise_for_status()
print(resp.json())JavaScript (Node.js)
// Node.js 18+ / 浏览器原生 fetch
const params = new URLSearchParams({
"code": "6921168509256",
"key": "YOUR_API_KEY",
});
const res = await fetch(`https://v1.apizero.cn/api/barcode-gs1?${params}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://v1.apizero.cn/api/barcode-gs1", nil)
q := req.URL.Query()
q.Set("code", "6921168509256")
q.Set("key", "YOUR_API_KEY")
req.URL.RawQuery = q.Encode()
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}PHP
<?php
$url = "https://v1.apizero.cn/api/barcode-gs1?" . http_build_query([
"code" => "6921168509256",
"key" => "YOUR_API_KEY",
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$body = curl_exec($ch);
curl_close($ch);
$data = json_decode($body, true);
print_r($data);6. 响应字段
| 字段 | 类型 | 说明 | 示例 |
|---|---|---|---|
barcode | string | 13 位标准 EAN-13 条码 | — |
gtin14 | string | 14 位 GTIN(左侧补 0 标准化) | — |
found | boolean | 是否在 GS1 中国数据库找到;false 时其余业务字段为 null | — |
registered | boolean | 条码是否已在中国物品编码中心正式注册 | — |
registration_message | string | 注册状态说明文本 | — |
name | string | 完整产品名(含品牌+规格) | — |
brand | string | 品牌名称 | — |
general_name | string | 产品通用名(如"奶酪(易腐坏)") | — |
feature | string | 产品特征描述 | — |
category | string | 产品分类(含 GPC 分类编号,如"奶酪(易腐坏)(10000028)") | — |
specification | string | 规格(如 90克 / 550ml) | — |
net_content | string | 净含量 | — |
sale_date | string | 上市日期(YYYY-MM-DD) | — |
manufacturer | string | 发布企业名称(官方注册主体) | — |
images | string[] | 官方商品图 URL 数组(gds.org.cn 域名) | — |
qr_active_date | string | 二维码激活日期(YYYY年MM月DD日) | — |
product_create_date | string | 产品信息创建日期(YYYY年MM月DD日) | — |
company_register_date | string | 企业在编码中心的注册日期(YYYY年MM月DD日) | — |
use_days | integer | 条码从登记到现在已用天数 | — |
country | string | 生产国 / 产地(部分备源提供,主源可能为 null) | — |
address | string | 企业地址(部分备源提供,主源可能为 null) | — |
price | string | 参考售价(部分备源提供,主源可能为 null) | — |
category_code | string | GPC 全球品类编码 / 厂商识别代码(部分源提供) | — |
7. 响应示例
{
"code": 0,
"msg": "成功",
"data": {
"barcode": "6907992700199",
"gtin14": "06907992700199",
"found": true,
"registered": true,
"registration_message": "该商品条码已经在中国物品编码中心注册,编码信息已按规定通报。",
"name": "伊利儿童奶酪棒香草冰淇淋味再制干酪",
"brand": "伊利",
"general_name": "奶酪(易腐坏)",
"feature": "伊利儿童奶酪棒香草冰淇淋味再制干酪",
"category": "奶酪(易腐坏)(10000028)",
"specification": "90克",
"net_content": "90克",
"sale_date": null,
"manufacturer": "内蒙古伊利实业集团股份有限公司",
"images": [
"https:\/\/www.gds.org.cn\/userfile\/uploada\/gra\/sj201210093039959369\/06907992700199\/06907992700199.1.jpg"
],
"qr_active_date": null,
"product_create_date": "2019年11月18日",
"company_register_date": null,
"use_days": 2366,
"country": null,
"address": null,
"price": null,
"category_code": null
},
"request_id": "mp0vcq0fab827132"
}8. 错误码
| code | status | 说明 |
|---|---|---|
4000 | — | 缺少 code 参数,或条码格式非法(非 8/12/13/14 位数字) |
4029 | — | 调用过快,请降低 QPS |
4030 | — | 今日免费额度已用完(匿名每天 20 次 / 登录每天 20 次) |
5020 | — | 商品编码中心暂不可用或触发限流 |
5021 | — | 上游返回格式异常 |
5030 | — | 商品编码代理未配置(管理员侧问题) |
9. 变更日志
- 2.0.0(2026-05-11)
- 本地命中第 10/20/30... 次时自动后台调上游拉最新数据,高频条码自动保鲜,响应字段补全:补充 country / address / price / category_code 等扩展字段(部分源提供),免责声明完善:新增完整法律免责条款,明确数据归属、知识产权、责任豁免边界
- 1.0.0(2026-05-08)
- 首次上线
常见问题
商品条码查询PRO 接口怎么免费使用?
未登录用户每个 IP 每天 20 次免费。登录用户创建 API Key 后每天 20 次免费,超额部分按点数计费(0 点/次)。
商品条码查询PRO 支持哪些调用方式?
接口使用 GET 请求。文档提供 cURL、Python、JavaScript (Node.js)、Go、PHP 五种语言的可运行示例。也可以下载 /openapi.json 导入 Postman / Insomnia / Apifox 反向生成 SDK。
调用不限额么? QPS 是多少?
本接口 QPS 限制 2 req/s,每个 API Key 每日免费 20 次。需要更高额度可升级 VIP 套餐或联系售后提高 QPS。
这个接口跟自己直连上游有什么区别?
极数本源 作为中间层提供:统一鉴权(一个 Key 调所有接口)、统一计费(点数制)、统一限流、统一错误码、多上游自动切换。免去逐个对接上游、维护 Key、统计调用量的运维成本。