Spaces:
Running
Running
File size: 392 Bytes
a2c10b6 |
1 2 3 4 5 6 7 8 9 10 11 12 |
from duckduckgo_search import DDGS
def duckduckgo_web_search(query, max_results=1):
results = []
with DDGS() as ddgs:
for r in ddgs.text(query, region='wt-wt', safesearch='Off', max_results=max_results):
results.append({
"title": r["title"],
"href": r["href"],
"snippet": r["body"]
})
return results |