# BraveSearch

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/tools/brave_search/tool/BraveSearch)

Tool that queries the BraveSearch.

Api key can be provided as an environment variable BRAVE_SEARCH_API_KEY
or as a parameter.

Example usages:
.. code-block:: python
    # uses BRAVE_SEARCH_API_KEY from environment
    tool = BraveSearch()

.. code-block:: python
    # uses the provided api key
    tool = BraveSearch.from_api_key("your-api-key")

.. code-block:: python
    # uses the provided api key and search kwargs
    tool = BraveSearch.from_api_key(
                            api_key = "your-api-key",
                            search_kwargs={"max_results": 5}
                            )

.. code-block:: python
    # uses BRAVE_SEARCH_API_KEY from environment
    tool = BraveSearch.from_search_kwargs({"max_results": 5})

## Signature

```python
BraveSearch()
```

## Extends

- `BaseTool`

## Properties

- `name`
- `description`
- `search_wrapper`

## Methods

- [`from_api_key()`](https://reference.langchain.com/python/langchain-community/tools/brave_search/tool/BraveSearch/from_api_key)
- [`from_search_kwargs()`](https://reference.langchain.com/python/langchain-community/tools/brave_search/tool/BraveSearch/from_search_kwargs)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/tools/brave_search/tool.py#L12)