The Two Closest Wawas

The two closest Wawa locations are 494 meters apart, located at 912-916 Walnut Street and 150 South Independence Mall West in Philadelphia, Pennsylvania.

Here are the top 10 closest Wawa locations:

Distance
(meters)
Store A Store B State Google Maps Link
494 912-916 walnut st 150 s independence mall w PA Directions
503 525 burmont rd 3800 garrett rd PA Directions
522 8240 west chester pike 202 s state rd PA Directions
522 3604 chestnut st 3724-3744 spruce st PA Directions
566 435 e baltimore ave 100 e baltimore pike PA Directions
567 3711 w lincoln hwy 600 nova way PA Directions
598 418 w baltimore pike 5337 baltimore pike PA Directions
661 1 thomas cir nw 1250 h st nw DC Directions
695 600 rte 38 e 2801 rte 73 s NJ Directions
744 910 macdade blvd 1550 chester pike PA Directions

What is Wawa?

Before we begin, I just want to explain to the uninitiated what exactly Wawa is.

Wawa is a 24/7 regional gas station convenience store, which gained massive popularity (at least where I lived) due to being one of the first fast food chains to implement a touch screen ordering system, all the way back in 2002. While Burger King was advertising with the slogan "Have it your way", Wawa was delivering on this very same promise in a revolutionary way.

The quality of the food at Wawa is what I would call objectively "good", but the cuisine offered at Wawa elevates itself to subjectively "amazing" at 3am, when every other store is closed and Wawa is literally the only option.

Why do you care?

You might be thinking, "Okay, but who cares how close they are?", and the answer is probably not very many people.

The reason I care is because the density of Wawa locations has sort of become a running joke where I live. Anecdotally it feels like you can't drive a mile without seeing at least two. On my way to work I pass around ten different Wawa locations. I've even seen neighborhood signs protesting the development of new Wawas.

Basically, where I live, Wawa is Inevitable.

Thanos with Wawa superimposed on his head, saying "I am inevitable"
Thanos with Wawa superimposed on his head, saying "I am inevitable"

Let's get to work!

Step 1: Download the data

When you perform a Google search for "how many wawas are there", you get a top result from a scraping website charging $85 for the dataset.

Scraping website charges $85, but we can do it for free
Scraping website charges $85, but we can do it for free

Rather than spending any money on answering this silly question, we will simply scrape the data from the Wawa store locator API ourselves.

Step 1 (really): Scrape the data yourself

When we navigate to the Wawa website, we see that there is a "Find a Wawa Near You" tool. Opening up the dev tools panel, there's a graphql endpoint that returns the 50 closest wawas given a latitude and longitude.

Screenshot of the Wawa location finder tool
Screenshot of the Wawa location finder tool

I played around with this endpoint in Bruno, and it seems like the only requirement for this endpoint is having a valid User-Agent header, nothing else is validated.

Screenshot of the Bruno collection I used to test the Wawa location finder GraphQL API
Screenshot of the Bruno collection I used to test the Wawa location finder GraphQL API

Once I had this figured out, I added this query to a pyton script, and gave the python script several "seed" data points: one for every state that Wawa is present. I chose the seeds due to some of the clusters where Wawas are located being far enough from one another that a single seed would not suffice.

Seeds pictured in orange, actual locations pictured in grey
Seeds pictured in orange, actual locations pictured in grey

Every time I get a list of 50 Wawas, I check if each Wawa was already found, and if not, add the furthest new Wawa that is north-west, south-east, south-west, and north-east of my position to the list of seed coordinates. This ensures I branch out as far as I can from each seed coordinate, while not searching any areas that don't have any Wawa locations.

The seed data point in orange, the found locations in grey, and the next locations to search in red
The seed data point in orange, the found locations in grey, and the next locations to search in red

To avoid being throttled, I left a generous 45 second sleep in between each call to the location finder endpoint.

This left me with a list of 1,198 Wawa locations. However one of the results returned from this endpoint is a duplicate with an invalid identifier, so in reality we are left with a true count of 1,197 Wawa locations.

The bad data point, which seems to be a duplicate of a good data point, with an invalid ID
The bad data point, which seems to be a duplicate of a good data point, with an invalid ID

This count is confirmed by the scraping website I found earlier, so I have a somewhat high confidence in its accuracy.

Scraping website has the same count I do
Scraping website has the same count I do

Step 2: Find how far each Wawa is from all the others

Since I have the latitude and longitude of every Wawa, finding the distances between them is pretty simple using the Haversine formula. I calculate every distance and store it in a dict, then sort the keys of the dict by smallest to largest to find the closest Wawa locations.

Step 3: Questions, answered…?

I was happy to discover that two of the Wawa locations I drive by every week made it into the top ten! If I expand my results out to the top 15, I actually get a location that I frequent pretty often. This confirmed my suspicions that I indeed lived near some of the closest Wawa locations. However one thing nagged at me…

Step 4: Further research needed

When I looked at the Google maps directions I generated above, it seems the reported latitude and longitudes are not exactly where the Wawa building is. This results in errors on the order of tens of meters. When the results are as close as they are, first place could easily be decided by measuring from a more correct location, such as the entrance, or the exact center of the plot of land the Wawa sits atop.

Until I feel motivated enough to manually determine the true coordinates of each Wawa store, we will have to rely on Wawa's self reported, yet inaccurate, data.

Want to run the code yourself? Check it out on GitHub here!