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

# Search overview

> Agentic web search with four depths and three output types: sources and snippets, sourced answers, or structured JSON.

**Search** is Linkup's synchronous web search endpoint, optimized for AI consumption. Given a natural-language query, the `/search` route returns ranked sources, optionally bundled with a cited natural-language answer or with structured output matching a JSON schema. `depth` controls how much search and retrieval work the agent performs, and `outputType` selects the shape of the response.

## Modes

**Search** comes with four `depth` modes:

| Mode | Description | Latency |
| - | - | - |
| `"flash"` (Alpha) | Lowest latency. Ranked sources and snippets from our index, no query reinterpretation, no LLM. | \<200 ms |
| `"fast"` | Higher-quality one-shot retrieval. Query passed as-is to our index; no agentic planning. | \~1s |
| `"standard"` | Single-iteration agentic search. The agent interprets the query, can run parallel sub-searches, and can scrape one URL provided in the query. | 1–3s |
| `"deep"` | Multi-iteration agentic search-and-scrape chaining with evaluation. | 5–30s |

## Agentic search (`"standard"`, `"deep"`)

In `"standard"` and `"deep"`, the system interprets the query, plans the retrieval, and evaluates the outputs returned. This means those two modes understand instructions on how to behave/perform the search.

> [!NOTE]
>
> `"flash"` and `"fast"` do not invoke an LLM for retrieval. No query interpretation, no scraping — the query is passed as-is to the index.

Depending on the prompt and the selected depth, the agent may:

* run one or several web searches,
* open and scrape webpages,
* reuse information discovered in earlier steps,
* refine or expand queries until the requested data is found.

Instructions inside the query are followed literally. The prompt below is executed step by step:

```text theme={"system"}
First, find the official website of the AI company linkup, 
then scrape the page and return the full content
```

For more information, read [search best practices](https://docs.linkup.so/pages/documentation/endpoints/search/best-practices.md).

## Output types

| Output Type | Description |
| - | - |
| `"searchResults"` | Array of `{name, url, content}`. Ranked URLs and content snippets for grounding. |
| `"sourcedAnswer"` | Search results plus a natural-language answer with inline citations. |
| `"structured"` | Search results plus JSON matching the caller's `structuredOutputSchema`. Requires a JSON schema in `structuredOutputSchema`; see the [structured output tutorial](https://docs.linkup.so/pages/documentation/tutorials/structured-output-guide.md). |

## Filtering and date controls

* `includeDomains` / `excludeDomains`: restrict to or exclude up to 100 domains.
* `fromDate` / `toDate`: restrict to an ISO 8601 date range.
* `maxResults`: cap the number of returned sources.
* `includeImages`: surface relevant images.

See the [domain and date filtering tutorial](https://docs.linkup.so/pages/documentation/tutorials/filtering.md)
for examples.

> [!NOTE]
>
> Authorized organizations also receive dispatches from Agence France-Presse (AFP) in their results. See [Premium Sources](https://docs.linkup.so/pages/documentation/platform/premium-sources.md).

## Pricing

Cost depends on both `depth` and `outputType`. `"sourcedAnswer"` and `"structured"` invoke an LLM and carry a small premium over raw `"searchResults"`.

| `depth` | `outputType` | Cost |
| - | - | - |
| `"flash"` / `"fast"` / `"standard"` | `"searchResults"` | \$0.005 per call |
| `"flash"` / `"fast"` / `"standard"` | `"sourcedAnswer"` / `"structured"` | \$0.006 per call |
| `"deep"` | `"searchResults"` | \$0.05 per call |
| `"deep"` | `"sourcedAnswer"` / `"structured"` | \$0.055 per call |

## Example

> [card] [Get your API key](https://app.linkup.so)
>
> Create a Linkup account for free to get your API key.

```python python theme={"system"}
from linkup import LinkupClient

client = LinkupClient(api_key="<YOUR_LINKUP_API_KEY>")

response = client.search(
    query="What is Microsoft's 2024 revenue?",
    depth="standard",
    output_type="sourcedAnswer",
)
print(response)
```

```js js theme={"system"}
import { LinkupClient } from 'linkup-sdk';

const client = new LinkupClient({ apiKey: '<YOUR_LINKUP_API_KEY>' });

const response = await client.search({
  query: "What is Microsoft's 2024 revenue?",
  depth: 'standard',
  outputType: 'sourcedAnswer',
});
console.log(response);
```

```shell curl theme={"system"}
curl "https://api.linkup.so/v1/search" \
  -G \
  -H "Authorization: Bearer $LINKUP_API_KEY" \
  --data-urlencode "q=What is Microsoft's 2024 revenue?" \
  --data-urlencode "depth=standard" \
  --data-urlencode "outputType=sourcedAnswer"
```

Successful response, by `outputType`:

```json sourcedAnswer theme={"system"}
{
  "answer": "Microsoft's revenue for fiscal year 2024 was $245.1 billion, reflecting a 16% increase from the previous year.",
  "sources": [
    {
      "name": "Microsoft 2024 Annual Report",
      "url": "https://www.microsoft.com/investor/reports/ar24/index.html",
      "snippet": "Highlights from fiscal year 2024 compared with fiscal year 2023 included: Microsoft Cloud revenue increased 23% to $137.4 billion."
    }
  ]
}
```

```json searchResults theme={"system"}
{
  "results": [
    {
      "type": "text",
      "name": "Microsoft 2024 Annual Report",
      "url": "https://www.microsoft.com/investor/reports/ar24/index.html",
      "content": "Highlights from fiscal year 2024 compared with fiscal year 2023 included: Microsoft Cloud revenue increased 23% to $137.4 billion."
    }
  ]
}
```

`"structured"` returns the JSON object described by `structuredOutputSchema`.

## Next

> [card] [Best practices](https://docs.linkup.so/pages/documentation/endpoints/search/best-practices.md)
>
> Depth selection, query phrasing, schema design.

> [card] [For AI agents](https://docs.linkup.so/pages/documentation/endpoints/search/for-agents.md)
>
> Tool definitions and integration prompt for coding agents.

> [card] [API reference](https://docs.linkup.so/pages/documentation/endpoints/search/reference.md)
>
> Full parameter spec and response schema.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.