# aspire docs api search command

## Name

`aspire docs api search` - Search Aspire API reference documentation by keyword.

## Synopsis

```bash title="Aspire CLI"
aspire docs api search <query> [options]
```

## Description

The `aspire docs api search` command performs a keyword-based search across the Aspire API reference index from [aspire.dev](https://aspire.dev). Use it to find types, methods, extension methods, or other API members by name or concept, without needing to know the exact package hierarchy.

Results are ranked by relevance and include the identifier and display name for each match. Use the identifier returned in search results with the [`aspire docs api get`](../aspire-docs-api-get/) command to retrieve the full content of an API reference entry.

Optionally filter results to a specific language using the `--language` option.

## Arguments

- **`<query>`**

  The search query. Use type names, method names, or keywords to describe the API you are looking for. For example, `AddRedis`, `IResourceBuilder`, or `WithReference`.

## Options

The following options are available:

- **`--language <language>`**

  Filter results to a specific language. Supported values are `csharp` and `typescript`. When omitted, results from all supported languages are returned.

- **`--format <Table|Json>`**

  Output format. Choose `Table` for a human-readable table or `Json` for machine-readable JSON output. Defaults to `Table`.

- **`-n, --limit <limit>`**

  Maximum number of search results to return. Defaults to `5`.

- <Include relativePath="reference/cli/includes/option-help.md" />

- <Include relativePath="reference/cli/includes/option-log-level.md" />

- <Include relativePath="reference/cli/includes/option-non-interactive.md" />

- <Include relativePath="reference/cli/includes/option-nologo.md" />

- <Include relativePath="reference/cli/includes/option-banner.md" />

- <Include relativePath="reference/cli/includes/option-wait.md" />

## Examples

- Search for API entries related to Redis:

  ```bash title="Aspire CLI"
  aspire docs api search "AddRedis"
  ```

- Search in C# only:

  ```bash title="Aspire CLI"
  aspire docs api search "IResourceBuilder" --language csharp
  ```

- Search in TypeScript only:

  ```bash title="Aspire CLI"
  aspire docs api search "withReference" --language typescript
  ```

- Search with a custom result limit:

  ```bash title="Aspire CLI"
  aspire docs api search "WithCommand" --language csharp --limit 10
  ```

- Search and output results in JSON format:

  ```bash title="Aspire CLI"
  aspire docs api search "service defaults" --format Json
  ```

## See also

- [aspire docs api command](../aspire-docs-api/)
- [aspire docs api list command](../aspire-docs-api-list/)
- [aspire docs api get command](../aspire-docs-api-get/)