I made a python program that takes a business type and location then outputs results in that location. The output is always local in the twin cities.
def get_places(query, location):
parameters = {"query": query, "location": location, "key": GOOGLE_API_KEY}
all_results = []
response = requests.get(ENDPOINT, params=parameters)
results = response.json().get("results", [])
all_results.extend(results)
results print confirming it should be searching tacoma WA but instead the results I keep getting minneapolis where I live: https://maps.googleapis.com/maps/api/place/textsearch/json?query=food&location=tacoma%2C+WA&key=xxxxxxxxxKEYxxxxxxxxxx&pagetoken=AUacShjNDU-_ibehFFVXMZseXVaF3h2S6P4DAXaIwWpJHgPuDvcCF95vgMiYjBmPiQOtiEcJvmLuFNWuoQBWEw1RYH8FKlPi7h4-jUsq2oYdpeEsoT00YojkdA7GofRggFd9KMCoRM_r-lyXnD7P4ZD6ylkeM029ycQ-9v6jdt6qobrmIq3Y6gikuRxOxHINMaFpnu-EMK5JvGkX46L_tEqz_dbur-rio4ivQPLvygqKcAjMfdMFrQWPsGzKMC7FtTVTCpwoGKKlEOIAr4cxNHtzGBgjTkUH4idJNKlCWpS1NJi15s-J40A1wJ0Wg5oFGV3OrCh5rUHR_ym28B98w8dnrMxibECfdljveS89MWJRR7BxIrQeLSYheNgu-_-_T0rmFNA
clearing cache and cookies didnt help either. The only thing that makes sense to me is a setting in my Cloud Console but I can't find anything that could be causing this.
The docs for the location parameter say that it must be specified as a latitude/longitude pair:
https://developers.google.com/maps/documentation/places/web-service/search-text#location
You'll need to geocode your location before using it in a query.