Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[enh] extend json response with suggestions, infoboxes and answers

Adam Taubera764ebb4b102
diff --git a/searx/webapp.py b/searx/webapp.py
index 7d4936f18..096e1f269 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -470,7 +470,10 @@ def index():
if output_format == 'json':
return Response(json.dumps({'query': search_query.query,
'number_of_results': number_of_results,
- 'results': results}),
+ 'results': results,
+ 'answers': list(result_container.answers),
+ 'infoboxes': result_container.infoboxes,
+ 'suggestions': list(result_container.suggestions)}),
mimetype='application/json')
elif output_format == 'csv':
csv = UnicodeWriter(cStringIO.StringIO())