Skip to main content
Search for concepts by text. The SDK normalises three possible server response shapes ({ concepts: [...] }, legacy { data: [...] }, bare Concept[]) into a stable SearchResult - data.concepts is always a Concept[]:

Parameters

Filter Combinations

Autocomplete

Get suggestions as the user types. The response is { query, suggestions: [...] } - each entry nests the concept under suggestion:

Pagination

Manual Pagination

Auto-Pagination Iterator

basicIter is an async generator that walks every page and yields one concept at a time:
Async iterators throw OMOPHubIteratorError on page failure (generators can’t gracefully yield discriminated errors). Use the eager basicAll(...) variant if you prefer accumulating errors as values. See Error Handling.

Eager Collect

POST-based search with relationship filters:

Advanced Search Parameters

Relationship Filters

Embedding-based natural-language search. The SDK normalises the response so data.results is always a populated array:
With filters:

Semantic Search Parameters

Semantic Search Iterator

Run up to 50 keyword searches in a single API call:
The per-search entries (BulkBasicSearchInput) use snake_case keys (search_id, vocabulary_ids, domain_ids, page_size) — they’re a direct pass-through of the API payload, not a camelCase options object. The outer defaults object follows the same convention. This is the only place in the SDK where snake_case appears at the TypeScript surface.

Bulk Basic Parameters

Up to 25 semantic searches per call:

Find Similar Concepts

Find concepts similar to a reference. Provide exactly one of conceptId, conceptName, or query. The discriminated union enforces this at the type level; a runtime check defends against JS callers:
similar() uses a two-arg signature similar(options, requestOptions?) - its query XOR variant would otherwise collide with PerCallOptions.query (the escape-hatch params record). Pass signal, headers, or idempotencyKey via the second argument.

Similar Concepts Parameters

Algorithm Comparison