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

> Search across OMOP vocabulary names and descriptions to find the right terminology - SNOMED, LOINC, ICD-10, and the full OHDSI-supported catalog.

Search for vocabularies by name or description. Returns matching vocabularies with relevance scoring.

## Query Parameters

<ParamField query="query" type="string" required>
  Search query string. Searches across vocabulary names and descriptions.
</ParamField>

<ParamField query="page" type="integer" optional default="1">
  Page number for pagination (1-based).
</ParamField>

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

<ParamField query="include_inactive" type="boolean" optional default="false">
  Include inactive vocabularies in search results.
</ParamField>

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

  <br />

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

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful.
</ResponseField>

<ResponseField name="data" type="array">
  Array of matching vocabulary objects.

  <Expandable title="Vocabulary Object">
    <ResponseField name="vocabulary_id" type="string">
      Unique identifier for the vocabulary.
    </ResponseField>

    <ResponseField name="vocabulary_name" type="string">
      Full name of the vocabulary.
    </ResponseField>

    <ResponseField name="vocabulary_reference" type="string">
      Reference or source for the vocabulary.
    </ResponseField>

    <ResponseField name="vocabulary_version" type="string">
      Version of the vocabulary.
    </ResponseField>

    <ResponseField name="vocabulary_concept_id" type="integer">
      OMOP concept ID for the vocabulary.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  Response metadata.

  <Expandable title="Metadata Object">
    <ResponseField name="request_id" type="string">
      Unique identifier for this request.
    </ResponseField>

    <ResponseField name="vocab_release" type="string">
      Vocabulary release version used.
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      Response timestamp (ISO format).
    </ResponseField>

    <ResponseField name="search" type="object">
      <ResponseField name="query" type="string">Search query used.</ResponseField>
      <ResponseField name="total_results" type="integer">Total matching vocabularies.</ResponseField>
      <ResponseField name="filters_applied" type="object">Filters that were applied.</ResponseField>
    </ResponseField>

    <ResponseField name="pagination" type="object">
      <ResponseField name="page" type="integer">Current page number.</ResponseField>
      <ResponseField name="page_size" type="integer">Items per page.</ResponseField>
      <ResponseField name="total_items" type="integer">Total items available.</ResponseField>
      <ResponseField name="total_pages" type="integer">Total number of pages.</ResponseField>
      <ResponseField name="has_next" type="boolean">Whether next page exists.</ResponseField>
      <ResponseField name="has_previous" type="boolean">Whether previous page exists.</ResponseField>
    </ResponseField>
  </Expandable>
</ResponseField>

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

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

  response = requests.get(
      "https://api.omophub.com/v1/vocabularies/search",
      params={"query": "SNOMED"},
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  )
  data = response.json()
  for vocab in data["data"]:
      print(f"{vocab['vocabulary_id']}: {vocab['vocabulary_name']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.omophub.com/v1/vocabularies/search?query=SNOMED',
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );
  const data = await response.json();
  data.data.forEach(vocab => {
    console.log(`${vocab.vocabulary_id}: ${vocab.vocabulary_name}`);
  });
  ```

  ```bash cURL (with options) theme={null}
  curl -X GET "https://api.omophub.com/v1/vocabularies/search?query=drug&include_inactive=true&page_size=50" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": [
      {
        "vocabulary_id": "SNOMED",
        "vocabulary_name": "Systematized Nomenclature of Medicine Clinical Terms",
        "vocabulary_reference": "SNOMED International",
        "vocabulary_version": "US Edition 20240301",
        "vocabulary_concept_id": 45756746
      },
      {
        "vocabulary_id": "Nebraska Lexicon",
        "vocabulary_name": "Nebraska Lexicon",
        "vocabulary_reference": "University of Nebraska",
        "vocabulary_version": "2024-01",
        "vocabulary_concept_id": 32675
      }
    ],
    "meta": {
      "request_id": "req_abc123",
      "vocab_release": "2025.1",
      "timestamp": "2025-01-05T10:00:00Z",
      "search": {
        "query": "SNOMED",
        "total_results": 2,
        "filters_applied": {
          "search_type": "full_text_search",
          "include_inactive": false
        }
      },
      "pagination": {
        "page": 1,
        "page_size": 20,
        "total_items": 2,
        "total_pages": 1,
        "has_next": false,
        "has_previous": false
      }
    }
  }
  ```
</ResponseExample>

## Usage Examples

### Basic Search

Search for vocabularies by name:

```bash theme={null}
GET /v1/vocabularies/search?query=SNOMED
```

### With Pagination

Search with custom page size:

```bash theme={null}
GET /v1/vocabularies/search?query=ICD&page=1&page_size=50
```

### Include Inactive

Include deprecated vocabularies:

```bash theme={null}
GET /v1/vocabularies/search?query=classification&include_inactive=true
```

## Related Endpoints

* [List Vocabularies](/api-reference/vocabularies/list-vocabularies) - List all vocabularies
* [Get Vocabulary](/api-reference/vocabularies/get-vocabulary) - Get specific vocabulary details
