GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - worthbak/apple-store-inventory-checker: Checks Apple Store inventory for in-store pickup availability for the 2021 MacBook Pro

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
README.md
README.md
 
 
apple-store-numbers-australia.md
apple-store-numbers-australia.md
 
 
apple-store-numbers-canada.md
apple-store-numbers-canada.md
 
 
apple-store-numbers-germany.md
apple-store-numbers-germany.md
 
 
apple-store-numbers.md
apple-store-numbers.md
 
 
constants.js
constants.js
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

apple-store-inventory-checker

Checks Apple Store inventory for new MacBook Pro models.

Now available as a macOS app!

This script's functionality is now available as a macOS app! Read more here: InventoryWatch App by @worthbak

Installation

Run npm install to load the project's dependencies. Assumes recent node version (tested with v17.0.1, but should work with earlier versions).

  • request for simplifying network requests
  • node-notifier for sending local notifications when stock is detected

Running the script

First, find the store number of your local Apple Store using the included table (see here for Canadian stores). Then run the script, passing the number as an argument:

$ node index.js R123

This will query Apple's retail inventory for all 2021 MacBook Pro variants that are known to be stocked in-store. R123 is a store in Nashvile, TN, so that store plus others in the surrouding area will be queried. The results are logged to stdout, and if any models are found, a notification will be sent.

For other countries

Running the script without a 2nd argument will default to US stores. Adding a second argument specifies the country.

$ node index.js R123 CA

Currently Supported Countries

Countries Argument
United States US (default)
Canada CA
Australia AU
Germany DE
United Kingdom UK
South Korea* KR
Hong Kong HK

* These countries do not appear to support in-store pickup, and as such may not work with this tool.

Polling in the background

You might want this script to run every minute or so, to make sure you don't miss your desired model coming into stock. To run the script repeatedly, update the following line to match your local environment and add it to crontab. You will need to update the entry to point to the script directory on your local, your node location (use which node), and the desired log output file.

*/1 * * * * cd ~/path/to/script/folder/ && /usr/local/bin/node index.js R123 > ~/path/to/desired/log/script_output.log 2>&1

Customization

This script checks for most known MacBook Pro variants that are currently stocked by Apple Stores, and has some special logic for my personal favorite model (14" M1 Max 32 Core GPU, 64GB RAM, 2TB SSD in both Silver and Space Gray). You may want to tweak the code if you're not interested in the "Ultimate" models.

Apple Store Query URL Pattern

For reference, here's how Apple's fulfillment API works.

GET https://www.apple.com/shop/fulfillment-messages
  ?parts.0=MMQX3LL%2FA  // URL encoded part number MMQX3LL/A
  &parts.1=MKH53LL%2FA  // URL encoded part number MKH53LL/A
  &parts.2=MYD92LL%2FA  // URL encoded part number MYD92LL/A
  ...
  &searchNearby=true    // Instruct the API to search the designated store and the surrounding area
  &store=R172           // Store number (R172 is in Boulder, CO)

About

Checks Apple Store inventory for in-store pickup availability for the 2021 MacBook Pro

Resources

Readme
Activity

Stars

102 stars

Watchers

6 watching

Forks

26 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.