Brave Search API via curl. Use this skill for privacy-focused web, image, video, and news search with no tracking.
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
Use the Brave Search API via direct curl calls to perform privacy-focused web searches with no user tracking.
Official docs:
https://api.search.brave.com/app/documentation
Use this skill when you need to:
export BRAVE_API_KEY="your-api-key"
| Plan | Price | Rate Limit | Monthly Cap |
|---|---|---|---|
| Free | $0 | 1 query/sec | 2,000 queries |
| Base | $5/1000 | 20 query/sec | 20M queries |
| Pro | $9/1000 | 50 query/sec | Unlimited |
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
All examples below assume you have BRAVE_API_KEY set.
The base URL for the API is:
https://api.search.brave.com/res/v1Authentication uses the X-Subscription-Token header.
Search the web with a query:
bash -c 'curl -s "https://api.search.brave.com/res/v1/web/search?q=artificial+intelligence" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}"' | jq '.web.results[:3] | .[] | {title, url, description}
Customize search with country, language, and result count:
bash -c 'curl -s "https://api.search.brave.com/res/v1/web/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=best restaurants" -d "country=us" -d "search_lang=en" -d "count=5"' | jq '.web.results[] | {title, url}
Parameters:
q: Search query (required, max 400 chars / 50 words)country: Two-letter country code (e.g., us, gb, jp)search_lang: Language code (e.g., en, zh, ja)count: Results per page (1-20, default: 10)offset: Pagination offset (0-9, default: 0)Control explicit content filtering:
bash -c 'curl -s "https://api.search.brave.com/res/v1/web/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=programming tutorials" -d "safesearch=strict"' | jq '.web.results[:3] | .[] | {title, url}
Options: off, strict (Note: Image/Video search only supports off and strict)
Filter results by time:
bash -c 'curl -s "https://api.search.brave.com/res/v1/web/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=tech news" -d "freshness=pd"' | jq '.web.results[:3] | .[] | {title, url, age}
Options:
pd: Past day (24 hours)pw: Past weekpm: Past monthpy: Past yearYYYY-MM-DDtoYYYY-MM-DD: Custom date rangeSearch for images:
bash -c 'curl -s "https://api.search.brave.com/res/v1/images/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=sunset beach" -d "count=5" -d "safesearch=strict"' | jq '.results[] | {title, url: .properties.url, thumbnail: .thumbnail.src}
Image search supports up to 200 results per request.
Search for videos:
bash -c 'curl -s "https://api.search.brave.com/res/v1/videos/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=learn python" -d "count=5"' | jq '.results[] | {title, url, duration}
Video search supports up to 50 results per request.
Search for recent news articles:
bash -c 'curl -s "https://api.search.brave.com/res/v1/news/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=technology" -d "count=3"' | jq '.results[:3] | .[] | {title, url, age}
News search defaults to past day (pd) freshness.
Get more results with offset:
bash -c 'curl -s "https://api.search.brave.com/res/v1/web/search" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}" -G --data-urlencode "q=machine learning" -d "count=10" -d "offset=1"' | jq '.web.results[] | {title, url}
offset=1 skips the first page of results.
View the full response structure:
bash -c 'curl -s "https://api.search.brave.com/res/v1/web/search?q=test" -H "Accept: application/json" -H "X-Subscription-Token: ${BRAVE_API_KEY}"' | jq 'keys
Response includes: query, mixed, type, web, videos, news, etc.
{
"query": { "original": "search term" },
"web": {
"results": [
{
"title": "Page Title",
"url": "https://example.com",
"description": "Page description...",
"age": "2 days ago"
}
]
}
}
{
"results": [
{
"title": "Image Title",
"properties": { "url": "https://..." },
"thumbnail": { "src": "https://..." }
}
]
}
--data-urlencode for special characterspd or pw