> ## Documentation Index
> Fetch the complete documentation index at: https://test-62a57ffd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Summarizer search

> State-of-the-art AI-powered search that generates comprehensive answers and summaries from web search results

## Overview

Brave Summarizer Search API leverages advanced AI to provide intelligent summaries and
answers based on real-time web search results. Our "Answer with AI" feature goes beyond
traditional search by understanding your query, gathering relevant information from across
the web, and synthesizing it into clear, comprehensive responses with citations.

<Note>
  Access to Summarizer is available through the **Pro AI plan**. [Subscribe to
  Pro
  AI](https://api-dashboard.search.brave.com/app/subscriptions/subscribe?tab=ai)
  to unlock these advanced features.
</Note>

## Key Features

<CardGroup cols={2}>
  <Card title="AI-Generated Answers" icon="wand-magic-sparkles">
    Get comprehensive, AI-synthesized answers to your questions with citations
  </Card>

  <Card title="Multiple Endpoints" icon="sitemap">
    Access summaries through various specialized endpoints for different use
    cases
  </Card>

  <Card title="Entity Enrichment" icon="sparkles">
    Get detailed information about entities mentioned in summaries
  </Card>

  <Card title="Inline Citations" icon="quote-left">
    Answers include inline references to source materials
  </Card>
</CardGroup>

## API Reference

<Card title="Summarizer API Documentation" icon="code" href="/api-reference/summarizer/summarizer_search">
  View the complete API reference, including endpoints, parameters, and example
  requests
</Card>

## Use Cases

Summarizer Search is perfect for:

* **AI Assistants**: Build intelligent chat interfaces with web-grounded answers
* **Research Tools**: Quickly synthesize information from multiple sources
* **Question Answering**: Provide direct answers to user questions
* **Content Summarization**: Generate summaries of web content on any topic
* **Knowledge Applications**: Create applications that need factual, cited information

## Available Endpoints

The Summarizer API provides multiple specialized endpoints:

```bash theme={null}
# Main endpoints
https://api.search.brave.com/res/v1/web/search
https://api.search.brave.com/res/v1/summarizer/search
https://api.search.brave.com/res/v1/summarizer/summary
https://api.search.brave.com/res/v1/summarizer/summary_streaming

# Specialized endpoints
https://api.search.brave.com/res/v1/summarizer/title
https://api.search.brave.com/res/v1/summarizer/enrichments
https://api.search.brave.com/res/v1/summarizer/followups
https://api.search.brave.com/res/v1/summarizer/entity_info
```

<Note>
  **Looking for the OpenAI-compatible endpoint?** Check out [AI
  Grounding](/services/ai-grounding) for direct AI answers using the
  `/res/v1/chat/completions` endpoint with OpenAI SDK compatibility.
</Note>

## How Summarizer Works

### The Traditional Flow (Web Search + Summarizer)

This method gives you full control over the search results and summary generation:

#### Step 1: Web Search with Summary Flag

First, make a web search request with the `summary=1` parameter:

```bash theme={null}
curl -s --compressed "https://api.search.brave.com/res/v1/web/search?q=what+is+the+second+highest+mountain&summary=1" \
  -H "Accept: application/json" \
  -H "Accept-Encoding: gzip" \
  -H "X-Subscription-Token: <YOUR_API_KEY>"
```

#### Step 2: Extract the Summarizer Key

If the query is eligible for summarization, the response includes a `summarizer` object with a `key`:

```json theme={null}
{
  "summarizer": {
    "type": "summarizer",
    "key": "{\"query\": \"what is the second highest mountain\", \"country\": \"us\", \"language\": \"en\", \"safesearch\": \"moderate\", \"results_hash\": \"a51e129180225a2f4fe1a00984bcbf58f0ae0625c97723aae43c2c6e3440715b}"
  }
}
```

<Warning>
  Treat the key as an opaque string. The format may change in the future, so
  always pass it as-is without parsing.
</Warning>

#### Step 3: Fetch the Summary

Use the key to retrieve the complete summary:

```bash theme={null}
curl -s --compressed "https://api.search.brave.com/res/v1/summarizer/search?key=<URL_ENCODED_KEY>&entity_info=1" \
  -H "Accept: application/json" \
  -H "Accept-Encoding: gzip" \
  -H "X-Subscription-Token: <YOUR_API_KEY>"
```

<Note>
  Summarizer requests are **not billed** - only the initial web search request
  counts toward your plan limits.
</Note>

## Advanced Features

### Inline References

Get inline citations within the summary text:

```bash theme={null}
curl -s --compressed "https://api.search.brave.com/res/v1/summarizer/search?key=<KEY>&inline_references=true" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: <YOUR_API_KEY>"
```

This adds reference markers throughout the summary text, allowing users to see which sources support each statement.

### Entity Information

Retrieve detailed information about entities mentioned in the summary:

```bash theme={null}
curl -s --compressed "https://api.search.brave.com/res/v1/summarizer/search?key=<KEY>&entity_info=1" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: <YOUR_API_KEY>"
```

The response includes descriptions, images, and metadata about key entities.

## Complete Python Example

Here's a full example demonstrating the traditional flow:

```python theme={null}
import asyncio
import json
from urllib.parse import urljoin
from aiohttp import ClientSession, ClientTimeout, TCPConnector
from aiolimiter import AsyncLimiter

# Configuration
API_KEY = "your_api_key"
API_HOST = "https://api.search.brave.com"
API_RATE_LIMIT = AsyncLimiter(1, 1)

API_PATH = {
    "web": urljoin(API_HOST, "res/v1/web/search"),
    "summarizer_search": urljoin(API_HOST, "res/v1/summarizer/search"),
}

API_HEADERS = {
    "web": {"X-Subscription-Token": API_KEY},
    "summarizer": {"X-Subscription-Token": API_KEY},
}

async def get_summary(session: ClientSession) -> None:
    # Step 1: Get web search results with summary flag
    async with session.get(
        API_PATH["web"],
        params={"q": "what is the second highest mountain", "summary": 1},
        headers=API_HEADERS["web"],
    ) as response:
        data = await response.json()

        if response.status != 200:
            print("Error fetching web results")
            return

    # Step 2: Extract summary key
    summary_key = data.get("summarizer", {}).get("key")

    if not summary_key:
        print("No summary available for this query")
        return

    # Step 3: Fetch the summary
    async with session.get(
        url=API_PATH["summarizer_search"],
        params={"key": summary_key, "entity_info": 1},
        headers=API_HEADERS["summarizer"],
    ) as response:
        summary_data = await response.json()
        print(json.dumps(summary_data, indent=2))

async def main():
    async with API_RATE_LIMIT:
        async with ClientSession(
            connector=TCPConnector(limit=1),
            timeout=ClientTimeout(20),
        ) as session:
            await get_summary(session=session)

asyncio.run(main())
```

## Response Structure

Summarizer responses include:

* **status**: Current status (`complete` or `failed`)
* **title**: A title for the summary
* **summary**: The main summary content with text and entities
* **enrichments**: Additional data including:
  * Raw text summary
  * Related images
  * Q\&A pairs
  * Entity details
  * Source references
* **followups**: Suggested follow-up queries
* **entities\_info**: Detailed entity information (when requested)

## Best Practices

### Caching

* Summary results are cached for a limited time
* After cache expiration, restart the flow with a new web search
* Implement client-side caching to minimize API calls

### Error Handling

* Check if `summarizer.key` exists in web search response
* Handle `failed` status in summarizer response
* Implement retry logic for transient failures

### Rate Limiting

* Only web search requests count toward rate limits
* Summarizer endpoint calls are free
* Implement rate limiting on your end to avoid throttling

## Specialized Endpoints

The API provides additional endpoints for specific use cases:

* **/summarizer/summary**: Get just the summary without full search results
* **/summarizer/summary\_streaming**: Stream the summary in real-time
* **/summarizer/title**: Fetch only the summary title
* **/summarizer/enrichments**: Get enrichment data separately
* **/summarizer/followups**: Retrieve follow-up question suggestions
* **/summarizer/entity\_info**: Fetch entity information independently

These endpoints all use the same `key` parameter obtained from the initial web search.

## Summarizer Search vs AI Grounding

Brave offers two complementary approaches for AI-powered search:

<CardGroup cols={2}>
  <Card title="Summarizer Search" icon="list" href="/services/summarizer">
    **Two-step workflow** that first retrieves search results, then generates
    summaries. Best when you need control over search results or want to use
    specialized summarizer endpoints.
  </Card>

  <Card title="AI Grounding" icon="wand-magic-sparkles" href="/services/ai-grounding">
    **Direct AI answers** using OpenAI-compatible endpoint. Best for building
    chat interfaces and applications that need instant, grounded AI responses.
  </Card>
</CardGroup>

**When to use Summarizer Search:**

* Need access to underlying search results
* Want to use specialized endpoints (title, enrichments, followups, etc.)
* Building applications with custom search result processing
* Prefer the traditional web search + summarization flow

**When to use AI Grounding:**

* Building conversational AI applications
* Need OpenAI SDK compatibility
* Want simple, single-endpoint integration
* Require research mode for thorough answers

Learn more about [AI Grounding](/services/ai-grounding).

## Changelog

This changelog outlines all significant changes to the Brave Summarizer Search API in chronological order.

### 2025-06-13

* Add inline references to summarizer answers via `inline_references=true` query parameter
* Available on `/res/v1/summarizer/search` and `/res/v1/summarizer/summary` endpoints

### 2024-04-23

* Launch "Answer with AI" resource
* Replaces previous Summarizer API with enhanced capabilities

### 2023-08-25

* Initial Brave Summarizer Search API release (now deprecated)
