> ## Documentation Index
> Fetch the complete documentation index at: https://docs.case.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Search Overview

> Search the web and generate AI answers with citations

A programmatic deep research engine. Add web search and AI-powered research to your app—let your users get answers with citations, or run comprehensive multi-step research.

<Warning>
  **Web data only.** This searches publicly available web content. For comprehensive legal research (case law, statutes, regulations), use specialized platforms like Lexis, Westlaw, or OpenLaws.
</Warning>

## Quick start

<CodeGroup>
  ```bash title="cURL" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  curl -X POST https://api.case.dev/search/v1/answer \
    -H "Authorization: Bearer $CASEDEV_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "query": "What is the statute of limitations for medical malpractice in California?",
      "includeDomains": ["law.cornell.edu", "findlaw.com"]
    }'
  ```

  ```bash title="CLI" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  casedev search:v1 answer \
    --query "What is the statute of limitations?"
  ```

  ```typescript title="Typescript" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  import Casedev from 'casedev';

  const client = new Casedev({ apiKey: process.env.CASEDEV_API_KEY });

  // Answer your user's question with citations
  const answer = await client.search.v1.answer({
    query: userQuestion,
    includeDomains: ['law.cornell.edu', 'findlaw.com']
  });

  // Return answer with sources to your user
  console.log(answer.answer);
  // "In California, the statute of limitations for medical malpractice
  //  is 3 years from the date of injury or 1 year from discovery [1]..."

  console.log(answer.citations);
  ```

  ```python title="Python" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  import casedev

  client = casedev.Casedev(api_key=os.environ['CASEDEV_API_KEY'])

  # Answer your user's question with citations
  answer = client.search.v1.answer(
      query=user_question,
      include_domains=['law.cornell.edu', 'findlaw.com']
  )

  # Return answer with sources to your user
  print(answer.answer)
  print(answer.citations)
  ```

  ```go title="Go" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  result, _ := client.Search.V1.Answer(ctx, casedev.SearchV1AnswerParams{
  	Query: casedev.F("What is the statute of limitations?"),
  })
  fmt.Println(result.Answer)
  for _, c := range result.Citations {
  	fmt.Printf("[%s] %s: %s\n", c.ID, c.Title, c.URL)
  }
  ```
</CodeGroup>

## Endpoints

<CardGroup>
  <Card title="Search" href="/web-search/search">
    `POST /search/v1/search` — Web search with domain filtering
  </Card>

  <Card title="AI Answer" href="/web-search/answer">
    `POST /search/v1/answer` — Get AI answers with citations
  </Card>

  <Card title="Research" href="/web-search/research">
    `POST /search/v1/research` — Deep multi-step research
  </Card>
</CardGroup>

## Use cases

Build these capabilities for your users:

| Feature                 | Endpoint    | Example                                                 |
| ----------------------- | ----------- | ------------------------------------------------------- |
| **Research assistant**  | `/research` | Let users research topics and get comprehensive reports |
| **Fact verification**   | `/answer`   | Verify claims with sourced answers                      |
| **News monitoring**     | `/search`   | Monitor web for relevant news and updates               |
| **Background research** | `/search`   | Find public records and business information            |

## Related services

<CardGroup>
  <Card title="LLMs" href="/llms">
    Combine search results with LLMs for deeper analysis and synthesis
  </Card>

  <Card title="Format" href="/format">
    Generate polished research reports from search results
  </Card>
</CardGroup>
