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

# Search Autocomplete

> Get real-time autocomplete suggestions for OMOP medical terminology searches, with optional vocabulary and domain filters.

## Overview

This endpoint provides bounded autocomplete suggestions as users type. It uses prefix matching with a fuzzy fallback for longer queries and supports vocabulary and domain filters.

Autocomplete is not a paginated search endpoint. Use `page_size` to bound the suggestion list; `page` and `algorithm` are not supported. Use [Basic Search](https://docs.omophub.com/api-reference/search/basic-search.md) when you need pagination.

## Query Parameters

**query** `string` *required*

Search query for autocompletion (minimum 2 characters, maximum 100)

**vocabulary\_ids** `string`

Filter suggestions to specific vocabularies (comma-separated)

**Examples**: `SNOMED`, `ICD10CM,LOINC`, `RxNorm`

**domain\_ids** `string`

Filter suggestions to specific domains (comma-separated)

**Examples**: `Condition`, `Drug,Procedure`

**page\_size** `integer` (default: 10)

Maximum number of suggestions to return (1-20)

**vocab\_release** `string`

Specific vocabulary release version (defaults to latest)

## Response

**success** `boolean`

Whether autocomplete completed.

**data.query** `string`

The submitted query.

**data.suggestions** `array`

Compact suggestion records containing `suggestion`, `type`, and `count`.

**data.page\_size** `integer`

Maximum number of suggestions requested.

**meta.search** `object`

Search metadata including the query, returned count, and applied filters.

```bash cURL theme={null}
curl -X GET "https://api.omophub.com/v1/search/autocomplete?query=diab&page_size=5" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://api.omophub.com/v1/search/autocomplete",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={
        "query": "diab",
        "vocabulary_ids": "SNOMED,ICD10CM",
        "page_size": 10
    }
)

payload = response.json()
suggestions = payload["data"]["suggestions"]
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "query": "diab",
    "suggestions": [
      {
        "suggestion": "Diabetes mellitus",
        "type": "concept_name",
        "count": 12
      },
      {
        "suggestion": "Diabetic retinopathy",
        "type": "concept_name",
        "count": 4
      }
    ],
    "page_size": 5
  },
  "meta": {
    "request_id": "req_01JEXAMPLE",
    "timestamp": "2026-09-07T12:00:00.000Z",
    "vocab_release": "2026.2",
    "search": {
      "query": "diab",
      "total_results": 2,
      "filters_applied": {
        "search_type": "autocomplete"
      }
    }
  }
}
```

## Usage Examples

### Basic Autocomplete

Get suggestions for a partial query:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/search/autocomplete?query=asth&page_size=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Vocabulary-Filtered Autocomplete

Focus suggestions on specific vocabularies:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/search/autocomplete?query=hyper&vocabulary_ids=SNOMED,ICD10CM&page_size=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Domain-Filtered Autocomplete

Get suggestions only for specific domains:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/search/autocomplete?query=aspir&domain_ids=Drug&page_size=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Performance Notes

* **Minimum query length**: 2 characters required
* **Response time**: Optimized for real-time use (\<100ms typical)
* **Caching**: Results are cached for 24 hours per vocabulary release
* **Rate limiting**: Standard rate limits apply

## Related Endpoints

* [Basic Search](https://docs.omophub.com/api-reference/search/basic-search.md) - Full-text search with filters
* [Similarity Search](https://docs.omophub.com/api-reference/search/semantic-search.md) - Find semantically similar concepts


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