Loading...
Loading...
USE FOR web search. Returns ranked results with snippets, URLs, thumbnails. Supports freshness filters, SafeSearch, Goggles for custom ranking, pagination. Primary search endpoint.
npx skill4agent add brave/brave-search-skills web-searchRequires API Key: Get one at https://api.search.brave.comPlan: Included in the Search plan. See https://api-dashboard.search.brave.com/app/subscriptions/subscribe
curl -s "https://api.search.brave.com/res/v1/web/search?q=python+web+frameworks" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"curl -s "https://api.search.brave.com/res/v1/web/search" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "q=rust programming tutorials" \
--data-urlencode "country=US" \
--data-urlencode "search_lang=en" \
--data-urlencode "count=10" \
--data-urlencode "safesearch=moderate" \
--data-urlencode "freshness=pm"GET https://api.search.brave.com/res/v1/web/search
POST https://api.search.brave.com/res/v1/web/searchX-Subscription-Token: <API_KEY>Accept-Encoding: gzip| Feature | Web Search (this) | LLM Context ( | Answers ( |
|---|---|---|---|
| Output | Structured results (links, snippets, metadata) | Pre-extracted page content for LLMs | End-to-end AI answers with citations |
| Result types | Web, news, videos, discussions, FAQ, infobox, locations, rich | Extracted text chunks, tables, code | Synthesized answer + source list |
| Unique features | Goggles, structured data ( | Token budget control, threshold modes | Multi-iteration search, streaming, OpenAI SDK compatible |
| Speed | Fast (~0.5-1s) | Fast (<1s) | Slower (~30-180s) |
| Best for | Search UIs, data extraction, custom ranking | RAG pipelines, AI agents, grounding | Chat interfaces, thorough research |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Search query (1-400 chars, max 50 words) |
| string | No | | Search country (2-letter country code or |
| string | No | | Language preference (2+ char language code) |
| string | No | | UI language (e.g., "en-US") |
| int | No | | Max results per page (1-20) |
| int | No | | Page offset for pagination (0-9) |
| string | No | | Adult content filter ( |
| string | No | - | Time filter ( |
| bool | No | | Include highlight markers |
| bool | No | | Auto-correct query |
| string | No | - | Filter result types (comma-separated) |
| string | No | - | Custom ranking filter (URL or inline) |
| bool | No | - | Get up to 5 extra snippets per result |
| bool | No | | Apply search operators |
| string | No | - | Measurement units ( |
| bool | No | | Enable rich 3rd party data callback |
| bool | No | | Include |
| Value | Description |
|---|---|
| Past day (24 hours) |
| Past week (7 days) |
| Past month (31 days) |
| Past year (365 days) |
| Custom date range |
discussionsfaqinfoboxnewsqueryvideosweblocations# Only web and video results
curl "...&result_filter=web,videos"| Header | Type | Description |
|---|---|---|
| float | User latitude (-90.0 to 90.0) |
| float | User longitude (-180.0 to 180.0) |
| string | IANA timezone (e.g., "America/San_Francisco") |
| string | City name |
| string | State/region code (ISO 3166-2) |
| string | State/region full name (e.g., "California") |
| string | 2-letter country code |
| string | Postal code (e.g., "94105") |
Priority:+X-Loc-Lattake precedence. When provided, downstream services resolve the location directly from coordinates and the text-based headers (City, State, Country, Postal-Code) are not used for location resolution. Provide text-based headers only when you don't have coordinates. Sending both won't break anything — lat/long simply wins.X-Loc-Long
| Field | Type | Description |
|---|---|---|
| string | Always |
| string | The original search query |
| string? | Spellcheck-corrected query (if changed) |
| string? | Cleaned/normalized query |
| bool? | Whether spellcheck was disabled |
| bool | Whether more pages exist |
| bool? | True if strict safesearch blocked adult results |
| object? | Applied search operators ( |
| string | Always |
| string | Page title |
| string | Page URL |
| string? | Snippet/description text |
| string? | Human-readable age (e.g., "2 days ago") |
| string? | Content language code |
| object | URL components ( |
| object? | Thumbnail ( |
| string? | Original full-size image URL |
| bool? | Whether the thumbnail is a logo |
| object? | Publisher identity ( |
| string? | ISO datetime of publication (e.g., |
| list[str]? | Up to 5 additional excerpts |
| object? | Additional links ( |
| list? | Raw schema.org structured data |
| object? | Product info and reviews |
| object? | Recipe details (ingredients, time, ratings) |
| object? | Article metadata (author, publisher, date) |
| object? | Book info (author, ISBN, rating) |
| object? | Software product info |
| object? | Aggregate ratings |
| object? | FAQ found on the page |
| object? | Movie info (directors, actors, genre) |
| object? | Video metadata (duration, views, creator) |
| object? | Location/restaurant details |
| object? | Question/answer info |
| object? | Creative work data |
| object? | Music/song data |
| object? | Organization info |
| object? | Review data |
| string? | Content type classification |
| int? | Fetch timestamp (with |
| bool | Whether results were re-ranked by Goggles |
| bool | Whether results are family-friendly |
| object? | Preferred display order (see Mixed Response below) |
| array? | Forum discussion clusters |
| string? | Forum/community name |
| int? | Number of answers/replies |
| string? | Discussion question |
| string? | Top-voted comment excerpt |
| array? | FAQ entries |
| array? | News articles |
| array? | Video results |
| array? | Knowledge graph entries |
| array? | Local POI results |
| string? | Rich result type |
| string? | Callback key for rich data |
{
"type": "search",
"query": {
"original": "python frameworks",
"altered": "python web frameworks",
"spellcheck_off": false,
"more_results_available": true
},
"web": {
"type": "search",
"results": [
{
"title": "Top Python Web Frameworks",
"url": "https://example.com/python-frameworks",
"description": "A comprehensive guide to Python web frameworks...",
"age": "2 days ago",
"language": "en",
"meta_url": {
"scheme": "https",
"netloc": "example.com",
"hostname": "example.com",
"path": "/python-frameworks"
},
"thumbnail": {
"src": "https://...",
"original": "https://original-image-url.com/img.jpg"
},
"extra_snippets": ["Additional excerpt 1...", "Additional excerpt 2..."]
}
],
"family_friendly": true
},
"mixed": {
"type": "mixed",
"main": [
{"type": "web", "index": 0, "all": false},
{"type": "web", "index": 1, "all": false},
{"type": "videos", "all": true}
],
"top": [],
"side": []
},
"videos": { "...": "..." },
"news": { "...": "..." },
"rich": {
"type": "rich",
"hint": {
"vertical": "weather",
"callback_key": "<callback_key_hex>"
}
}
}mixed| Array | Purpose |
|---|---|
| Primary result list (ordered sequence of results to display) |
| Results to display above main results |
| Results to display alongside main results (e.g., infobox) |
ResultReferencetype"web""videos"indexalltrue| Operator | Syntax | Description |
|---|---|---|
| Site | | Limit results to a specific domain |
| File extension | | Results with a specific file extension |
| File type | | Results created in a specific file type |
| In title | | Pages with term in the title |
| In body | | Pages with term in the body |
| In page | | Pages with term in title or body |
| Language | | Pages in a specific language (ISO 639-1) |
| Location | | Pages from a specific country (ISO 3166-1 alpha-2) |
| Include | | Force inclusion of a term |
| Exclude | | Exclude pages containing the term |
| Exact match | | Match the exact phrase in order |
| AND | | Both terms required (uppercase) |
| OR / NOT | | Logical operators (uppercase) |
operators=false| Method | Example |
|---|---|
| Hosted | |
| Inline | |
Hosted goggles must be on GitHub/GitLab, include,! name:,! description:headers, and be registered at https://search.brave.com/goggles/create. Inline rules need no registration.! author:
$boost=N$downrank=N$discard$site=example.com$site=example.com,boost=3\n%0A$discard\n$site=docs.python.org\n$site=developer.mozilla.org$discard,site=pinterest.com\n$discard,site=quora.com# 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}"GET https://api.search.brave.com/res/v1/web/rich| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Callback key from the web search |
llm-contextschemasoffsetcount