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

# Basic Concept Search

## Overview

Search for medical concepts using text queries. This endpoint provides fast, relevant results across all supported vocabularies using advanced search algorithms.

<Tip>
  **For clinical concept lookups**, add `vocabulary_ids=SNOMED` and/or `domain_ids=Condition` filters. Without filters, results include all vocabularies (LOINC questionnaires, administrative codes, etc.) which may not be the clinical concepts you expect.

  This endpoint performs **keyword matching** - best for exact medical terms like "myocardial infarction" or concept codes like "E11.9". For **natural language queries** like "heart attack" or "high blood sugar", use [Semantic Search](/api-reference/search/semantic-search) which uses neural embeddings to understand clinical meaning and returns results ranked by similarity.
</Tip>

## Query Parameters

<ParamField query="query" type="string" required>
  Search query text (1-100 characters)
</ParamField>

<ParamField query="vocabulary_ids" type="string">
  Filter search to specific vocabularies (comma-separated)

  <br />

  **Examples**: `SNOMED`, `SNOMED,ICD10CM`, `RXNORM,NDC`
</ParamField>

<ParamField query="domain_ids" type="string">
  Filter by medical domains (comma-separated)

  <br />

  **Examples**: `Condition`, `Condition,Procedure`, `Drug,Device`
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number (1-based indexing)
</ParamField>

<ParamField query="page_size" type="integer" default="20">
  Number of results per page (max: 1000)
</ParamField>

<ParamField query="vocab_release" type="string">
  Specific vocabulary release version to query

  <br />

  **Example:** `2025.1`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.omophub.com/v1/search/concepts?query=hypertension&page_size=10" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

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

  params = {"query": "hypertension", "page_size": 10}
  response = requests.get(
      "https://api.omophub.com/v1/search/concepts",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      params=params
  )
  concepts = response.json()
  ```

  ```javascript JavaScript (Node.js) theme={null}
  const params = new URLSearchParams({
    query: 'hypertension',
    page_size: '10'
  });

  const response = await fetch(`https://api.omophub.com/v1/search/concepts?${params}`, {
    headers: {
      'Authorization': `Bearer ${process.env.OMOPHUB_API_KEY}`
    }
  });
  const concepts = await response.json();
  ```

  ```bash cURL (filtered) theme={null}
  curl -X GET "https://api.omophub.com/v1/search/concepts?query=diabetes&vocabulary_ids=SNOMED&domain_ids=Condition" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python (filtered) theme={null}
  import requests

  params = {
      "query": "diabetes",
      "vocabulary_ids": "SNOMED",
      "domain_ids": "Condition"
  }
  response = requests.get(
      "https://api.omophub.com/v1/search/concepts",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      params=params
  )
  filtered_concepts = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": [
      {
        "concept_id": 320128,
        "concept_name": "Essential hypertension",
        "concept_code": "59621000",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S",
        "match_score": 0.95,
        "match_type": "exact",
        "valid_start_date": "1970-01-01",
        "valid_end_date": "2099-12-31"
      },
      {
        "concept_id": 316866,
        "concept_name": "Hypertensive disorder",
        "concept_code": "38341003",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S",
        "match_score": 0.89,
        "match_type": "partial",
        "valid_start_date": "1970-01-01",
        "valid_end_date": "2099-12-31"
      },
      {
        "concept_id": 4124681,
        "concept_name": "Accelerated hypertension",
        "concept_code": "48146000",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S",
        "match_score": 0.85,
        "match_type": "fuzzy",
        "valid_start_date": "1970-01-01",
        "valid_end_date": "2099-12-31"
      }
    ],
    "meta": {
      "pagination": {
        "page": 1,
        "page_size": 10,
        "total_items": 247,
        "total_pages": 25,
        "has_next": true,
        "has_previous": false
      },
      "search": {
        "query": "hypertension",
        "total_results": 247,
        "filters_applied": {
          "vocabulary_ids": ["SNOMED", "ICD10CM"]
        }
      },
      "request_id": "req_search_123",
      "timestamp": "2024-12-22T10:00:00Z",
      "vocab_release": "2025.2"
    }
  }
  ```
</ResponseExample>

## Search Features

### 1. **Fuzzy Matching**

Handles typos and misspellings automatically.

### 2. **Synonym & Alias Matching**

Matches concept synonyms and alternate names when `include_synonyms=true`.

### 3. **Relevance Scoring**

Results ranked by relevance with match scores.

### 4. **Multi-vocabulary**

Searches across all vocabularies simultaneously.

### 5. **Fast Performance**

Optimized for sub-second response times.

## Common Use Cases

### 1. Clinical Coding

Find appropriate codes for clinical documentation.

### 2. Data Standardization

Map free-text clinical notes to standard concepts.

### 3. Quality Assurance

Validate and standardize existing coded data.

### 4. Research Applications

Find concepts for cohort definitions and outcome measures.
