Path Parameters
The unique identifier of the concept to retrieve hierarchy for
Example:
Example:
73211009
(Diabetes mellitus)Query Parameters
Filter hierarchy to specific vocabulary
Example:
Example:
SNOMED
Maximum number of ancestor hierarchy levels to traverse (default: 5)
Range:
Range:
1-10
Maximum number of descendant hierarchy levels to traverse (default: 3)
Range:
Range:
1-10
Convenient shorthand to set both
Range:
Note: If
max_ancestor_levels
and max_descendant_levels
to the same value (default: 10)Range:
1-20
Note: If
max_levels
is provided along with max_ancestor_levels
or max_descendant_levels
, the specific parameters take precedenceMaximum number of results to return per query for performance optimization (applies to ancestors and descendants separately)
Default:
Range:
Recommended: Use 100-500 for interactive queries, up to 1000 for bulk analysis
Default:
500
Range:
1-5000
Recommended: Use 100-500 for interactive queries, up to 1000 for bulk analysis
This parameter prevents query timeouts and ensures predictable response times. The default limit handles 95%+ of use cases while maintaining sub-second performance.
Comma-separated list of relationship types to follow for hierarchy traversal
Default:
Example:
Default:
Is a
Example:
Is a,Part of,Has part
Include hierarchical distance (level) for each concept
Include complete classification_paths for both ancestors and descendants when true
Only return standard concepts in the hierarchy
Include deprecated/invalid concepts in hierarchy
Include synonym information for all concepts
Include detailed hierarchy statistics and analysis
Response format for hierarchy data
Options:
Options:
flat
, tree
, graph
Response
The central concept for which hierarchy was retrieved
Array of ancestor concepts in hierarchical order
Array of descendant concepts in hierarchical order
Hierarchical tree representation (when format=‘tree’)
Graph representation with nodes and edges (when format=‘graph’)
Detailed hierarchy analysis (when include_statistics=true)
Usage Examples
Basic Hierarchy View
Get complete hierarchy context for a concept:Limited Depth Hierarchy
Control the depth of ancestor and descendant traversal:Performance-Optimized Queries
Usemax_results
and max_levels
to limit result size for better performance:
Tree Format for Visualization
Get hierarchy in tree structure for UI components:Graph Format for Network Visualization
Get hierarchy as graph data for network diagrams:Detailed Analysis
Get comprehensive hierarchy with statistics and synonyms:Related Endpoints
- Get Concept Ancestors - Detailed ancestor information
- Get Concept Descendants - Detailed descendant information
- Get Concept Relationships - All concept relationships
- Search Concepts - Search within hierarchies
Notes
- The hierarchy endpoint is optimized for visualization and provides balanced ancestor/descendant views
- Tree format is ideal for hierarchical UI components and taxonomy browsers
- Graph format includes node positioning hints for network visualizations
- Statistics provide insights into hierarchy complexity and structure
- Performance: Use the
max_results
parameter to control query size. The default (500) provides optimal performance for most use cases while preventing timeouts - Large hierarchies are automatically limited by
max_results
to prevent performance issues and ensure predictable response times - Cross-vocabulary concepts may show relationships spanning multiple vocabularies
- Level numbering uses negative values for ancestors and positive for descendants
- For very large hierarchies, consider paginating through results or using more specific filters to reduce result set size