Region/City/State Grouping? (Selecting a certain city and getting the surrounding cities grouped in a X mile radius)

Trying to figure this one out. I want to group a metroplex by the cities surrounding XYZ city. Like Craigslist, if you select just Chicago, you get the results for the surrounding neighborhoods and close cities, too.

How would I go about this? I want to help narrow down search results, so if someone selects say Dallas, Texas, I want all cities and areas to show up within say a 15-30 mile radius by default within or even bordering the city of Dallas.
I thought about a secondary multidimensional array with all regions and cities within XYZ radius, but there has to be a free API solution SOMEWHERE to easier dev this, right?

Where would I even start to plan this out? (Maybe it’s just late, but I am genuinely lost here :man_facepalming:)