A student created a computer program that tells you when an Amazon Fresh or Whole Foods delivery slot opens up

Key Points
  • You may have a tough time finding a time slot for a grocery delivery from Amazon Fresh or Whole Foods.
  • It seems like there's never a time slot available.
  • Someone created a script for Mac that will alert you when one opens up, but you need to move fast.

In this article

Getty Images

With most of the U.S. locked down at home and many people afraid to risk their health with a visit to the grocery store, it's become almost impossible to find a delivery window for groceries. Services such as Amazon Fresh, Whole Foods delivery, Instacart and others usually let you choose a window for delivery. But with demand so high, the slots are almost impossible to find.

That's a problem for people who are afraid to go out to grocery stores.

So Adrian Hertel, a computer science minor at Georgetown University, created a simple computer program that automatically notifies you when an Amazon Fresh or Whole Foods delivery slot opens up, letting you place your order. It works on Macs in the Safari web browser. Hertel told me he built it because he was worried about his parents, both of whom have immune deficiencies.

"They hadn't been able to get grocery slots for days," Hertel said. "I wanted to create a solution so they wouldn't expose themselves."

Hertel told me the program — a simple set of commands known as a "script" — doesn't collect any information from users, and everything it does is visible for anyone to read through.

Amazon suspending its shipping service pilot program
Amazon suspending its shipping service pilot program

Hertel said he's received a lot of positive feedback from people he's helped. "I've had lots of stories about people who want to share it with nurses or people with immune deficiencies," he told me.

He said his Github page has had more than 15,600 unique visitors since he launched the script on March 26 and that he can barely keep up with all of the messages he's received, most of them positive. "It grew way more than I expected,"  he said.

"I know there could be people who have a bone to pick about skipping the line," he told me. "But, I was like, I want to practice my skills and collaborate on Github." Hertel said some folks have helped him fix some bugs and add features since it launched.

Here's how to set it up.

Fill your cart

Amazon Fresh cart
Todd Haselton | CNBC

The program relies on your being ready to pay.

So, you'll need to open Safari on your Mac and go to Amazon and fill up your Amazon Fresh or Whole Foods cart first. Get everything you need in it. Then move to the final screen, where you'd normally schedule a delivery time. You (probably) won't see any available. Leave your web browser on this screen and proceed.

Download the script

Run this script from the folder you download.

A script is not an app. It's code that runs in the background and automatically refreshes the Safari web browser for you.

  • Visit Github where the script was published.
  • Select the green "Clone or download" button.
  • Choose "Download ZIP."
  • Open the ZIP file once it's finished (it'll only take a few seconds).
  • Now leave that folder open, we'll come back to it in a second.

Change some settings in the Safari web browser on your Mac

Change some settings in Safari first.
Todd Haselton | CNBC

Next, you need to change some settings in the Safari web browser for the script to run properly. 

  • Open Safari on your Mac.
  • Tap command and comma on your keyboard at the same time, this opens Safari Preferences.
  • Choose "Advanced" on the page that pops up.
  • Go to the bottom and click "Show develop menu in menu bar."
  • Go back to your Safari window.
  • Click "Develop" on the top of the screen.
  • Choose the option that says "Allow JavaScript from Apple Events" so that it's enabled.

Make sure your Mac doesn't go to sleep

Change your Mac power settings.
Todd Haselton | CNBC

Since the script requires your Mac to be awake, make sure it's plugged in and set not to go to sleep. To do this:

  • Tap the Apple icon on the top left of the screen.
  • Choose "System Preferences."
  • Select "Energy Saver."
  • Click "Power Adapter"
  • Make sure the option to turn display off is set to "never." 
  • Do the same under the "Battery" menu if you want to run this script on a battery, but you should leave your computer plugged in.
  • Bonus tip: Turn up your Mac volume. We're going to set up text message alerts, but if you're near your Mac you'll also hear an alert when a time slot becomes available.

Run the script

Run the script.
Todd Haselton | CNBC
  • Open the folder of files you downloaded.
  • Open "delivery-window-finder.scpt."
  • Hit the play button at the top of the screen.
  • Tap "Continue."
  • Choose whether you'd like the script to keep looking for slots if it finds items in your cart have gone out of stock, or whether you want it to proceed anyway. (If you desperately need toilet paper and don't want the order if it runs out of stock, choose "B. wait for me to review." Otherwise, choose "A. Keep looking for slots.")
  • Click "Done" on the screen that tells you to set up Safari properly, since we did that in the last section.
  • Select "Yes" if you want to enter in a phone number for a text message alert, otherwise just rely on your computer's speakers to tell you when a slot is available.
  • Choose whether you're checking out with Whole Foods via or Amazon Fresh.
  • Click "Continue."

A window will open and will minimize itself. This is the script running. It'll constantly refresh your checkout page until a time slot opens up.


Run the script
Todd Haselton | CNBC

Now it's time to wait. The script doesn't promise it'll find anything. Sometimes slots disappear so quickly it won't even catch them. Here, I was able to get offered a time slot, but when I clicked on it and tried to check out, it vanished.

Amazon delivery windows.
Todd Haselton | CNBC

Although I haven't moved fast enough, it has worked for many other people, including a CNBC colleague.

Hertel said sometimes you'll get a "phantom alert" that shows a delivery slot open up and vanish almost immediately. He also said he's sometimes had to wait 72 hours for an opening, but that some folks have found delivery slots within just a few minutes.

There's also the chance Amazon could block or try to thwart it at some point, but Hertel purposefully designed the app not to flood Amazon's servers, refreshing the page every 40 seconds instead of more constantly. 

"It would be easy for Amazon to block it if they see someone logged in and refreshing constantly for hours on end, they could say it looks fishy. I purposefully made a delay so it wouldn't be overwhelming and spamming servers."

So far, Hertel told me he's had luck at 12:03 a.m. in New Jersey, so your luck may depend entirely on where you live.

— CNBC's Kate Fazzini contributed to this report.

The Amazon ecosystem depends on "prep centers;" here's how Montana became a hub for them
Amazon's ecosystem depends on "prep centers;" Montana's became a hub for them