# Claude web search answers with sources

**Use case:** 

Asks one question of Claude through the Anthropic Messages API with its web search tool, and returns the answer with the pages it cites, the pages it read and the search queries it ran. In this example Claude may run up to two searches for the answer. One answer costs $0.10 with the default Sonnet model, and no Anthropic key is needed on your side.

## Input

```json
{
  "prompts": [
    "What are the main differences between PostgreSQL and MySQL for a new web application?"
  ],
  "promptsField": "prompt",
  "engines": [
    "anthropic"
  ],
  "openaiModel": "gpt-6.1-terra",
  "anthropicModel": "claude-sonnet-5-5",
  "geminiModel": "gemini-3.8-flash",
  "alwaysSearch": true,
  "maxSearches": 2,
  "maxChecks": 1,
  "includeSources": true
}
```

## Output

```json
{
  "prompt": {
    "label": "Prompt",
    "format": "text"
  },
  "engine": {
    "label": "Engine",
    "format": "text"
  },
  "citations": {
    "label": "Citations",
    "format": "array"
  },
  "citedDomains": {
    "label": "Cited domains",
    "format": "array"
  },
  "sourceDomains": {
    "label": "Domains read",
    "format": "array"
  },
  "searchQueries": {
    "label": "Searches run",
    "format": "array"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The AI Answers API: ChatGPT, Claude & Gemini with Web Search Actor is ready to run with the inputs already set for "Claude web search answers with sources". [Sign up or log in](https://console.apify.com/create-task-from-example/AC0LhIvwHZ2EVJ1iM) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Claude web search answers with sources" task

The AI Answers API: ChatGPT, Claude & Gemini with Web Search Actor will start running based on the input automatically. You can also change all the input fields, like prompts, prompt field or column, and more, to match your specific use case.

### 3. Receive the "Claude web search answers with sources" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as prompt, engine, citations, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Claude web search answers with sources" task via API](https://apify.com/localwire/ai-answers.md).

## FAQ

### What does the "Claude web search answers with sources" task return?

The "Claude web search answers with sources" task returns one record per prompt: the answer, its citations with URL, title and domain, the cited domains, the domains read and the search queries.

### How many web searches does Claude run in the Claude web search task?

Up to two for each answer in the Claude web search task. The maxSearches field sets the limit and accepts 1 to 3. The usage.searches field of the record shows how many were run.

### How do I run the "Claude web search answers with sources" task on a schedule or from code?

Copy the "Claude web search answers with sources" task to your Apify account, then add a schedule in Apify Console or start it with the Run task API endpoint. Results download as JSON, CSV or Excel.

## About this Actor

This example demonstrates how to use [AI Answers API: ChatGPT, Claude & Gemini with Web Search](https://apify.com/localwire/ai-answers.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/localwire/ai-answers.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/localwire/ai-answers.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
