Brave Search connector
API KeyAnalyticsSearchConnect to Brave Search to perform web, image, video, and news searches with privacy-focused results, plus AI-powered suggestions and spellcheck.
Brave Search connector
-
Install the SDK
Section titled “Install the SDK”Terminal window npm install @scalekit-sdk/nodeTerminal window pip install scalekit -
Set your credentials
Section titled “Set your credentials”Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret> -
Make your first call
Section titled “Make your first call”quickstart.ts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENV_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'brave'const identifier = 'user_123'// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'brave_local_place_search',toolInput: {},})console.log(result)quickstart.py import osfrom scalekit.client import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENV_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "brave"identifier = "user_123"# Make your first callresult = actions.execute_tool(tool_input={},tool_name="brave_local_place_search",connection_name=connection_name,identifier=identifier,)print(result)
What you can do
Section titled “What you can do”Connect this agent connector to let your agent:
- Descriptions local — Fetch AI-generated descriptions for locations using IDs from a Brave web search response
- Summary summarizer — Fetch the complete AI-generated summary for a summarizer key
- Search web, local place, image — Search the web using Brave Search’s privacy-focused search engine
- Completions chat — Get AI-generated answers grounded in real-time Brave Search results using an OpenAI-compatible chat completions interface
- Pois local — Fetch detailed Point of Interest (POI) data for up to 20 location IDs returned by a Brave web search response
- Enrichments summarizer — Fetch enrichment data for a Brave AI summary key
Common workflows
Section titled “Common workflows”Proxy API call
const result = await actions.request({ connectionName: 'brave-search', identifier: 'user_123', path: '/res/v1/web/search', method: 'GET', queryParams: { q: 'best open source LLM frameworks 2025', count: '5' },});console.log(result.data.web.results);result = actions.request( connection_name='brave-search', identifier='user_123', path="/res/v1/web/search", method="GET", params={"q": "best open source LLM frameworks 2025", "count": 5})print(result["web"]["results"])Web search
Search the web and retrieve real-time results. Works on all plans including Free.
# Search for recent articles — freshness "pw" limits results to the past 7 daysresult = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_web_search", tool_input={ "q": "open source LLM frameworks 2025", "count": 5, "freshness": "pw", },)
for item in result["web"]["results"]: print(item["title"], item["url"])News search
Retrieve recent news articles by topic or keyword. Useful for monitoring a brand, topic, or competitor.
# Fetch the latest news on a topic from the past 24 hoursresult = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_news_search", tool_input={ "q": "AI regulation Europe", "count": 10, "freshness": "pd", # pd = past 24 hours },)
for article in result["results"]: print(article["title"], article["age"], article["url"])LLM grounding context
Retrieve search results structured specifically for grounding LLM responses. Requires Pro plan. Use token_budget to stay within your model’s context window.
# Get search context sized to fit a 4 000-token budgetresult = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_llm_context", tool_input={ "q": "vector database comparison 2025", "count": 5, "token_budget": 4000, },)
# Pass the structured context directly to your LLMgrounding_context = result["context"]print(grounding_context)AI chat completions grounded in search
Get an AI-generated answer backed by real-time Brave Search results, using an OpenAI-compatible interface. Requires AI plan.
# Drop-in replacement for OpenAI /v1/chat/completions — results are grounded in live searchresult = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_chat_completions", tool_input={ "messages": [ {"role": "user", "content": "What are the latest developments in quantum computing?"} ], "model": "brave/serp-claude-3-5-haiku", },)
print(result["choices"][0]["message"]["content"])# Each answer includes citations back to source URLsfor source in result.get("search_results", []): print(source["title"], source["url"])Local place search and POI details
Find nearby businesses or points of interest, then retrieve full details. Requires Data for AI plan.
# Step 1: Find coffee shops near San Francisco city centreplaces = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_local_place_search", tool_input={ "q": "specialty coffee", "location": "San Francisco, CA", "count": 5, },)
location_ids = [p["id"] for p in places["results"]]
# Step 2: Fetch rich details (hours, ratings, address) for those locations# Location IDs expire after ~8 hours — always fetch details in the same sessionpois = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_local_pois", tool_input={"ids": location_ids},)
for poi in pois["results"]: print(poi["name"], poi["address"], poi["rating"])AI summary with follow-up queries
Get an AI-generated summary for a search query, then surface follow-up questions. Requires Pro plan.
# Step 1: Web search with summary: true to obtain a summarizer keysearch_result = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_web_search", tool_input={ "q": "benefits of RAG vs fine-tuning for enterprise LLMs", "summary": True, "count": 5, },)
summarizer_key = search_result["summarizer"]["key"]
# Step 2: Retrieve the full AI summary using the keysummary = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_summarizer_search", tool_input={"key": summarizer_key, "entity_info": True},)
print(summary["title"])print(summary["summary"])
# Step 3: Get follow-up questions for a conversational search experiencefollowups = actions.execute_tool( connection_name="brave-search", identifier="user_123", tool_name="brave_summarizer_followups", tool_input={"key": summarizer_key},)
for q in followups["queries"]: print("-", q)LangChain integration
Use Scalekit’s LangChain helper to load all Brave Search tools into a LangChain agent. The agent selects and calls the right tool automatically based on the user’s query.
from langchain.agents import AgentExecutor, create_tool_calling_agentfrom langchain_anthropic import ChatAnthropicfrom langchain_core.prompts import ChatPromptTemplate
# Load all Brave Search tools — Scalekit handles auth for each calltools = actions.langchain.get_tools( providers=["BRAVE_SEARCH"], identifier="user_123", page_size=100, # avoid missing tools when a connector has more than the default page)
llm = ChatAnthropic( model="claude-sonnet-4-6", api_key=os.environ["ANTHROPIC_API_KEY"],)
prompt = ChatPromptTemplate.from_messages([ ("system", "You are a helpful research assistant with access to Brave Search tools."), ("human", "{input}"), ("placeholder", "{agent_scratchpad}"),])
agent = create_tool_calling_agent(llm, tools, prompt)agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
response = agent_executor.invoke({ "input": ( "Find the top 5 news articles about AI regulation in Europe from the past week " "and give me a one-sentence summary of each." )})print(response["output"])Tool list
Section titled “Tool list”Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.
brave_chat_completions#Get AI-generated answers grounded in real-time Brave Search results using an OpenAI-compatible chat completions interface. Returns summarized, cited answers with source references and token usage statistics.8 params
Get AI-generated answers grounded in real-time Brave Search results using an OpenAI-compatible chat completions interface. Returns summarized, cited answers with source references and token usage statistics.
messagesarrayrequiredArray of conversation messages. Each message must have a 'role' (system, user, or assistant) and 'content' (string).countrystringoptionalTarget country code for search results used to ground the answer (e.g., us, gb).enable_citationsbooleanoptionalInclude inline citation markers in the response text.enable_entitiesbooleanoptionalInclude entity information (people, places, organizations) in the response.enable_researchbooleanoptionalEnable multi-search research mode for more comprehensive answers.languagestringoptionalLanguage code for the response (e.g., en, fr, de).modelstringoptionalThe model to use. Must be 'brave' to use Brave's search-grounded AI model.streambooleanoptionalWhether to stream the response as server-sent events.brave_image_search#Search for images using Brave Search. Returns image results with thumbnails, source URLs, dimensions, and metadata. Supports filtering by country, language, and safe search.6 params
Search for images using Brave Search. Returns image results with thumbnails, source URLs, dimensions, and metadata. Supports filtering by country, language, and safe search.
qstringrequiredThe image search query string.countintegeroptionalNumber of image results to return (1–200). Defaults to 50.countrystringoptionalCountry code for localised results (e.g., us, gb, de), or ALL for no restriction.safesearchstringoptionalSafe search filter level. Defaults to strict (drops all adult content).search_langstringoptionalLanguage code for results (e.g., en, fr, de).spellcheckbooleanoptionalWhether to enable spellcheck on the query. Defaults to true.brave_llm_context#Retrieve real-time web search results optimized as grounding context for LLMs. Returns curated snippets, source URLs, titles, and metadata specifically structured to maximize contextual relevance for AI-generated answers. Supports fine-grained token and snippet budgets.14 params
Retrieve real-time web search results optimized as grounding context for LLMs. Returns curated snippets, source URLs, titles, and metadata specifically structured to maximize contextual relevance for AI-generated answers. Supports fine-grained token and snippet budgets.
qstringrequiredThe search query to retrieve grounding context for. Max 400 characters, 50 words.context_threshold_modestringoptionalRelevance filter aggressiveness for snippet selection. Defaults to balanced.countintegeroptionalMax number of search results to consider (1–50). Defaults to 20.countrystringoptionalCountry code for localised results (e.g., us, gb, de). Defaults to us.enable_localbooleanoptionalEnable location-aware recall for locally relevant results.freshnessstringoptionalFilter results by publish date: pd (past day), pw (past week), pm (past month), py (past year), or YYYY-MM-DDtoYYYY-MM-DD.gogglesstringoptionalCustom re-ranking rules via a Goggles URL or inline definition.maximum_number_of_snippetsintegeroptionalMaximum total snippets across all URLs (1–100). Defaults to 50.maximum_number_of_snippets_per_urlintegeroptionalMaximum snippets per URL (1–100). Defaults to 50.maximum_number_of_tokensintegeroptionalApproximate maximum total tokens across all snippets (1024–32768). Defaults to 8192.maximum_number_of_tokens_per_urlintegeroptionalMaximum tokens per URL (512–8192). Defaults to 4096.maximum_number_of_urlsintegeroptionalMaximum number of URLs to include in the grounding response (1–50). Defaults to 20.safesearchstringoptionalSafe search filter level.search_langstringoptionalLanguage code for results (e.g., en, fr, de). Defaults to en.brave_local_descriptions#Fetch AI-generated descriptions for locations using IDs from a Brave web search response. Returns natural language summaries describing the place, its atmosphere, and what visitors can expect.1 param
Fetch AI-generated descriptions for locations using IDs from a Brave web search response. Returns natural language summaries describing the place, its atmosphere, and what visitors can expect.
idsarrayrequiredArray of location IDs (up to 20) obtained from the locations field in a Brave web search response.brave_local_place_search#Search 200M+ Points of Interest (POIs) by geographic center and radius using Brave's Place Search API. Either 'location' (text name) OR both 'latitude' and 'longitude' (coordinates) must be provided. Supports an optional keyword query to filter results. Ideal for map applications and local discovery.11 params
Search 200M+ Points of Interest (POIs) by geographic center and radius using Brave's Place Search API. Either 'location' (text name) OR both 'latitude' and 'longitude' (coordinates) must be provided. Supports an optional keyword query to filter results. Ideal for map applications and local discovery.
countintegeroptionalNumber of POI results to return (1–50). Defaults to 20.countrystringoptionalISO 3166-1 alpha-2 country code (e.g., us, gb). Defaults to US.latitudenumberoptionalLatitude of the search center point (-90 to +90). Required together with longitude as an alternative to location name.locationstringoptionalLocation name (e.g., 'san francisco ca united states'). Required unless latitude and longitude are both provided.longitudenumberoptionalLongitude of the search center point (-180 to +180). Required together with latitude as an alternative to location name.qstringoptionalOptional keyword query to filter POIs (e.g., 'coffee shops', 'italian restaurants'). Omit for a general area snapshot.radiusnumberoptionalSearch radius in meters from the center point.safesearchstringoptionalSafe search filter level. Defaults to strict.search_langstringoptionalLanguage code for results (e.g., en, fr). Defaults to en.spellcheckbooleanoptionalWhether to enable spellcheck on the query.unitsstringoptionalMeasurement system for distances in the response.brave_local_pois#Fetch detailed Point of Interest (POI) data for up to 20 location IDs returned by a Brave web search response. Returns rich local business data including address, phone, hours, ratings, and reviews. Note: location IDs are ephemeral and expire after ~8 hours.1 param
Fetch detailed Point of Interest (POI) data for up to 20 location IDs returned by a Brave web search response. Returns rich local business data including address, phone, hours, ratings, and reviews. Note: location IDs are ephemeral and expire after ~8 hours.
idsarrayrequiredArray of location IDs (up to 20) obtained from the locations field in a Brave web search response.brave_news_search#Search for news articles using Brave Search. Returns recent news results with titles, URLs, snippets, publication dates, and source information. Supports filtering by country, language, freshness, and custom re-ranking via Goggles.11 params
Search for news articles using Brave Search. Returns recent news results with titles, URLs, snippets, publication dates, and source information. Supports filtering by country, language, freshness, and custom re-ranking via Goggles.
qstringrequiredThe news search query string.countintegeroptionalNumber of news results to return (1–50). Defaults to 20.countrystringoptionalCountry code for localised news (e.g., us, gb, de).extra_snippetsbooleanoptionalInclude additional excerpt snippets per article. Defaults to false.freshnessstringoptionalFilter results by publish date: pd (past day), pw (past week), pm (past month), py (past year), or YYYY-MM-DDtoYYYY-MM-DD.gogglesstringoptionalCustom re-ranking rules via a Goggles URL or inline definition.offsetintegeroptionalZero-based offset for pagination (0–9). Defaults to 0.safesearchstringoptionalSafe search filter level. Defaults to strict.search_langstringoptionalLanguage code for results (e.g., en, fr, de).spellcheckbooleanoptionalWhether to enable spellcheck on the query. Defaults to true.ui_langstringoptionalUser interface language locale for response strings (e.g., en-US).brave_spellcheck#Check and correct spelling of a query using Brave Search's spellcheck engine. Returns suggested corrections for misspelled queries.3 params
Check and correct spelling of a query using Brave Search's spellcheck engine. Returns suggested corrections for misspelled queries.
qstringrequiredThe query string to spellcheck.countrystringoptionalCountry code for localised spellcheck (e.g., us, gb).langstringoptionalLanguage code for spellcheck (e.g., en, fr, de).brave_suggest_search#Get autocomplete search suggestions from Brave Search for a given query prefix. Useful for query completion, exploring related search terms, and building search UIs.5 params
Get autocomplete search suggestions from Brave Search for a given query prefix. Useful for query completion, exploring related search terms, and building search UIs.
qstringrequiredThe partial query string to get suggestions for.countintegeroptionalNumber of suggestions to return (1–20). Defaults to 5.countrystringoptionalCountry code for localised suggestions (e.g., us, gb, de).langstringoptionalLanguage code for suggestions (e.g., en, fr, de).richbooleanoptionalWhether to return rich suggestions with additional metadata.brave_summarizer_enrichments#Fetch enrichment data for a Brave AI summary key. Returns images, Q&A pairs, entity details, and source references associated with the summary.1 param
Fetch enrichment data for a Brave AI summary key. Returns images, Q&A pairs, entity details, and source references associated with the summary.
keystringrequiredThe opaque summarizer key returned in a Brave web search response when summary=true was set.brave_summarizer_entity_info#Fetch detailed entity metadata for entities mentioned in a Brave AI summary. Returns structured information about people, places, organizations, and concepts referenced in the summary.1 param
Fetch detailed entity metadata for entities mentioned in a Brave AI summary. Returns structured information about people, places, organizations, and concepts referenced in the summary.
keystringrequiredThe opaque summarizer key returned in a Brave web search response when summary=true was set.brave_summarizer_followups#Fetch suggested follow-up queries for a Brave AI summary key. Useful for building conversational search flows and helping users explore related topics.1 param
Fetch suggested follow-up queries for a Brave AI summary key. Useful for building conversational search flows and helping users explore related topics.
keystringrequiredThe opaque summarizer key returned in a Brave web search response when summary=true was set.brave_summarizer_search#Retrieve a full AI-generated summary for a summarizer key obtained from a Brave web search response (requires summary=true on the web search). Returns the complete summary with title, content, enrichments, follow-up queries, and entity details.3 params
Retrieve a full AI-generated summary for a summarizer key obtained from a Brave web search response (requires summary=true on the web search). Returns the complete summary with title, content, enrichments, follow-up queries, and entity details.
keystringrequiredThe opaque summarizer key returned in a Brave web search response when summary=true was set.entity_infointegeroptionalSet to 1 to include detailed entity metadata in the response.inline_referencesbooleanoptionalAdd citation markers throughout the summary text pointing to sources.brave_summarizer_summary#Fetch the complete AI-generated summary for a summarizer key. Returns the full summary content with optional inline citation markers and entity metadata.3 params
Fetch the complete AI-generated summary for a summarizer key. Returns the full summary content with optional inline citation markers and entity metadata.
keystringrequiredThe opaque summarizer key returned in a Brave web search response when summary=true was set.entity_infointegeroptionalSet to 1 to include detailed entity metadata in the response.inline_referencesbooleanoptionalAdd citation markers throughout the summary text pointing to sources.brave_summarizer_title#Fetch only the title component of a Brave AI summary for a given summarizer key.1 param
Fetch only the title component of a Brave AI summary for a given summarizer key.
keystringrequiredThe opaque summarizer key returned in a Brave web search response when summary=true was set.brave_video_search#Search for videos using Brave Search. Returns video results with titles, URLs, thumbnails, durations, and publisher metadata. Supports filtering by country, language, freshness, and safe search.8 params
Search for videos using Brave Search. Returns video results with titles, URLs, thumbnails, durations, and publisher metadata. Supports filtering by country, language, freshness, and safe search.
qstringrequiredThe video search query string.countintegeroptionalNumber of video results to return (1–50). Defaults to 20.countrystringoptionalCountry code for localised results (e.g., us, gb, de).freshnessstringoptionalFilter results by upload date: pd (past day), pw (past week), pm (past month), py (past year), or YYYY-MM-DDtoYYYY-MM-DD.offsetintegeroptionalZero-based offset for pagination (0–9). Defaults to 0.safesearchstringoptionalSafe search filter level. Defaults to moderate.search_langstringoptionalLanguage code for results (e.g., en, fr, de).spellcheckbooleanoptionalWhether to enable spellcheck on the query. Defaults to true.brave_web_search#Search the web using Brave Search's privacy-focused search engine. Returns real-time web results including titles, URLs, snippets, news, videos, images, locations, and rich data. Supports filtering by country, language, safe search, freshness, and custom re-ranking via Goggles.15 params
Search the web using Brave Search's privacy-focused search engine. Returns real-time web results including titles, URLs, snippets, news, videos, images, locations, and rich data. Supports filtering by country, language, safe search, freshness, and custom re-ranking via Goggles.
qstringrequiredSearch query string. Max 400 characters, 50 words.countintegeroptionalNumber of search results to return (1–20). Defaults to 20.countrystringoptionalCountry code for search results (e.g., us, gb, de). Defaults to US.extra_snippetsbooleanoptionalInclude up to 5 additional excerpt snippets per result. Defaults to false.freshnessstringoptionalFilter results by publish date. Use pd (past day), pw (past week), pm (past month), py (past year), or a date range YYYY-MM-DDtoYYYY-MM-DD.gogglesstringoptionalCustom re-ranking rules via a Goggles URL or inline definition to bias search results.offsetintegeroptionalZero-based offset for pagination of results (0–9). Defaults to 0.result_filterstringoptionalComma-separated list of result types to include in the response.safesearchstringoptionalSafe search filter level. Defaults to moderate.search_langstringoptionalLanguage code for result content (e.g., en, fr, de). Defaults to en.spellcheckbooleanoptionalWhether to enable spellcheck on the query. Defaults to true.summarybooleanoptionalEnable summarizer key generation in the response. Use the returned key with the Summarizer endpoints.text_decorationsbooleanoptionalWhether to include text decoration markers (bold tags) in result snippets. Defaults to true.ui_langstringoptionalUser interface language locale for response strings (e.g., en-US, fr-FR).unitsstringoptionalMeasurement system for unit-bearing results.