Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -21,10 +21,10 @@ def get_suggestions():
|
|
21 |
@app.route("/api/search", methods=["GET"])
|
22 |
def perform_search():
|
23 |
search_query = request.args.get("q")
|
24 |
-
|
25 |
time_limit = request.args.get("timelimit", "none")
|
26 |
safe_search = request.args.get("safesearch", "off")
|
27 |
-
api_endpoint = f"{BASE_URL}/api/search?q={search_query}&max_results=
|
28 |
response = requests.get(api_endpoint)
|
29 |
return response.json()
|
30 |
|
|
|
21 |
@app.route("/api/search", methods=["GET"])
|
22 |
def perform_search():
|
23 |
search_query = request.args.get("q")
|
24 |
+
results = requests.args.get("max_results", "10")
|
25 |
time_limit = request.args.get("timelimit", "none")
|
26 |
safe_search = request.args.get("safesearch", "off")
|
27 |
+
api_endpoint = f"{BASE_URL}/api/search?q={search_query}&max_results={results}&timelimit={time_limit}&safesearch={safe_search}"
|
28 |
response = requests.get(api_endpoint)
|
29 |
return response.json()
|
30 |
|