Run query through Searx API and parse results.
You can pass any other params to the searx query API.
run(
self,
query: str,
engines: Optional[List[str]] = None,
categories: Optional[List[str]] = None,
query_suffix: Optional[str] = '',
**kwargs: Any = {}
) -> strExample:
This will make a query to the qwant engine:
.. code-block:: python
from langchain_community.utilities import SearxSearchWrapper
searx = SearxSearchWrapper(searx_host="http://my.searx.host")
searx.run("what is the weather in France ?", engine="qwant")
# the same result can be achieved using the `!` syntax of searx
# to select the engine using `query_suffix`
searx.run("what is the weather in France ?", query_suffix="!qwant")
| Name | Type | Description |
|---|---|---|
query* | str | The query to search for. |
query_suffix | Optional[str] | Default: ''Extra suffix appended to the query. |
engines | Optional[List[str]] | Default: NoneList of engines to use for the query. |
categories | Optional[List[str]] | Default: NoneList of categories to use for the query. |
**kwargs | Any | Default: {}extra parameters to pass to the searx API. |