curl -X GET "https://api.omophub.com/v1/search/facets?query=diabetes&vocabulary_ids=SNOMED,ICD10CM&bucket_limit=20" \ -H "Authorization: Bearer YOUR_API_KEY"
import { OMOPHub } from '@omophub/omophub-node';// Not yet exposed as a dedicated SDK method - use the typed low-level helper.const client = new OMOPHub();const { data } = await client.get<unknown>('/search/facets', { query: { query: 'diabetes', vocabulary_ids: 'SNOMED,ICD10CM', bucket_limit: 20, },});
Retrieve search facets for filtering medical terminology search results by vocabulary, domain, concept class, and valid-start year.
curl -X GET "https://api.omophub.com/v1/search/facets?query=diabetes&vocabulary_ids=SNOMED,ICD10CM&bucket_limit=20" \ -H "Authorization: Bearer YOUR_API_KEY"
import { OMOPHub } from '@omophub/omophub-node';// Not yet exposed as a dedicated SDK method - use the typed low-level helper.const client = new OMOPHub();const { data } = await client.get<unknown>('/search/facets', { query: { query: 'diabetes', vocabulary_ids: 'SNOMED,ICD10CM', bucket_limit: 20, },});
This endpoint provides faceted search capabilities for medical terminology, returning aggregated counts that can be used to filter and refine search results. Facets help users understand the distribution of concepts across different dimensions.
Query Parameters
string
Search query to generate facets for. When provided, facets reflect the
distribution of matching concepts.
string
Filter facets to specific vocabularies (comma-separated) Examples: SNOMED, ICD10CM,LOINC, RxNorm
string
Filter facets to specific domains (comma-separated). Examples: Condition, Drug,Measurement
integer
default:"20"
Maximum number of buckets returned for each facet category. Minimum: 1;
maximum: 100. Counts omitted by this limit are reported in the corresponding
facet metadata other_count.
string
Specific vocabulary release version (defaults to latest) Examples: 2025.1, 2024.2
Response
boolean
Indicates if the request was successful
object
Contains the faceted search results
Show data
string
The search query provided (empty string if none)
integer
Number of concepts represented by each successful facet category. For a
text query this uses the same candidate set and 10,050-result maximum as
/v1/search/concepts (50 exact-name, 5,000 name/code, and 5,000 synonym
candidates before duplicate removal).
object
Object containing facet categories and their values
Number of concepts in this domain matching the query
array
Concept class facets with counts
Show concept_class item
string | null
Concept class identifier (e.g., “Clinical Finding”, “Procedure”)
or null for the explicit Unknown bucket.
string
Human-readable concept class name
integer
Number of concepts in this class matching the query
array
Valid-start year facets
Show year item
integer | null
Year extracted from the concept’s valid_start_date, or null
when no valid date is available.
integer
Number of matching concepts with this valid-start year
object
Reconciliation information keyed by facet category. Each category has
total_buckets, returned_buckets, returned_count, and other_count.
For every successful category,
returned_count + other_count = total_items.
object
Facet completion status
Show facet_status
boolean
true when one or more facet queries failed. Partial responses are not cached.
array
Failed category names. Values are vocabularies, domains, concept_classes, or years. An empty array means all categories completed successfully.
object
Response metadata
Show meta
string
Unique identifier for the request
string
Vocabulary release version used
curl -X GET "https://api.omophub.com/v1/search/facets?query=diabetes&vocabulary_ids=SNOMED,ICD10CM&bucket_limit=20" \ -H "Authorization: Bearer YOUR_API_KEY"
import { OMOPHub } from '@omophub/omophub-node';// Not yet exposed as a dedicated SDK method - use the typed low-level helper.const client = new OMOPHub();const { data } = await client.get<unknown>('/search/facets', { query: { query: 'diabetes', vocabulary_ids: 'SNOMED,ICD10CM', bucket_limit: 20, },});
GET /v1/search/facets?query=medication&vocabulary_ids=RxNorm,NDC
General Facets Without Query
Get overall distribution of concepts:
GET /v1/search/facets
Facet Types
Vocabularies
Shows distribution across medical vocabularies (SNOMED, ICD10CM, LOINC, RxNorm, etc.). Use to filter searches to specific terminology systems.
Domains
Shows distribution across clinical domains (Condition, Drug, Procedure, Measurement, etc.). Use to focus on specific types of medical concepts.
Concept Classes
Shows distribution across concept classifications (Clinical Finding, Disorder, Ingredient, etc.). Provides more granular filtering than domains.
Years
Shows the distribution by the year in each concept’s valid_start_date.
Reconciliation and failures
Facet buckets are built from one candidate set, so all four categories describe
the same total_items. A successful response is therefore complete and reports
facet_status.partial: false. If candidate retrieval fails, the endpoint returns
an error instead of combining categories from different candidate sets.When bucket_limit omits lower-frequency buckets, they are counted in
other_count; they are not silently discarded. Null or empty source values are
returned as an explicit Unknown/null bucket and are always retained within
the limit.