Update app.py
Browse files
app.py
CHANGED
|
@@ -27,10 +27,11 @@ st.title("Google Maps API Search via SerpAPI")
|
|
| 27 |
st.write("Enter a search query or a geographic location to fetch results from Google Maps.")
|
| 28 |
|
| 29 |
# Input fields
|
| 30 |
-
search_type = st.selectbox("Select Search Type:", ["
|
| 31 |
query = st.text_input("Search Query (q): (Use for regular Google Maps search)")
|
| 32 |
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
# Button to trigger the API call
|
| 36 |
if st.button("Search"):
|
|
@@ -39,7 +40,6 @@ if st.button("Search"):
|
|
| 39 |
else:
|
| 40 |
try:
|
| 41 |
results = fetch_google_maps_results(query=query, location=location, search_type=search_type)
|
| 42 |
-
# Display the results
|
| 43 |
-
st.write(results)
|
| 44 |
except Exception as e:
|
| 45 |
st.error(f"Couldn't fetch the results. Error: {e}")
|
|
|
|
| 27 |
st.write("Enter a search query or a geographic location to fetch results from Google Maps.")
|
| 28 |
|
| 29 |
# Input fields
|
| 30 |
+
search_type = st.selectbox("Select Search Type:", ["place"])
|
| 31 |
query = st.text_input("Search Query (q): (Use for regular Google Maps search)")
|
| 32 |
|
| 33 |
+
# Since we removed the search option for ll, we can use a simple text input for the geographic location.
|
| 34 |
+
location = st.text_input("Geographic Location (ll): (Format: 'latitude,longitude,zoom')")
|
| 35 |
|
| 36 |
# Button to trigger the API call
|
| 37 |
if st.button("Search"):
|
|
|
|
| 40 |
else:
|
| 41 |
try:
|
| 42 |
results = fetch_google_maps_results(query=query, location=location, search_type=search_type)
|
| 43 |
+
st.write(results) # Display the results
|
|
|
|
| 44 |
except Exception as e:
|
| 45 |
st.error(f"Couldn't fetch the results. Error: {e}")
|