The Global Entry program is a great way to breeze through security and customs at the airport, but there’s a problem. There’s almost no availability for Global Entry interviews.

The Global Entry application process is simple:

  1. Create an application and pay a $100 fee.
  2. Wait for conditional application approval and schedule an in-person interview.
  3. Attend interview and receive final application approval.

Conditional approval for my application took less than 24 hours, but my local airport had no availability for interviews.

I tried using a service that emails you when an appointment opens up, but the delay from when the slot opened and when I received the email was too long.

Building a script

My solution was a script to notify when new appointments became available.

Every minute the script checks the Global Entry website API for availability at my local airport. If there’s a spot, I send a notification to my phone using Pushover, so I can sign in and schedule an interview.

I used Cloudflare Workers to run the script, but this code could be repurposed to run anywhere.

// Cloudflare Workers-specific logic for connecting handler.
addEventListener("scheduled", (event) => {
  event.waitUntil(handleScheduled(event));
});

const PUSHOVER_API_TOKEN = "";
const PUSHOVER_USER_TOKEN = "";
const LOGAN_SCHEDULE_URL =
  "https://ttp.cbp.dhs.gov/schedulerapi/slots?orderBy=soonest&limit=10000&locationId=5441&minimum=1";

async function handleScheduled(event) {
  const res = await fetch(LOGAN_SCHEDULE_URL);
  const schedule = await res.json();

  const hasSpaces = schedule.length > 0;

  if (hasSpaces) {
    await sendNotification();
  }
}

async function sendNotification() {
  await fetch("https://api.pushover.net/1/messages.json", {
    method: "POST",
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      token: PUSHOVER_API_TOKEN,
      user: PUSHOVER_USER_TOKEN,
      message: "New spots available at Boston Logan!",
      url_title: "Choose slot",
      url: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:dhs:openidconnect.profiles:sp:sso:cbp:pspd-ttp-prod&redirect_uri=https%3A%2F%2Fttp.cbp.dhs.gov%2Flogin&response_type=code&scope=openid+email&nonce=en%3AadruDtmFsDEJN3VSew0wBooqLVBlzMJM&state=en%3AadruDtmFsDEJN3VSew0wBooqLVBlzMJM&locale=en",
    }),
  });
}