> ## 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 Suggest

## Overview

Returns valid OMOP concepts using exact published synonyms, concept-name prefixes
and substrings, and source-code prefixes. The endpoint does not calculate or
return a relevance or confidence score.

### Ordering

Clinical utility is the outer ordering tier under the API's
[default ranking policy](https://docs.omophub.com/api-reference/search/basic-search.md):
questionnaire answer-list entries, survey values and LOINC structural parts rank
last by default, and Standard concepts outrank non-standard ones. Within one
utility tier, exact primary names and exact source codes lead, followed by exact
published synonyms, name prefixes, code prefixes, and name substrings. Core
clinical domains are preferred next, followed by shorter completion text,
vocabulary authority, alphabetical name, and `concept_id`.

Before that policy existed, this endpoint ordered by
`standard_concept, LENGTH(concept_name), concept_name` alone — effectively "the
shortest standard name starting with what you typed" — so `diabetes` returned the
LOINC answer-list entry named `Diabetes` (8 characters) ahead of
`201820 Diabetes mellitus` (17).

> [!NOTE]
>
> Synonym evidence is deliberately exact-only on this typeahead endpoint. Use
> [`/v1/search/concepts`](https://docs.omophub.com/api-reference/search/basic-search) for token, phrase,
> and fuzzy synonym retrieval.

## Query Parameters

**query** `string` *required*

Partial concept name, exact synonym, or source-code prefix. Must contain
between 2 and 100 characters.

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

Number of suggestions to return. Minimum 1, maximum 100.

**vocabulary\_ids** `string`

Comma-separated vocabulary IDs, such as `SNOMED,ICD10CM`.

**domain\_ids** `string`

Comma-separated domain IDs, such as `Condition,Drug`.

**concept\_class\_ids** `string`

Comma-separated concept classes. Explicit requests for `Answer`, `Survey`,
`Value`, or another normally demoted class disable the default non-clinical
demotion for that filtered result set.

**include\_context** `boolean` (default: false)

When `true`, adds a `context` object containing the suggestion's vocabulary,
domain, and concept class.

**vocab\_release** `string`

Vocabulary release to query. Defaults to the current release.

## Response

**meta** `object`

Request and vocabulary-release metadata.

**success** `boolean`

Whether the request succeeded.

**data** `object`

**Suggestion response**

**query** `string`

The supplied query.

**suggestions** `array`

Matching concepts. Each item includes `suggestion`, `concept_id`,
`concept_code`, `vocabulary_id`, `domain_id`, `concept_class_id`, and
`standard_concept`.

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

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

response = requests.get(
    "https://api.omophub.com/v1/search/suggest",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"query": "diab", "page_size": 5, "vocabulary_ids": "SNOMED"},
)
data = response.json()
```

```ts TypeScript theme={null}
const response = await fetch(
  'https://api.omophub.com/v1/search/suggest?query=diab&page_size=5&vocabulary_ids=SNOMED',
  { headers: { Authorization: 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
```

```json theme={null}
{
  "success": true,
  "data": {
    "query": "diab",
    "suggestions": [
      {
        "suggestion": "Type 2 diabetes mellitus",
        "concept_id": 201826,
        "concept_code": "44054006",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S"
      }
    ]
  },
  "meta": {
    "request_id": "req_suggest_123",
    "timestamp": "2026-09-05T12:00:00.000Z",
    "vocab_release": "2026.2",
    "search": {
      "query": "diab",
      "total_results": 1,
      "filters_applied": {
        "context": false
      }
    }
  }
}
```

## Errors

* `400 Bad Request` when `query` is missing or invalid, or a supported parameter is malformed.
* `401 Unauthorized` when authentication is missing or invalid.
* `403 Forbidden` when a requested vocabulary is restricted.
* `429 Too Many Requests` when the rate limit is exceeded.
* `500 Internal Server Error` or `503 Service Unavailable` when suggestion retrieval fails.

The endpoint propagates service and database failures; it does not replace them with empty or fabricated suggestions.


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