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

pchome-api

v0.2.0

Published

PCHOME 的非官方 API 專案。

Readme

(非官方) PChome API

npm NPM GitHub Workflow Status

一套 Nodejs Package,可以透過 API 來完成自動訂購。

簡介

基本上能做到從加入購物車到結帳的流程,不支援線上付款但可以貨到付款。如果還需要其他文件需求,歡迎發 ISSUE 叫我更新。

APIs

  • snapup - 確認目前產品的狀態。
    照字面意思應該為加入購物車前的狀態確認,如果為可訂購狀態,會返回兩項資料 MACMACExpire,用來給 add2Cart API 使用。
  • add2Cart - 將產品加入購物車。
    給入產品 ID 和數量,例如「DYAPC0-A90084I39-000」,注意最後一部分是規格編號,通常不會在網址上出現。
  • getCartInfo - 取得購物車當前資訊。
  • order - 訂購。
    目前只支援貨到付款,倘若目前訂單不支援貨到付款則無法使用。(例如訂單中的貨物從不同倉庫發貨的情況)

使用說明

npm install pchome-api
  • 因為懶得寫,各位就直接參考 example.js 吧。
  • PCHome 採用 Google reCaptcha 來保護它的驗證程序,所以目前只能手動登入並設定 cookies。
  • Product Id 的格式為 DBAB01-A05738524-000,後面三碼為規格,如果此產品沒有規格可選,則預設為000;有的話請從規格下拉式選單中找到它的 option value。
  • PCHome 在面對高頻率請求有流量管制,所以建議不要過於積極的發送請求,不然會有暫時性的 403 forbidden,如果有測試出最佳的請求頻率,歡迎發 ISSUE。

聲明

此 API 不保證流程能完全符合 PChome 官方,僅測試過可以成功訂購,所以若無法使用或造成任何損失,我可不負責任的喔。

Python 版本 API

另有開發 Python 版本,支援貨到付款、信用卡一次付清、PI 錢包支付、儲值點數付款等支付方式,可以與企業內部採購系統整合,有需要可以來信洽詢。