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

# Suggest Concepts

## Overview

Get intelligent concept suggestions for autocomplete functionality, based on
partial text input. Candidate evidence includes exact published synonyms,
concept-name prefixes and substrings, and source-code prefixes.

### Ordering

Clinical utility is the outer ordering tier, using the API's default ranking
policy documented under **Relevance Scoring** in
[Basic Search](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`. The final ID tie-break makes pagination
deterministic.

This endpoint and [`/v1/search/suggest`](https://docs.omophub.com/api-reference/search/search-suggest)
share one implementation and therefore one ordering.

> [!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 text input for suggestions (minimum 2 characters, maximum 100
characters)

**page** `integer` (default: 1)

Page number for pagination (1-based)

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

Number of suggestions per page (max: 100)

**vocabulary\_ids** `string`

Comma-separated list of vocabulary IDs to filter suggestions (e.g.,
"SNOMED,ICD10CM")

**domain\_ids** `string`

Comma-separated list of domain IDs to filter suggestions (e.g.,
"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.

**vocab\_release** `string`

Vocabulary release version to query (e.g., "2025.1"). Defaults to latest
release.

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

```bash cURL with filters theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/suggest?query=diab&vocabulary_ids=SNOMED&domain_ids=Condition&page=1&page_size=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

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

params = {
    "query": "diab",
    "page": 1,
    "page_size": 5,
    "vocabulary_ids": "SNOMED",
    "domain_ids": "Condition",
    "concept_class_ids": "Clinical Finding"
}
response = requests.get(
    "https://api.omophub.com/v1/concepts/suggest",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params=params
)
data = response.json()
```

```ts TypeScript theme={null}
import { OMOPHub } from '@omophub/omophub-node';

const client = new OMOPHub();
const { data } = await client.concepts.suggest('diab', {
  page: 1,
  pageSize: 5,
  vocabularyIds: ['SNOMED'],
  domainIds: ['Condition'],
});
```

## Response Fields

**success** `boolean`

Whether suggestion generation succeeded.

**data** `array`

Suggested concept records.

**data\[].concept\_id** `integer`

OMOP concept identifier.

**data\[].concept\_name** `string`

Primary concept name.

**data\[].concept\_code** `string`

Source vocabulary code.

**data\[].vocabulary\_id** `string`

Vocabulary identifier.

**data\[].domain\_id** `string`

OMOP domain.

**data\[].concept\_class\_id** `string`

Concept class.

**data\[].standard\_concept** `string | null`

`S`, `C`, or null.

**data\[].valid\_start\_date** `string`

Validity start date.

**data\[].valid\_end\_date** `string`

Validity end date.

**data\[].invalid\_reason** `string | null`

Invalidity marker, or null.

**meta** `object`

Request, release, and pagination metadata.

**meta.request\_id** `string`

Request correlation ID.

**meta.timestamp** `string`

Response timestamp.

**meta.vocab\_release** `string`

Vocabulary release used.

**meta.pagination** `object`

Page, page size, totals, and navigation flags.

```json theme={null}
{
  "success": true,
  "data": [
    {
      "concept_id": 201826,
      "concept_name": "Type 2 diabetes mellitus",
      "concept_code": "44054006",
      "vocabulary_id": "SNOMED",
      "domain_id": "Condition",
      "concept_class_id": "Clinical Finding",
      "standard_concept": "S",
      "valid_start_date": "2002-01-31",
      "valid_end_date": "2099-12-31",
      "invalid_reason": null
    },
    {
      "concept_id": 4000678,
      "concept_name": "Diabetes mellitus",
      "concept_code": "73211009",
      "vocabulary_id": "SNOMED",
      "domain_id": "Condition",
      "concept_class_id": "Clinical Finding",
      "standard_concept": "S",
      "valid_start_date": "2002-01-31",
      "valid_end_date": "2099-12-31",
      "invalid_reason": null
    },
    {
      "concept_id": 435216,
      "concept_name": "Type 1 diabetes mellitus",
      "concept_code": "46635009",
      "vocabulary_id": "SNOMED",
      "domain_id": "Condition",
      "concept_class_id": "Clinical Finding",
      "standard_concept": "S",
      "valid_start_date": "2002-01-31",
      "valid_end_date": "2099-12-31",
      "invalid_reason": null
    },
    {
      "concept_id": 4174977,
      "concept_name": "Diabetic retinopathy",
      "concept_code": "4855003",
      "vocabulary_id": "SNOMED",
      "domain_id": "Condition",
      "concept_class_id": "Clinical Finding",
      "standard_concept": "S",
      "valid_start_date": "2002-01-31",
      "valid_end_date": "2099-12-31",
      "invalid_reason": null
    },
    {
      "concept_id": 443767,
      "concept_name": "Diabetic nephropathy",
      "concept_code": "127013003",
      "vocabulary_id": "SNOMED",
      "domain_id": "Condition",
      "concept_class_id": "Clinical Finding",
      "standard_concept": "S",
      "valid_start_date": "2002-01-31",
      "valid_end_date": "2099-12-31",
      "invalid_reason": null
    }
  ],
  "meta": {
    "request_id": "req_suggest_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.2",
    "pagination": {
      "page": 1,
      "page_size": 5,
      "total_items": 47,
      "total_pages": 10,
      "has_next": true,
      "has_previous": false
    }
  }
}
```


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