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

# Query parameters

> Complete reference for all Andi AI Search API query parameters.

All parameters work on both `GET /api/v1/search` (as query string parameters) and `POST /api/v1/search` (as JSON body fields). POST is preferred for location-bearing requests.

<Tip>
  Most integrations only need `q` and `searchMode`. The filtering and output parameters below are available when you need more control.
</Tip>

## Core parameters

| Parameter    | Type    | Default      | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `q`          | string  | **required** | Search query string. Also accepts a JSON array of up to 5 queries (e.g., `["query one", "query two"]`).                                                                                                                                                                                           |
| `limit`      | integer | `10`         | Maximum results to return (1–100)                                                                                                                                                                                                                                                                 |
| `offset`     | integer | `0`          | Results to skip for pagination                                                                                                                                                                                                                                                                    |
| `searchMode` | string  | `auto`       | `auto` (default) sets the search effort per query automatically. Fixed modes — `low-cost`, `fast`, `balanced`, `deep`, `exhaustive` — pin an effort level. See [search modes](/search/search-modes).                                                                                              |
| `effort`     | string  | —            | Pins an effort level by generic tier name instead of a mode: `low`, `medium`, `high`, `max` (map to `fast`, `balanced`, `deep`, `exhaustive`). An explicit `searchMode` wins over `effort`. Omit for the adaptive default. See [the effort parameter](/search/search-modes#the-effort-parameter). |
| `intent`     | string  | `auto`       | Force search intent. `auto` detects from the query; `none` disables intent detection. See [intent values](#intent-values) below.                                                                                                                                                                  |

### Intent values

When not set, the API auto-detects intent from the query. You can force a specific intent using common aliases:

| Alias       | Description         | Alias       | Description         |
| ----------- | ------------------- | ----------- | ------------------- |
| `search`    | General web search  | `news`      | Latest news results |
| `video`     | Video search        | `images`    | Image search        |
| `weather`   | Weather data        | `calculate` | Math computation    |
| `wiki`      | Wikipedia/knowledge | `knowledge` | Academic knowledge  |
| `code`      | Programming results | `recipe`    | Recipe results      |
| `place`     | Business search     | `places`    | Location search     |
| `questions` | Q\&A results        | `time`      | Time queries        |

The API also accepts full intent names (e.g., `FallbackSearchIntent`, `VideoSearchIntent`) and resolves matches flexibly through exact match, case-insensitive match, and substring match.

```bash theme={null}
# Force news intent
curl "https://api.andiai.com/api/v1/search?q=AI+startups&intent=news" \
  -H "x-api-key: YOUR_API_KEY"
```

## Output parameters

| Parameter          | Type    | Default                               | Description                                                                                                                                                                                            |
| ------------------ | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `format`           | string  | `json`                                | Response format: `json` or `context`. The `context` format returns results as markdown text with YAML frontmatter, suitable for LLM context windows. See [response format](/features/response-format). |
| `metadata`         | string  | `basic`                               | Metadata level: `basic` or `full`. With `full`, results include `contentType` and `reader` data.                                                                                                       |
| `extracts`         | boolean | `false` (`true` for `format=context`) | Include longer text extracts from result pages                                                                                                                                                         |
| `enrichContent`    | boolean | `false`                               | Fetch full page content via the reader service. Budget scales with `searchMode` (fast \~2.5s cap, exhaustive \~12s cap).                                                                               |
| `maxContentLength` | integer | —                                     | Caps enriched content length                                                                                                                                                                           |
| `imageFormat`      | string  | `long`                                | Image field naming: `short` or `long`                                                                                                                                                                  |
| `linkFormat`       | string  | `link`                                | Field name for result URLs: `link` (default) or `url`                                                                                                                                                  |

```bash theme={null}
# Get results as markdown for LLM context
curl "https://api.andiai.com/api/v1/search?q=machine+learning&format=context" \
  -H "x-api-key: YOUR_API_KEY"

# Get results with text extracts
curl "https://api.andiai.com/api/v1/search?q=machine+learning&extracts=true" \
  -H "x-api-key: YOUR_API_KEY"
```

<Warning>
  `metadata=full` adds latency because it fetches additional data from each result page. Use it only when you need `contentType` or `reader` data.
</Warning>

## Locale and safety parameters

| Parameter       | Type   | Default | Description                                                                                    |
| --------------- | ------ | ------- | ---------------------------------------------------------------------------------------------- |
| `safe`          | string | `off`   | Safe search level: `off`, `moderate`, or `strict`                                              |
| `country`       | string | `US`    | ISO 3166-1 country code for locale bias (e.g., `US`, `GB`, `DE`)                               |
| `sourceCountry` | string | —       | ISO 3166-1 country code to restrict results by source country                                  |
| `language`      | string | `en`    | ISO 639-1 language code (e.g., `en`, `es`, `fr`). The `lang:` query operator takes precedence. |
| `units`         | string | —       | Unit system for weather/calculations: `metric`, `imperial`. Defaults based on `country`.       |

## Date filtering

| Parameter   | Type   | Description                                                                     |
| ----------- | ------ | ------------------------------------------------------------------------------- |
| `dateRange` | string | Relative range: `day`, `week`, `month`, `year`, `24h`, `7d`, `30d`, `90d`, `1y` |
| `dateFrom`  | date   | Results published on or after this date (`YYYY-MM-DD`)                          |
| `dateTo`    | date   | Results published on or before this date (`YYYY-MM-DD`)                         |

Use either `dateRange` for relative filtering or `dateFrom`/`dateTo` for absolute date ranges. See [filtering](/features/filtering) for examples and details.

## Domain filtering

| Parameter        | Type   | Description                                     |
| ---------------- | ------ | ----------------------------------------------- |
| `includeDomains` | string | Comma-separated domains to restrict results to  |
| `excludeDomains` | string | Comma-separated domains to exclude from results |

Both support wildcards: `*.example.com` matches all subdomains. See [filtering](/features/filtering) for examples and details.

## Term filtering

| Parameter      | Type   | Description                                       |
| -------------- | ------ | ------------------------------------------------- |
| `includeTerms` | string | Comma-separated terms that must appear in results |
| `excludeTerms` | string | Comma-separated terms to exclude from results     |

## Content filtering

| Parameter  | Type   | Description                                      |
| ---------- | ------ | ------------------------------------------------ |
| `filetype` | string | File extension to filter by (e.g., `pdf`, `doc`) |
| `intitle`  | string | Term that must appear in the page title          |
| `inurl`    | string | Term that must appear in the page URL            |
| `intext`   | string | Term that must appear in the page body           |

## Behavior parameters

| Parameter        | Type    | Default | Description                                                                                                                                                                                                                                     |
| ---------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `noCache`        | boolean | `false` | Bypass cached results                                                                                                                                                                                                                           |
| `parseOperators` | boolean | `true`  | Parse [query operators](/features/query-operators) from the query string. Set to `false` to treat operator syntax as literal text.                                                                                                              |
| `reranker`       | string  | `auto`  | Semantic reranker strength: `auto`, `small`, `medium`, `large`, or `xl`. Higher values improve result ordering for complex queries at the cost of latency. `xl` requires `deep` or `exhaustive` mode. See [search modes](/search/search-modes). |

## Location parameters

Location can be passed as flat keys on GET or POST. Prefer POST for location-bearing requests — a request body keeps coordinates out of URL query strings and access logs.

| Parameter     | Type   | Description                                 |
| ------------- | ------ | ------------------------------------------- |
| `latitude`    | number | Latitude coordinate                         |
| `longitude`   | number | Longitude coordinate                        |
| `city`        | string | City name                                   |
| `state`       | string | State or region                             |
| `countryCode` | string | Country code for the location               |
| `postalCode`  | string | Postal/ZIP code                             |
| `timezone`    | string | IANA timezone (e.g., `America/Los_Angeles`) |
| `location`    | string | Display name for the location               |
| `accuracy`    | number | Location accuracy in meters                 |

## Examples

### Paginated search

```bash theme={null}
# First page
curl "https://api.andiai.com/api/v1/search?q=machine+learning&limit=10" \
  -H "x-api-key: YOUR_API_KEY"

# Second page
curl "https://api.andiai.com/api/v1/search?q=machine+learning&limit=10&offset=10" \
  -H "x-api-key: YOUR_API_KEY"
```

### Deep mode with extracts

```bash theme={null}
curl "https://api.andiai.com/api/v1/search?q=climate+change+effects&searchMode=deep&extracts=true" \
  -H "x-api-key: YOUR_API_KEY"
```

### Filtered by date and domain

```bash theme={null}
curl "https://api.andiai.com/api/v1/search?q=product+launch&dateRange=month&includeDomains=techcrunch.com,theverge.com" \
  -H "x-api-key: YOUR_API_KEY"
```

### Multi-query search

```bash theme={null}
curl -G "https://api.andiai.com/api/v1/search" \
  --data-urlencode 'q=["artificial intelligence", "machine learning"]' \
  -H "x-api-key: YOUR_API_KEY"
```

<Note>
  Multi-query search accepts a JSON array of up to 5 queries and returns combined results in a single response. URL-encode the JSON array when passing it as a query parameter.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Search modes" icon="gauge-high" href="/search/search-modes">
    Automatic effort by default, manual control when you want it.
  </Card>

  <Card title="Filtering" icon="filter" href="/features/filtering">
    Domain, date, and content filtering in depth.
  </Card>

  <Card title="Query operators" icon="terminal" href="/features/query-operators">
    In-query operators like `site:` and `filetype:`.
  </Card>

  <Card title="Response format" icon="brackets-curly" href="/features/response-format">
    Response structure and result types.
  </Card>
</CardGroup>
