### LLM Context API Endpoint Examples Source: https://github.com/brave/brave-search-skills/blob/main/skills/llm-context/SKILL.md Demonstrates how to call the LLM Context API using both GET and POST requests. Ensure you replace ${BRAVE_SEARCH_API_KEY} with your actual API key. ```http GET https://api.search.brave.com/res/v1/llm/context POST https://api.search.brave.com/res/v1/llm/context ``` ```bash curl -s "https://api.search.brave.com/res/v1/llm/context?q=tallest+mountains+in+the+world" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` ```bash curl -s --compressed -X POST "https://api.search.brave.com/res/v1/llm/context" \ -H "Accept: application/json" \ -H "Accept-Encoding: gzip" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"q": "tallest mountains in the world"}' ``` -------------------------------- ### Install bx CLI (macOS/Linux) Source: https://github.com/brave/brave-search-skills/blob/main/skills/bx/SKILL.md Installs the Brave Search CLI using a script. Ensure you have curl installed. ```bash # Install (macOS/Linux) curl -fsSL https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.sh | sh ``` -------------------------------- ### Install Brave Search Skills for Windsurf (Project-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the project's .windsurf/skills directory using curl. ```bash # Project-level mkdir -p .windsurf/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C .windsurf/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search Skills for Windsurf (User-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the user's ~/.codeium/windsurf/skills directory using curl. ```bash # User-level mkdir -p ~/.codeium/windsurf/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C ~/.codeium/windsurf/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search Skills for OpenClaw (curl) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the user's ~/.openclaw/skills directory using curl. ```bash mkdir -p ~/.openclaw/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C ~/.openclaw/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search Skills for Claude Code Manually Source: https://github.com/brave/brave-search-skills/blob/main/README.md Install Brave Search skills for Claude Code by cloning the repository and copying the skills directory. This method provides manual control over the installation. ```bash git clone https://github.com/brave/brave-search-skills cp -r brave-search-skills/skills/* ~/.claude/skills/ # user-level cp -r brave-search-skills/skills/* .claude/skills/ # project-level ``` -------------------------------- ### Install Brave Search Skills for GitHub Copilot (curl) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the .github/skills directory using curl. This is for GitHub Copilot integration. ```bash mkdir -p .github/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C .github/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search Skills using OpenSkills Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills using the third-party universal installer 'openskills'. This command overwrites existing skills. ```bash npx openskills install brave/brave-search-skills ``` -------------------------------- ### Install Brave Search Skills for User-Level (Cursor) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the user's Cursor skills directory using curl. Ensure the directory exists before running. ```bash mkdir -p ~/.cursor/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C ~/.cursor/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search CLI on macOS/Linux Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Installs the Brave Search CLI using a curl script. Ensure you have curl installed. ```bash curl -fsSL https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.sh | sh ``` -------------------------------- ### Install Brave Search Skills for Codex (Project-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the project's .agents/skills directory using curl. This is for Codex integration. ```bash # Project-level mkdir -p .agents/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C .agents/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search Skills for Codex (User-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to the user's ~/.agents/skills directory using curl. This is for Codex integration. ```bash # User-level mkdir -p ~/.agents/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C ~/.agents/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Install Brave Search CLI on Windows (PowerShell) Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Installs the Brave Search CLI using a PowerShell command. Requires PowerShell execution policy to be set. ```powershell powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.ps1 | iex" ``` -------------------------------- ### Install Brave Search Skills for Cursor via curl (Project-level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Install Brave Search skills for Cursor at the project level using curl to download and extract the archive. This method is suitable for project-specific configurations. ```bash # Project-level mkdir -p .cursor/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C .cursor/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Checking for breaking changes before upgrading Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Use `context` to find migration guides and `news` to check for release information. Specify the library/framework and version. ```bash bx context "Next.js 15 breaking changes migration guide" --max-tokens 8192 bx news "Next.js 15 release" --freshness pm ``` -------------------------------- ### Install Brave Search Skills for Claude Code via Plugin Marketplace Source: https://github.com/brave/brave-search-skills/blob/main/README.md Install the Brave Search skills for Claude Code using the plugin marketplace. This method ensures automatic updates and does not require a git clone. ```bash /plugin marketplace add brave/brave-search-skills /plugin install brave-search-skills@brave-search ``` -------------------------------- ### Install Brave Search Skills for Other Agents (curl) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Installs Brave Search Skills to a specified skills directory using curl. Adjust '' to your agent's directory. ```bash mkdir -p && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Get search suggestions Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Use the `suggest` command to get search query suggestions. Pipe the output to `jq` to extract the suggested queries. ```bash bx suggest "how to implement" --count 10 | jq '.results[].query' ``` -------------------------------- ### Install Brave Search Skills for Claude Code via curl (Project-level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Install Brave Search skills for Claude Code at the project level using curl to download and extract the archive. This method avoids git and the marketplace. ```bash # Project-level mkdir -p .claude/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C .claude/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Goggles: Hosted Example Source: https://github.com/brave/brave-search-skills/blob/main/skills/llm-context/SKILL.md Use hosted Goggles by providing a URL to a Goggle rules file on GitHub or GitLab. The file must be registered. ```bash --data-urlencode "goggles=https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/1k_short.goggle" ``` -------------------------------- ### Install Brave Search Skills for Claude Code via curl (User-level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Install Brave Search skills for Claude Code at the user level using curl to download and extract the archive. This method avoids git and the marketplace. ```bash # User-level (available in all projects) mkdir -p ~/.claude/skills && curl -sL https://github.com/brave/brave-search-skills/archive/main.tar.gz | tar xz -C ~/.claude/skills --strip-components=2 brave-search-skills-main/skills ``` -------------------------------- ### Rich Response Example Source: https://github.com/brave/brave-search-skills/blob/main/skills/suggest/SKILL.md This JSON example shows the structure of a rich suggestion response when 'rich=true' is specified. It includes entity information like title, description, and image. ```json { "type": "suggest", "query": { "original": "albert" }, "results": [ { "query": "albert einstein", "is_entity": true, "title": "Albert Einstein", "description": "German-born theoretical physicist", "img": "https://imgs.search.brave.com/..." }, { "query": "albert einstein quotes", "is_entity": false } ] } ``` -------------------------------- ### Rich Data Enrichment Workflow Source: https://github.com/brave/brave-search-skills/blob/main/skills/web-search/SKILL.md This example demonstrates how to enable rich callback for search queries and then retrieve rich data using the provided callback key. ```bash # 1. Search with rich callback enabled curl -s "https://api.search.brave.com/res/v1/web/search?q=weather+san+francisco&enable_rich_callback=true" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" # Response includes: "rich": {"hint": {"callback_key": "abc123...", "vertical": "weather"}} # 2. Get rich data with the callback key curl -s "https://api.search.brave.com/res/v1/web/rich?callback_key=abc123..." \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` -------------------------------- ### Brave Search CLI Error Output Example Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Example of the JSON-formatted error output from the Brave Search CLI, indicating a rate limiting issue. ```json error: rate limited (429) — Request rate limit exceeded for plan. hint: retry after a short delay, or upgrade plan for higher rate limits {"type":"ErrorResponse","error":{"code":"RATE_LIMITED","status":429,...}} ``` -------------------------------- ### Direct AI answer (streaming) Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Use the `answers` command to get a direct AI-generated explanation. It streams responses by default. ```bash bx answers "explain Rust lifetimes with examples" ``` -------------------------------- ### Evaluating a dependency Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Use `context` to check for security issues or maintenance status of a crate, and `news` to get fresh information. Specify the crate name and relevant keywords. ```bash bx context "reqwest crate security issues maintained 2026" --threshold strict bx news "reqwest Rust crate" --freshness pm ``` -------------------------------- ### Goggles: Inline Example Source: https://github.com/brave/brave-search-skills/blob/main/skills/llm-context/SKILL.md Use inline Goggles rules for custom ranking without registration. Rules are combined with commas and separated by \n. ```bash --data-urlencode 'goggles=$discard\n$site=example.com' ``` -------------------------------- ### Basic Suggestions (cURL) Source: https://github.com/brave/brave-search-skills/blob/main/skills/suggest/SKILL.md Use this snippet to get basic query suggestions by providing a query parameter 'q'. Ensure your API key is set in the BRAVE_SEARCH_API_KEY environment variable. ```bash curl -s "https://api.search.brave.com/res/v1/suggest/search?q=how+to+" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` -------------------------------- ### Direct Comparison Results (Example) Source: https://github.com/brave/brave-search-skills/wiki/Evaluation-of-major-AI-powered-answer-engines Displays the percentage breakdown of direct comparison results between AI answer engines. This format is used to show relative performance in head-to-head evaluations. ```text BOTH EQUAL │████████████████████████████████████████│ 38.73% ChatGPT │███████████████████████████│ 26.87% AI Mode │███████████████████████████████████│ 34.40% ``` ```text BOTH EQUAL │█████████████████│ 27.73% ChatGPT │█████│ 9.07% Grok │████████████████████████████████████████│ 63.20% ``` ```text BOTH EQUAL │████████████████████████████│ 34.07% ChatGPT │████████████████████████████████████████│ 48.00% Perplexity │██████████████│ 17.93% ``` ```text BOTH EQUAL │███████████████████│ 30.07% Grok │████████████████████████████████████████│ 60.53% AI Mode │██████│ 9.40% ``` ```text BOTH EQUAL │█████│ 15.47% Grok │████████████████████████████████████████│ 79.33% Perplexity │██│ 5.20% ``` -------------------------------- ### Configure direnv for API Key Source: https://github.com/brave/brave-search-skills/blob/main/docs/api-key-setup.md Use direnv to automatically load your Brave Search API key for directory-scoped configurations. Ensure direnv is installed and the .envrc file is allowed. ```bash # Install direnv (https://direnv.net), then in your project directory: echo 'export BRAVE_SEARCH_API_KEY="your-api-key-here"' >> .envrc direnv allow ``` -------------------------------- ### Spellcheck API Quick Start (cURL) Source: https://github.com/brave/brave-search-skills/blob/main/skills/spellcheck/SKILL.md This cURL command demonstrates how to call the spellcheck endpoint with a misspelled query and language/country parameters. Ensure you have set the BRAVE_SEARCH_API_KEY environment variable. ```bash curl -s "https://api.search.brave.com/res/v1/spellcheck/search" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -G \ --data-urlencode "q=artifical inteligence" \ --data-urlencode "lang=en" \ --data-urlencode "country=US" ``` -------------------------------- ### LLM Context API with Goggles Source: https://github.com/brave/brave-search-skills/blob/main/skills/llm-context/SKILL.md Shows how to use the LLM Context API with Goggles for custom re-ranking of search results. This example filters results to specific sites. ```bash curl -s "https://api.search.brave.com/res/v1/llm/context" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -G \ --data-urlencode "q=rust programming" \ --data-urlencode 'goggles=$discard $site=docs.rs $site=rust-lang.org' ``` -------------------------------- ### Python: Streaming with Citations (Single-Search) OpenAI SDK Usage Source: https://github.com/brave/brave-search-skills/blob/main/skills/answers/SKILL.md This example demonstrates how to receive search results as a stream, with inline citation tags. Set `stream=True` and `enable_citations=True` in `extra_body`. ```python from openai import OpenAI client = OpenAI( base_url="https://api.search.brave.com/res/v1", api_key="your-brave-api-key", ) stream = client.chat.completions.create( model="brave", messages=[{"role": "user", "content": "What are the current trends in renewable energy?"}], stream=True, extra_body={"enable_citations": True} ) for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="") ``` -------------------------------- ### Answers (AI-Grounded) - Fast Single Search Source: https://github.com/brave/brave-search-skills/blob/main/README.md Get AI-grounded answers using the OpenAI SDK-compatible endpoint. This example performs a fast, blocking single search. Requires an API key and JSON payload. ```bash curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \ -H "Content-Type: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -d '{ "messages": [{"role": "user", "content": "What programming languages are trending in 2026?"}], "model": "brave", "stream": false }' ``` -------------------------------- ### Example Response Format Source: https://github.com/brave/brave-search-skills/blob/main/skills/local-descriptions/SKILL.md This JSON structure shows how descriptions are returned, including the POI ID and the AI-generated markdown description. Note that the 'description' field can be null if no description is available for a POI. ```json { "type": "local_descriptions", "results": [ { "type": "local_description", "id": "loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA=", "description": "### Overview\nA cozy neighborhood cafe known for its **artisanal coffee**..." } ] } ``` -------------------------------- ### Getting POI IDs using Web Search API (cURL) Source: https://github.com/brave/brave-search-skills/blob/main/skills/local-descriptions/SKILL.md This example demonstrates how to first obtain POI IDs using the Web Search API with the `result_filter=locations` parameter. These IDs are then used to fetch descriptions from the Local Descriptions API. ```bash # 1. Search for local businesses curl -s "https://api.search.brave.com/res/v1/web/search?q=restaurants+san+francisco&result_filter=locations" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" # 2. Extract POI IDs from locations.results[].id # 3. Use those IDs with local/pois and local/descriptions ``` -------------------------------- ### Control Token Budget for Context Search Source: https://github.com/brave/brave-search-skills/blob/main/skills/bx/SKILL.md Example of using flags to control the token budget for the default context search command, adjusting maximum tokens, tokens per URL, max URLs, and relevance threshold. ```bash bx "topic" --max-tokens 4096 --max-tokens-per-url 1024 --max-urls 5 --threshold strict ``` -------------------------------- ### Display bx CLI help information Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Shows all available commands and flags for the Brave Search CLI. Use `bx --help` for specific command details. ```bash bx --help ``` -------------------------------- ### Example Local POI Response Source: https://github.com/brave/brave-search-skills/blob/main/skills/local-pois/SKILL.md This is an example of a JSON response when querying for local points of interest. It includes detailed information about a business, such as its address, contact information, rating, and opening hours. ```json { "type": "local_pois", "results": [ { "type": "location_result", "title": "Park Mediterranean Grill", "url": "https://yelp.com/biz/park-mediterranean-grill-sf", "provider_url": "https://yelp.com/biz/park-mediterranean-grill-sf", "id": "loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA=", "postal_address": { "type": "PostalAddress", "displayAddress": "123 Main St, San Francisco, CA 94102", "streetAddress": "123 Main St", "addressLocality": "San Francisco", "addressRegion": "CA", "postalCode": "94102", "country": "US" }, "contact": { "telephone": "+1 415-555-0123" }, "thumbnail": { "src": "https://example.com/thumb.jpg", "original": "https://example.com/original.jpg" }, "rating": { "ratingValue": 4.5, "bestRating": 5.0, "reviewCount": 234 }, "opening_hours": { "current_day": [ { "abbr_name": "Mon", "full_name": "Monday", "opens": "07:00", "closes": "21:00" } ] }, "coordinates": [37.7749, -122.4194], "distance": { "value": 0.3, "units": "miles" }, "categories": ["Mediterranean", "Greek"], "price_range": "$$", "serves_cuisine": ["Mediterranean", "Greek"], "timezone": "America/Los_Angeles" } ] } ``` -------------------------------- ### Use bx with API Key Flag Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Demonstrates using the `--api-key` flag to specify the API key for a web search. This method is less secure as the key may be visible in process listings. ```bash bx --api-key KEY web "test" ``` -------------------------------- ### Suggestions with All Parameters (cURL) Source: https://github.com/brave/brave-search-skills/blob/main/skills/suggest/SKILL.md This snippet demonstrates how to use all available parameters for the Suggest API, including query, language, country, count, and rich suggestions. It's useful for fine-tuning suggestion results. ```bash curl -s "https://api.search.brave.com/res/v1/suggest/search" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -G \ --data-urlencode "q=albert" \ --data-urlencode "country=US" \ --data-urlencode "lang=en" \ --data-urlencode "count=10" \ --data-urlencode "rich=true" ``` -------------------------------- ### Using Hosted Goggles with Brave Search CLI Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Reference a hosted `.goggle` file from GitHub or GitLab directly in the CLI to filter search results. ```bash bx web "distributed systems" \ --goggles 'https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/tech_blogs.goggle' ``` -------------------------------- ### Spellcheck Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Performs spell correction on search queries for cleanup. Supports GET requests. ```APIDOC ## GET /res/v1/spellcheck/search ### Description Corrects spelling errors in search queries to improve relevance. ### Method GET ### Endpoint /res/v1/spellcheck/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query to spellcheck. ### Response #### Success Response (200) - **spellcheck** (object) - Contains spell correction suggestions. ``` -------------------------------- ### Suggest Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Provides query autocomplete suggestions with a response time under 100ms. Supports GET requests. ```APIDOC ## GET /res/v1/suggest/search ### Description Offers query autocomplete suggestions, designed for fast responses. ### Method GET ### Endpoint /res/v1/suggest/search ### Parameters #### Query Parameters - **q** (string) - Required - The partial search query for autocomplete. ### Response #### Success Response (200) - **suggestions** (array) - An array of suggested search queries. ``` -------------------------------- ### News Search Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md News article search with freshness filtering capabilities. Supports GET requests. ```APIDOC ## GET /res/v1/news/search ### Description Retrieves news articles, allowing filtering by freshness. ### Method GET ### Endpoint /res/v1/news/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query for news. ### Response #### Success Response (200) - **news** (array) - An array of news article objects. ``` -------------------------------- ### Copy Brave Search Skills Manually for Windsurf (User-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Copies Brave Search Skills from a git clone to the user's ~/.codeium/windsurf/skills directory. Requires a prior git clone. ```bash cp -r brave-search-skills/skills/* ~/.codeium/windsurf/skills/ ``` -------------------------------- ### LLM Context Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Pre-extracted web content for LLM grounding. Supports GET and POST requests. ```APIDOC ## GET /res/v1/llm/context ### Description Returns search results with pre-extracted web content, optimized for LLM grounding. ### Method GET ### Endpoint /res/v1/llm/context ### Parameters #### Query Parameters - **q** (string) - Required - The search query. - **goggles** (string) - Optional - Custom ranking instructions. ### Request Example ```bash curl -X GET "https://api.search.brave.com/res/v1/llm/context?q=search+API+for+grounding+LLMs" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` ### Response #### Success Response (200) - **results** (array) - Search results with pre-extracted web content. ``` -------------------------------- ### Copy Brave Search Skills Manually for Windsurf (Project-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Copies Brave Search Skills from a git clone to the project's .windsurf/skills directory. Requires a prior git clone. ```bash cp -r brave-search-skills/skills/* .windsurf/skills/ ``` -------------------------------- ### Images Search Endpoint Source: https://github.com/brave/brave-search-skills/blob/main/skills/images-search/SKILL.md The GET endpoint for performing image searches via the Brave Search API. ```http GET https://api.search.brave.com/res/v1/images/search ``` -------------------------------- ### Perform a basic web search with bx Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Executes a web search query using the Brave Search CLI. This is the default behavior for bare queries. ```bash bx "your search query" ``` -------------------------------- ### Get AI-Generated Answers Source: https://github.com/brave/brave-search-skills/blob/main/skills/bx/SKILL.md Retrieves synthesized explanations for a query. This command streams results by default and cites sources. ```bash bx answers "query" ``` -------------------------------- ### Videos Search Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Video search functionality that includes filtering by duration, views, and creator. Supports GET requests. ```APIDOC ## GET /res/v1/videos/search ### Description Searches for video content, with options to filter by duration, views, and creator. ### Method GET ### Endpoint /res/v1/videos/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query for videos. ### Response #### Success Response (200) - **videos** (array) - An array of video objects. ``` -------------------------------- ### Basic Video Search with cURL Source: https://github.com/brave/brave-search-skills/blob/main/skills/videos-search/SKILL.md Performs a basic video search for 'python tutorial'. Ensure your API key is set in the BRAVE_SEARCH_API_KEY environment variable. ```bash curl -s "https://api.search.brave.com/res/v1/videos/search?q=python+tutorial" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` -------------------------------- ### Local Descriptions Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Generates AI-powered text descriptions for Points of Interest (POIs) based on their IDs. Supports GET requests. ```APIDOC ## GET /res/v1/local/descriptions ### Description Provides AI-generated text descriptions for POIs using their IDs. ### Method GET ### Endpoint /res/v1/local/descriptions ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the POI for which to generate a description. ### Response #### Success Response (200) - **local_descriptions** (array) - An array of generated POI description objects. ``` -------------------------------- ### Images Search Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Image search functionality returning image thumbnails, supporting up to 200 results. Supports GET requests. ```APIDOC ## GET /res/v1/images/search ### Description Performs image search and returns thumbnails for up to 200 results. ### Method GET ### Endpoint /res/v1/images/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query for images. ### Response #### Success Response (200) - **images** (array) - An array of image objects, including thumbnails. ``` -------------------------------- ### Goggles DSL Quick Reference Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md A reference table for common Goggles DSL rules including boosting, downranking, discarding domains, and path-based targeting with wildcards. ```markdown | Rule | Effect | Example | |---|---|---| | `$boost=N,site=DOMAIN` | Promote domain (N=1-10) | `$boost=3,site=docs.rs` | | `$downrank=N,site=DOMAIN` | Demote domain (N=1-10) | `$downrank=5,site=medium.com` | | `$discard,site=DOMAIN` | Remove domain entirely | `$discard,site=w3schools.com` | | `/path/$boost=N` | Boost matching URL paths | `/docs/$boost=5` | | `*pattern*$boost=N` | Wildcard URL matching | `*api*$boost=3` | | Generic `$discard` | Allowlist mode — discard all unmatched | `$discard` (as first rule) | ``` -------------------------------- ### Web Search Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Standard web search providing ranked results with snippets and rich data. Supports GET requests. ```APIDOC ## GET /res/v1/web/search ### Description Provides ranked web results with snippets and metadata. ### Method GET ### Endpoint /res/v1/web/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query. ### Request Example ```bash curl -s "https://api.search.brave.com/res/v1/web/search?q=retrieval+augmented+generation+explained" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` ### Response #### Success Response (200) - **webPages** (object) - Contains search results, snippets, and metadata. ``` -------------------------------- ### `bx context` response shape Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Example JSON response shape for the `bx context` command, showing RAG grounding results. ```json { "grounding": { "generic": [ { "url": "...", "title": "...", "snippets": ["extracted content...", "..."] } ] } } ``` -------------------------------- ### LLM Context Endpoint Source: https://github.com/brave/brave-search-skills/blob/main/skills/llm-context/SKILL.md This endpoint retrieves pre-extracted web content optimized for LLM grounding. It can be accessed via GET or POST requests. ```APIDOC ## GET /res/v1/llm/context ### Description Retrieves pre-extracted web content optimized for LLM grounding. Supports query parameters for search and context control. ### Method GET ### Endpoint https://api.search.brave.com/res/v1/llm/context ### Parameters #### Query Parameters - **q** (string) - Required - Search query (1-400 chars, max 50 words) - **country** (string) - Optional - Search country (2-letter country code or `ALL`) - **search_lang** (string) - Optional - Language preference (2+ char language code) - **count** (int) - Optional - Max search results to consider (1-50) #### Context Size Parameters - **maximum_number_of_urls** (int) - Optional - Max URLs in response (1-50) - **maximum_number_of_tokens** (int) - Optional - Approximate max tokens in context (1024-32768) - **maximum_number_of_snippets** (int) - Optional - Max snippets across all URLs (1-100) - **maximum_number_of_tokens_per_url** (int) - Optional - Max tokens per individual URL (512-8192) - **maximum_number_of_snippets_per_url** (int) - Optional - Max snippets per individual URL (1-100) #### Filtering & Local Parameters - **context_threshold_mode** (string) - Optional - Relevance threshold for including content (`strict`/`balanced`/`lenient`) - **enable_local** (bool) - Optional - Local recall control (`true`/`false`/`null`) - **goggles** (string/list) - Optional - Goggle URL or inline definition for custom re-ranking ### Request Example ```bash curl -s "https://api.search.brave.com/res/v1/llm/context?q=tallest+mountains+in+the+world" \ -H "Accept: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" ``` ## POST /res/v1/llm/context ### Description Retrieves pre-extracted web content optimized for LLM grounding using a JSON request body. ### Method POST ### Endpoint https://api.search.brave.com/res/v1/llm/context ### Parameters #### Request Body - **q** (string) - Required - Search query (1-400 chars, max 50 words) - **country** (string) - Optional - Search country (2-letter country code or `ALL`) - **search_lang** (string) - Optional - Language preference (2+ char language code) - **count** (int) - Optional - Max search results to consider (1-50) - **maximum_number_of_urls** (int) - Optional - Max URLs in response (1-50) - **maximum_number_of_tokens** (int) - Optional - Approximate max tokens in context (1024-32768) - **maximum_number_of_snippets** (int) - Optional - Max snippets across all URLs (1-100) - **maximum_number_of_tokens_per_url** (int) - Optional - Max tokens per individual URL (512-8192) - **maximum_number_of_snippets_per_url** (int) - Optional - Max snippets per individual URL (1-100) - **context_threshold_mode** (string) - Optional - Relevance threshold for including content (`strict`/`balanced`/`lenient`) - **enable_local** (bool) - Optional - Local recall control (`true`/`false`/`null`) - **goggles** (string/list) - Optional - Goggle URL or inline definition for custom re-ranking ### Request Example ```bash curl -s --compressed -X POST "https://api.search.brave.com/res/v1/llm/context" \ -H "Accept: application/json" \ -H "Accept-Encoding: gzip" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"q": "tallest mountains in the world"}' ``` ### Response #### Success Response (200) - **url** (string) - The URL of the web page. - **title** (string) - The title of the web page. - **content** (string) - The extracted text content from the page. - **snippets** (array) - A list of relevant snippets from the page. - **snippet** (string) - A text snippet. - **url** (string) - The URL the snippet is from. - **tables** (array) - A list of extracted tables from the page. - **caption** (string) - The caption of the table. - **data** (array) - The table data. - (array of strings) - A row in the table. - **code_blocks** (array) - A list of extracted code blocks from the page. - **code** (string) - The code block content. - **language** (string) - The programming language of the code block. #### Response Example ```json { "url": "https://example.com/page", "title": "Example Page Title", "content": "This is the extracted text content.", "snippets": [ { "snippet": "This is a relevant snippet.", "url": "https://example.com/page" } ], "tables": [ { "caption": "Example Table", "data": [ ["Header 1", "Header 2"], ["Row 1 Col 1", "Row 1 Col 2"] ] } ], "code_blocks": [ { "code": "print('Hello, world!')", "language": "python" } ] } ``` ``` -------------------------------- ### Copy Brave Search Skills Manually (Project-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Copies Brave Search Skills from a git clone to the current directory's skills folder. Requires a prior git clone. ```bash cp -r brave-search-skills/skills/* .cursor/skills/ ``` -------------------------------- ### Videos Search Endpoint Source: https://github.com/brave/brave-search-skills/blob/main/skills/videos-search/SKILL.md This endpoint allows you to search for videos. You can use either the GET or POST method. POST is recommended for longer queries. ```APIDOC ## Videos Search ### Description Searches for videos based on a query and returns a list of video results, including title, URL, thumbnail, duration, view count, and creator. Supports various filtering and pagination options. ### Method GET, POST ### Endpoint https://api.search.brave.com/res/v1/videos/search ### Parameters #### Query Parameters - **q** (string) - Required - Search query (1-400 chars, max 50 words) - **country** (string) - Optional - Search country (2-letter country code or `ALL`). Default: `US` - **search_lang** (string) - Optional - Language preference (2+ char language code). Default: `en` - **ui_lang** (string) - Optional - UI language (e.g., "en-US"). Default: `en-US` - **count** (int) - Optional - Number of results (1-50). Default: `20` - **offset** (int) - Optional - Page offset (0-9). Default: `0` - **safesearch** (string) - Optional - Adult content filter (`off`/`moderate`/`strict`). Default: `moderate` - **freshness** (string) - Optional - Time filter (`pd`/`pw`/`pm`/`py` or date range `YYYY-MM-DDtoYYYY-MM-DD`) - **spellcheck** (bool) - Optional - Auto-correct query. Default: `true` - **operators** (bool) - Optional - Apply search operators. Default: `true` - **include_fetch_metadata** (bool) - Optional - Include `fetched_content_timestamp` in results. Default: `false` ### Request Example ```json { "q": "python tutorial", "country": "US", "count": 10, "freshness": "pw" } ``` ### Response #### Success Response (200) - **type** (string) - Type of the response, expected to be "videos". - **query** (object) - Information about the search query. - **original** (string) - The original search query. - **spellcheck_off** (bool) - Indicates if spellcheck was turned off. - **extra** (object) - Additional information about the search. - **might_be_offensive** (bool) - Indicates if the results might contain offensive content. - **results** (array) - An array of video result objects. - **type** (string) - Type of the result, expected to be "video_result". - **title** (string) - The title of the video. - **url** (string) - The URL of the video. - **description** (string) - A brief description of the video. - **age** (string) - The age of the video content (e.g., "February 12, 2025"). - **page_age** (string) - The date the page was created. - **page_fetched** (string) - The timestamp when the page was fetched. - **thumbnail** (object) - Thumbnail image details. - **src** (string) - URL for the thumbnail image. - **original** (string) - Original URL for the thumbnail. - **video** (object) - Video specific details. - **duration** (string) - Duration of the video (e.g., "03:45:00"). - **views** (int) - Number of views. - **creator** (string) - The creator of the video. - **publisher** (string) - The publisher of the video. - **requires_subscription** (bool) - Whether the video requires a subscription. - **tags** (array) - Array of tags associated with the video. - **author** (object) - Author details. - **name** (string) - Author's name. - **url** (string) - Author's URL. - **meta_url** (object) - Metadata about the URL. - **scheme** (string) - URL scheme (e.g., "https"). - **netloc** (string) - Network location (e.g., "youtube.com"). - **hostname** (string) - Hostname of the URL. - **favicon** (string) - URL for the favicon. - **path** (string) - Path component of the URL. #### Response Example ```json { "type": "videos", "query": { "original": "python tutorial", "spellcheck_off": false }, "extra": { "might_be_offensive": false }, "results": [ { "type": "video_result", "title": "Python Tutorial for Beginners", "url": "https://www.youtube.com/watch?v=rfscVS0vtbw", "description": "Learn Python programming from scratch...", "age": "February 12, 2025", "page_age": "2025-02-12T00:00:00", "page_fetched": "2025-02-12T15:00:00Z", "thumbnail": { "src": "https://imgs.search.brave.com/...", "original": "https://i.ytimg.com/vi/rfscVS0vtbw/hqdefault.jpg" }, "video": { "duration": "03:45:00", "views": 1523000, "creator": "freeCodeCamp", "publisher": "YouTube", "requires_subscription": false, "tags": ["python", "programming"], "author": { "name": "freeCodeCamp.org", "url": "https://www.youtube.com/@freecodecamp" } }, "meta_url": { "scheme": "https", "netloc": "youtube.com", "hostname": "www.youtube.com", "favicon": "https://imgs.search.brave.com/...", "path": "\u203a watch" } } ] } ``` ``` -------------------------------- ### Inline Goggles Rules for Boosting and Demoting Source: https://github.com/brave/brave-search-skills/blob/main/skills/bx/SKILL.md Apply inline Goggles rules to boost or demote specific sites and paths, or to enable allowlist mode. ```bash # Boost official docs, demote blog posts bx "axum middleware tower" \ --goggles '$boost=5,site=docs.rs $boost=3,site=github.com /docs/$boost=5 /blog/$downrank=3' --max-tokens 4096 # Allowlist mode — only include matched sites bx "Python asyncio patterns" \ --goggles '$discard $boost,site=docs.python.org $boost,site=peps.python.org' ``` -------------------------------- ### Copy Brave Search Skills Manually (User-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Copies Brave Search Skills from a git clone to the user's skills directory. Requires a prior git clone. ```bash cp -r brave-search-skills/skills/* ~/.cursor/skills/ ``` -------------------------------- ### Blocking Single-Search cURL Example Source: https://github.com/brave/brave-search-skills/blob/main/skills/answers/SKILL.md Use this snippet for a fast, AI-grounded answer from a single search without streaming. Ensure your BRAVE_SEARCH_API_KEY is set. ```bash curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \ -H "Content-Type: application/json" \ -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ -d '{ "messages": [{"role": "user", "content": "How does the James Webb Space Telescope work?"}], "model": "brave", "stream": false }' ``` -------------------------------- ### `bx answers` streaming response shape Source: https://github.com/brave/brave-search-skills/blob/main/clawhub/bx-search/SKILL.md Example JSON response shape for the `bx answers` command when streaming, showing incremental content chunks. ```json {"choices": [{"delta": {"content": "R"}}]} {"choices": [{"delta": {"content": "u"}}]} {"choices": [{"delta": {"content": "s"}}]} {"choices": [{"delta": {"content": "t"}}]} {"choices": [{"delta": {"content": " "}}]} ``` -------------------------------- ### Corrective RAG Loop with Brave Search Source: https://github.com/brave/brave-search-skills/blob/main/skills/bx/SKILL.md Demonstrates a multi-step search process for complex queries, starting broad and narrowing down, then requesting a synthesized answer. ```bash # 1. Broad search bx "axum middleware authentication" --max-tokens 4096 # 2. Too general? Narrow with strict threshold bx "axum middleware tower layer authentication example" --threshold strict --max-tokens 4096 # 3. Still need synthesis? Ask for an answer bx answers "how to implement JWT auth middleware in axum" --enable-research ``` -------------------------------- ### Local POIs Skill Source: https://github.com/brave/brave-search-skills/blob/main/README.md Retrieves details for local businesses and Points of Interest (POIs), including ratings, hours, and contact information. Supports GET requests. ```APIDOC ## GET /res/v1/local/pois ### Description Fetches detailed information for local businesses and POIs, such as ratings, hours, and contact details. ### Method GET ### Endpoint /res/v1/local/pois ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the local business or POI. ### Response #### Success Response (200) - **local_pois** (array) - An array of local POI objects with details. ``` -------------------------------- ### Copy Brave Search Skills Manually for GitHub Copilot Source: https://github.com/brave/brave-search-skills/blob/main/README.md Copies Brave Search Skills from a git clone to the .github/skills directory. Requires a prior git clone. ```bash cp -r brave-search-skills/skills/* .github/skills/ ``` -------------------------------- ### Copy Brave Search Skills Manually for Codex (User-Level) Source: https://github.com/brave/brave-search-skills/blob/main/README.md Copies Brave Search Skills from a git clone to the user's ~/.agents/skills directory. Requires a prior git clone. ```bash cp -r brave-search-skills/skills/* ~/.agents/skills/ ```