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

# Get Concept Level

> Get the hierarchical level and depth of an OMOP concept within its vocabulary tree for quick classification and hierarchy-aware filtering.

## Overview

This endpoint returns basic hierarchical positioning information for a concept, including its depth from root concepts and counts of ancestors and descendants.

## Path Parameters

**conceptId** `integer` *required*

The unique OMOP concept ID to get level information for

## Query Parameters

**vocab\_release** `string`

Specific vocabulary release version (e.g., "2025.1")

## Response

**success** `boolean` *required*

Indicates whether the request was successful

**data** `object` *required*

Response data containing concept level information

**data**

**concept\_id** `integer`

The concept ID that was queried

**level** `integer`

The level of the concept in the hierarchy (0-based)

**depth\_from\_root** `integer`

Number of levels from the root concept to this concept

**breadth\_at\_level** `integer`

Number of concepts at the same level (may be null if not calculated)

**total\_descendants** `integer`

Total number of descendant concepts below this concept

**total\_ancestors** `integer`

Total number of ancestor concepts above this concept

**meta** `object` *required*

Response metadata and API information

**meta**

**request\_id** `string`

Unique request identifier for debugging

**timestamp** `string`

ISO 8601 timestamp of the response

**vocab\_release** `string`

Vocabulary release version used

```bash cURL theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/201826/level" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

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

concept_id = 201826  # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/level"

headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
data = response.json()

level_info = data['data']

print(f"Concept ID: {level_info['concept_id']}")
print(f"Depth from root: {level_info['depth_from_root']}")
print(f"Total ancestors: {level_info['total_ancestors']}")
print(f"Total descendants: {level_info['total_descendants']}")
```

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

// Not yet exposed as a dedicated SDK method - use the typed low-level helper.
const client = new OMOPHub();

interface ConceptLevel {
  concept_id: number;
  depth_from_root: number;
  total_ancestors: number;
  total_descendants: number;
}

const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<ConceptLevel>(`/concepts/${conceptId}/level`);

console.log(`Concept ID: ${data?.concept_id}`);
console.log(`Depth from root: ${data?.depth_from_root}`);
console.log(`Total ancestors: ${data?.total_ancestors}`);
console.log(`Total descendants: ${data?.total_descendants}`);
```

```json theme={null}
{
  "success": true,
  "data": {
    "concept_id": 201826,
    "level": 0,
    "depth_from_root": 4,
    "breadth_at_level": null,
    "total_descendants": 15,
    "total_ancestors": 3
  },
  "meta": {
    "request_id": "req_concept_level_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.1"
  }
}
```

## Usage Examples

### Basic Level Information

Get hierarchy level for a concept:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/201826/level" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### With Specific Vocabulary Version

Get level information for a specific vocabulary release:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/201826/level?vocab_release=2025.1" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Important Notes

* **Depth interpretation** - `depth_from_root` indicates how many "Is a" relationship steps exist between this concept and the root
* **Descendant count** - `total_descendants` includes all child concepts at any depth below
* **Ancestor count** - `total_ancestors` includes all parent concepts up to the root

## Related Endpoints

* [Get Concept Hierarchy](https://docs.omophub.com/api-reference/concepts/get-concept-hierarchy) - Full hierarchical tree
* [Get Concept Ancestors](https://docs.omophub.com/api-reference/concepts/get-concept-ancestors) - Parent concepts
* [Get Concept Descendants](https://docs.omophub.com/api-reference/concepts/get-concept-descendants) - Child concepts


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