Google Distance Matrix Maybe?

I have an idea but I’m not sure exactly how to implement it. I have a client that wants her local customers to see a specific set of pages on her site (I’m going to create a local page and all the links from that separately from her “non local” pages). I’m thinking of creating a lightbox that requests the user to input their zip code. If that zip code falls within a specific radius of her business, it will direct the user to her local pages. If not, it will direct the user to her non local pages.
I’m at a loss at where to start for this…

You can use the location API to navigate to other pages using code.
Regarding the zip code, maybe you can ask to enter the address and then use the distance matrix API you mentioned (I don’t know if it works with zip codes).
You can call external APIs using the fetch API .
Good luck!