# Brave Search API

<p><strong>Brave Search API documentation</strong> for developers who need Brave web results in JSON. Scrappa's <code>GET /api/brave/search</code> endpoint scrapes <code>search.brave.com</code> HTML through an approved proxy layer and returns organic results, related searches, and related questions.</p><h2>Brave Search API for web results</h2><p>Use this endpoint when you want independent Brave Search coverage instead of Google results. It is a proxy-backed HTML scrape of Brave Search, not the official Brave Search API and not a Google Search alias.</p><h2>How to call the Brave Search API</h2><p>Send a <code>GET</code> request to <code>/api/brave/search</code> with a required <code>query</code> parameter and your Scrappa API key in the <code>x-api-key</code> header. The <code>q</code> alias is also accepted. Optional parameters include <code>language</code>, <code>page</code>, and <code>include_html</code>.</p><h2>Response fields</h2><p>The response includes <code>organic_results</code> with <code>position</code>, <code>title</code>, <code>link</code>, <code>snippet</code>, and <code>source</code>, plus <code>related_searches</code>, <code>related_questions</code>, <code>results_count</code>, and a top-level <code>source</code> of <code>brave</code>.</p>

- **Documentation:** [https://scrappa.co/docs/brave-search-api/brave_search](https://scrappa.co/docs/brave-search-api/brave_search)
- **API group:** Brave Search API
- **Endpoint:** `GET https://scrappa.co/api/brave/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | <p>The Brave search query string. Use this parameter for new integrations.</p><p><strong>Example:</strong> <code>privacy tools</code></p> |
| `q` | string | No | <p>Alias for <code>query</code>. Prefer <code>query</code> for new integrations.</p> |
| `language` | string | No | <p>Language filter for Brave results. Accepts named values or ISO 639-1 codes.</p><p><strong>Values:</strong> <code>english</code>, <code>deutsch</code>, <code>french</code>, <code>spanish</code>, <code>italian</code>, <code>portuguese</code>, <code>dutch</code>, <code>russian</code>, <code>chinese</code>, <code>japanese</code>, <code>arabic</code>, <code>all</code>, or <code>en</code>, <code>de</code>, <code>fr</code>, <code>es</code>, <code>it</code>, <code>pt</code>, <code>nl</code>, <code>ru</code>, <code>zh</code>, <code>ja</code>, <code>ar</code></p><p><strong>Default:</strong> <code>all</code></p> |
| `page` | string | No | <p>Result page number.</p><p><strong>Range:</strong> 1-10</p><p><strong>Default:</strong> 1</p> |
| `include_html` | string | No | <p>Include the raw Brave Search HTML in the JSON response for diagnostics.</p><p><strong>Default:</strong> <code>false</code></p> |

## Example response

```json
{
    "source": "brave",
    "engine_used": "brave",
    "results_count": 2,
    "organic_results": [
        {
            "link": "https://example.com/privacy-tools",
            "title": "Privacy Tools",
            "source": "example.com",
            "snippet": "A list of privacy tools and private search engines.",
            "position": 1,
            "redirect_link": "https://example.com/privacy-tools",
            "displayed_link": "example.com"
        },
        {
            "link": "https://example.org/private-search",
            "title": "Private Search Engines",
            "source": "example.org",
            "snippet": "Compare independent search engines that do not track users.",
            "position": 2,
            "redirect_link": "https://example.org/private-search",
            "displayed_link": "example.org"
        }
    ],
    "related_searches": [
        {
            "link": "https://search.brave.com/search?q=private+search+engines",
            "query": "private search engines"
        }
    ],
    "related_questions": [
        {
            "question": "What are privacy tools?"
        }
    ],
    "search_information": {
        "query_displayed": "privacy tools"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The query is missing, or a language, page, or include_html parameter failed validation. |
| 503 | Brave Temporarily Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
