{"id":27622,"library":"brave-search","title":"Brave Search API Wrapper","description":"A Python wrapper for the Brave Search API that provides convenient access to Brave's privacy-preserving search endpoints. Current version 0.2.0, compatible with Python 3.8-3.12. Active development with monthly releases.","status":"active","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/kayvane1/brave-api","tags":["search","brave","api","wrapper","privacy"],"install":[{"cmd":"pip install brave-search","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for synchronous HTTP requests to the Brave Search API","package":"requests","optional":false},{"reason":"Used for asynchronous HTTP requests (optional async support)","package":"aiohttp","optional":true},{"reason":"Used for response model validation and serialization","package":"pydantic","optional":false}],"imports":[{"note":"The package name on PyPI is 'brave-search', but the import module is 'brave'.","wrong":"from brave_search import Brave","symbol":"Brave","correct":"from brave import Brave"}],"quickstart":{"code":"from brave import Brave\nimport os\n\napi_key = os.environ.get('BRAVE_API_KEY', '')\nbrave = Brave(api_key=api_key)\n\nsearch_results = brave.search(q='Python programming', count=5)\nfor result in search_results.web_results:\n    print(result.title, result.url)","lang":"python","description":"Instantiate with your API key (set as env var BRAVE_API_KEY) and perform a simple web search."},"warnings":[{"fix":"Use 'pip install brave-search' and 'from brave import Brave'.","message":"The Python package name on PyPI is 'brave-search', but the import module is 'brave'. Doing 'import brave_search' will fail.","severity":"gotcha","affected_versions":"<0.2.0"},{"fix":"Set 'BRAVE_API_KEY' environment variable or pass key to 'Brave(api_key=\"...\")'.","message":"The API key must be set as an environment variable 'BRAVE_API_KEY' or passed directly to the Brave constructor. If not set, the library may raise an authentication error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade to >=0.1.8 and pass 'raw=True' to the search method to get raw JSON if validation fails.","message":"The 'raw' parameter was added in v0.1.8 to bypass pydantic validation if it fails. In earlier versions, pydantic validation errors would block the response entirely.","severity":"deprecated","affected_versions":"<0.1.8"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install with 'pip install brave-search' and import as 'from brave import Brave'.","cause":"The import module name is 'brave', not 'brave_search'. The PyPI package is 'brave-search'.","error":"ModuleNotFoundError: No module named 'brave_search'"},{"fix":"Set 'BRAVE_API_KEY' environment variable or pass key to 'Brave(api_key=\"...\")'.","cause":"The library requires a Brave Search API key, which must be provided either via environment variable or constructor argument.","error":"brave.exceptions.BraveAPIException: API key not provided. Please set BRAVE_API_KEY environment variable."},{"fix":"Upgrade to >=0.1.8 and use 'raw=True' in the search call to bypass validation, or handle the error gracefully.","cause":"The Brave Search API sometimes returns responses that don't match the expected pydantic schema (e.g., missing title).","error":"pydantic.error_wrappers.ValidationError: 1 validation error for WebSearchResult\ntitle\n  none is not an allowed value (type=type_error.none.not_allowed)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}