npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

shopee-data-cli

v1.0.0

Published

Shopee 跨境商品数据 CLI 工具 — 采集、查询、导出、分析跨境电商商品数据

Readme

shopee-data-cli

npm version node license

Shopee 跨境商品数据 CLI 工具 — 采集、查询、导出、分析跨境电商商品数据。

配合 Chrome 插件自动采集 Shopee/1688 商品数据,通过 REST API 存储,CLI 管理全生命周期。

特性

  • 用户注册 / 登录,自动获取 API Key
  • 多项目数据隔离管理
  • 商品数据 CRUD + 批量推送 (upsert)
  • 关键词搜索 + 店铺过滤 + 时间范围筛选
  • 一键导出全部数据为 JSON
  • 支持中文、泰文等多语言搜索
  • 零依赖(仅 commander),Node.js >= 18 内置 fetch

安装

npm install -g shopee-data-cli

本地开发:

git clone https://github.com/dujiang/shopee-lab.git
cd shopee-lab/shopee-data-cli
npm install
npm link

快速开始

# 1. 配置 API 地址
shopee-data config --api-url https://your-api-server.com/data_api

# 2. 注册账号(自动获得 API Key + 默认项目)
shopee-data register [email protected] mypassword

# 3. 检查连接
shopee-data health

# 4. 查看数据
shopee-data data list

# 5. 搜索商品
shopee-data data search "JK"

# 6. 导出数据
shopee-data data export -o ./backup

命令一览

账号管理

| 命令 | 说明 | |------|------| | config [--api-url] [--api-key] [--show] | 查看/修改 CLI 配置 | | register <email> <password> | 注册新用户 (自动创建项目 + API Key) | | login <email> <password> | 登录 (自动保存 token + API Key) | | me | 查看当前登录用户 | | health | 检查 API 服务连接 |

项目与密钥

| 命令 | 说明 | |------|------| | projects | 列出所有项目 | | project:create <name> | 创建新项目 | | keys [--project <id>] | 列出 API Key | | key:create [--project <id>] [--name <n>] | 创建 API Key |

数据操作

| 命令 | 说明 | |------|------| | data shops | 列出所有店铺及商品数量 | | data list [options] | 列出数据 (分页/类型/关键词/店铺/时间) | | data get <id> | 获取单条完整数据 (JSON) | | data push <json_file> | 推送单条或批量数据 (upsert) | | data search <keyword> [options] | 搜索数据 (支持店铺/时间过滤) | | data delete <id> | 删除单条数据 | | data export [options] | 导出全部数据为 JSON 文件 |

数据查询选项

# 按店铺过滤
shopee-data data list --shop "NANA Shop"

# 按时间范围
shopee-data data list --from 2026-04-01 --to 2026-04-30

# 组合过滤
shopee-data data list --shop "suysuy" -q "袜子" --page 1 --per-page 10

# 导出特定店铺数据
shopee-data data export --shop "NANA Shop" -o ./nana-backup

配置文件

配置存储在 ~/.shopee-data-cli/config.json

{
  "apiUrl": "https://your-api-server.com/data_api",
  "token": "jwt-token...",
  "apiKey": "your-api-key",
  "email": "[email protected]"
}

系统要求

  • Node.js >= 18 (使用内置 fetch)
  • 后端 API 服务 (见 data-api)

许可证

MIT